[Nexus 7 (2013) General] Vaykadji:
Hello,

I'm gonna describe here a method that can bypass the "loop device not found" bug with Android 4.3 and LinuxOnAndroid (also called Complete Linux Installer).

With that method, you will be able to run Ubuntu 12.04.

It will not harm your device

, since it's only an application and a "mount loop".

This is not from me, I found some loose informations on LoA's forum and just tried it out. Then I wrote this guide when I finally got it working. Credits are at the end of the post.

Informations :

- Any Kernel should work (I use ElementalX 1.4)

- Any ROM should work (I use ParanoidAndroid 3.99)

- Any 4.3 device should work (this has been seen working on Nexus 4 and Nexus 7 flo).

- This trick should work for any GNU/Linux armel distribution, but you'll have to change some things, like "startlxde" command and others. I can't help you for that.​

What do I need ?

- Root access(SuperSu is recommended)

- BusyBox

- a root file explorer (ES File Explorer is recommended)

- Android 4.3 or CustomROM based on 4.3

- A computer running GNU/Linux (Ubuntu is recommended, but this should work with any debian-based distro. LiveUSB should work)

- Internet access (Around

450Mb

download is needed, so 3G or 4G is not recommended)

- ... some free time.​

What should I do ?

Step 1 : Install apk on your device

Download and install those 3 applications :

- Complete Linux Installer

- Terminal Emulator

- Android-VNC-viewer​

Step 2 : Prepare the .img ubuntu disk on your computer

- Start Ubuntu on your computer.

- Download the LinuxOnAndroid "ubuntu.img" from Sourceforge (you'll need the 'small' version : 396Mo)

- Create a new folder (anywhere you want, ext4 partition is recommended, so /home/user is good) and call it "loa" (for LinuxOnAndroid)

[I]Example : [/I]
mkdir /home/yourname/loa

- Extract the ubuntu1204-v4-small.zip in that folder

- Open a terminal and navigate to the directory where the ubuntu.img was extracted :

cd /home/yourname/loa

- Enter the following commands :

#Create the needed directories
mkdir ubuntunew ubuntuold

#Create a new empty .img
dd if=/dev/zero of=ubuntunew.img bs=1M count=0 seek=4096

#Format your new .img into ext4 (original is ext2 and bugs with Android 4.3)
mkfs.ext4 -F ubuntunew.img

#Mount the .img into the directories
sudo mount -o loop ubuntu.img ubuntuold
sudo mount -o loop ubuntunew.img ubuntunew

#Copy the content of downloaded ext2.img into created ext4.img (may process during some time)
sudo cp -r ubuntuold/* ubuntunew

#Unmount mounted .img
sudo umount ubuntuold
sudo umount ubuntunew

Step 3 : prepare your device for the new ubuntunew.img

- Copy the ubuntunew.img (4Go) from your computer to your device

- Place the ubuntunew.img in SDCARD/ubuntu/ubuntunew.img (you'll need to create the directory)​

Step 4 : prepare Complete-Linux-Installer for the new ubuntunew.img

- Open "ES File explorer", turn on the "root explorer" option

- Navigate to /data/data/com.zpwebsites.linuxonandroid/files

- Edit bootscript.sh with a text editor :

1) In "Set up loop device and mount image" :

The line :

$bbox mount -t ext2 /dev/block/loop255 $mnt

becomes

$bbox mount -t ext4 /dev/block/loop255 $mnt

2) In "Mount all required partitions" :

add the line :

$bbox mount -o bind /sys/fs/selinux $mnt/selinux

3) In "Unmount all user defined mounts if any" :

add the line :

$bbox umount $mnt/selinux

- Save changes in bootscript.sh​

Step 5 : Use Complete-Linux-Installer to boot ubuntunew.img

- Open "Complete-Linux-Installer

- Go to "Launch" > "Settings" > "Add"

Name : Droidbuntu

Image : /storage/emulated/0/ubuntu/ubuntunew.img

- Choose "Droidbuntu" from the list and "Start Linux"

- Proceed with the installation (terminal starts and ask you a few things) :

Example values I used on my N7 flo :
- resolution : 1920x1200 (I disabled navbar and statusbar, if you did not, you'll have to try acceptable values)
- run vnc : [B]yes[/B] (important! it will allow you to start the GUI)
- run ssh : no
- password : whatever you want

- You should now be in linux shell (you can tell by the root@localhost:/# in the terminal emulator)

- Enter the command :

#It will allow you to start the GUI by adding startlxde to the xstartup script
echo startlxde | tee /home/ubuntu/.vnc/xstartup

- Leave the terminal alone (don't close it) and open "androidVNC"

Values to use :

Nickname : Droidbuntu
Password : ubuntu
Adress : localhost
Port : 5900
Username : root

24-bit color (4 bpp)
Check the local mouse checkbox

- Clic on "Connect"​

You are now in Ubuntu 12.04 LXDE. :highfive:

You may want to change "entrymode" in settings, and use "Touchpad", it's better in my opinion.​

What's next ?

To start Ubuntu later, just open Complete-Linux-Installer and click "Start linux", then once you're in root@localhost, open VNC and "connect". Yes, it's that simple.

The command lines need to be entered in terminal emulator, not in lxterm nor any terminal in Ubuntu.​

Credits :

LinuxOnAndroid Team

Canonical and partners

Following LinuxOnAndroid forum users : clb, Isei, RobbH

NOTE : My english surely isn't perfect. If I made any errors, or if you don't understand a step, please tell me.