- Forum
- LG Android Phones
- More LG Phones
- LG Optimus Series
- Virgin Mobile Optimus V
- Optimus V Rooting, ROMs, and Hacks
Running Ubuntu Parallel to Android
- This will not replace or break your Android install. These instructions will get Ubuntu to load parallel to your current system. You'll be able to access Ubuntu through the Android-VNC-Viewer or any network connected computer with a VNC client. I've only tested this on Froyo.
Things you need:
LG Optimus V
2 Gbs free on the SD card FAT partition
A computer connected to the same network as the phone
SSH Client
Android-VNC-Viewer from the market
Instructions:
- Root your phone.
- Download the Ubuntu Image here: Download ubuntu.zip for free on uploading.com
- Unpack it into your sdcard: /sdcard/ubuntu/
- ADB Shell then run these commands while your phone has an internet connection:
Code:su cd /sdcard/ubuntu/ sh ubuntu.sh bootubuntu
- At this point you'll have Ubuntu running if you get the prompt "root@localhost:/#". But lets load the interface you are familiar with.
- Type the following and enter "y" to any prompts: (Don't actually type the text in red)
Code:apt-get update apt-get install openssh-server /etc/init.d/ssh start passwd (Enter the password you want to use when connecting.) ifconfig
- Now look for the IP address of your phone. Connect to your phone using the SSH client from a computer that is on the same network. Username: root
- Once you have successfully logged in type:
Code:export LANG=en_US.UTF-8 apt-get install tightvncserver apt-get install lxde cat > /root/.vnc/xstartup #!/bin/sh xrdb $HOME/.Xresources xsetroot -solid grey icewm & lxsession (After that last line, hit Ctrl + D twice.) cat > front export USER=root cd / rm -r -f tmp mkdir tmp cd / vncserver -geometry 800x600 (After this last line, hit Ctrl + D twice.) cat front /root/.bashrc > temp cp temp /root/.bashrc export USER=root vncserver -geometry 800x600 (Enter Password and Enter "no" to the prompt)
- While all this has been happening, your phone has been happily sitting there. It should still be fully functional.
- Fire up the Android-VNC-Viewer app:
Nickname: Ubuntu
Address: 127.0.0.1
Port: 5901
Color Format: 24-bit color - Hit connect and be amazed.
- Things will run somewhat sluggish. It should run faster if you connect via a desktop using a VNC client.
- After a reboot, if you want to run Ubuntu again, run the following command through any script or terminal:
Code:bootubuntu
Current Bugs:
- The soft keyboard isn't mapped correctly.
- It slows down the system when it is running.
Now you have a full fledged linux server running on your tiny phone.
Enjoy!
Here is how you can make your own custom Ubuntu image: How to Build CHROOT ARM Ubuntu Images for Android!
Credit to this extremely long youtube clip:
Originator of this: Debian & Android Together on G1 - Jay Freeman (saurik)04-28-2011 03:00 PMLike 3 -
-
-
As for losing 2 gigs...
Many of us have plenty to spare.
I'm kind of curious why it's 2 gigs when a live/install disk is only 600megs or so.04-28-2011 05:21 PMLike 0 - So this actually puts Ubuntu on our phones as a second os ? I'm a little confused. Sorry for the noob question but how else am I going to learn lol
Sent from my LG-VM670 using Tapatalk04-28-2011 05:28 PMLike 0 - You could run a torrent client, mini-web server, file server... anything you can do with Linux. Yes, I know Android can do most of that, but not all.
As for losing 2 gigs...
Many of us have plenty to spare.
I'm kind of curious why it's 2 gigs when a live/install disk is only 600megs or so.
@00_wrath_00
This runs Ubuntu on top of Android. So yes, it is a second OS, but it is running within the Android environment. This is actually perfect, because android provides all the drivers. It can use anything android uses.04-28-2011 06:08 PMLike 0 - Thanks for the info I will have to check this out. Seems interesting.
Sent from my LG-VM670 using Tapatalk04-28-2011 06:13 PMLike 0 - The two gigs is a choice. You can actually make it smaller or bigger, but that is space set aside for your Ubuntu system. This is how android and Ubuntu are kept separate from one another.
@00_wrath_00
This runs Ubuntu on top of Android. So yes, it is a second OS, but it is running within the Android environment. This is actually perfect, because android provides all the drivers. It can use anything android uses.
Might do it, for a Linux to Linux mount-able networking. The ftpserver is nice but I have to change my fstab everytime I reboot the router.04-28-2011 06:29 PMLike 0 - I was gonna post a tutorial on this a long time ago, but I had so many problems getting it set up, that I never did. It was giving me all kinds of errors, that took me 3 hours to fix. Definitely not for people new to linux. lol. Oh and as for building your own custom installation, you can ONLY do it with Ubuntu 8. Ubuntu 8 was the first with ARM processor support. Our processors are ARM6, Ubuntu 9 and up only support ARM7 processors. Just thought i'd save ya the time of finding that out yourself.04-28-2011 11:09 PMLike 2
- thx op
just would like to add that jay freeman (saurik) was the originator for debian on-top of android.
Debian & Android Together on G1 - Jay Freeman (saurik)04-29-2011 04:14 PMLike 0 - bigsupersquido_OWondered about Ubuntu.
Been running Debian squeeze for a while on my V. Sid works too.
My setup is based much on Saurik's work too, but I suspect the loop-mounted filesystem image is slowing things down for you. I'm using an ext4 partition instead (started with ext2 but SD cards are cheap and I'd rather the journaling cause wear than get ext2 corruption in a crash.)
Since Android mostly lives in flash memory, I bind-mount everything into the root filesystem. Rare crashes don't seem to mess anything up.
Debian file-managers make a great root explorer in the VNC.
Main geeky uses are Firefox (actually Iceweasel) for browsing Android can't handle and saving web pages, file compression/decompression without picky semifunctional apps, the compilers, a real bash terminal... I'm sure I forgot something.
I started with a 2GB card and am now using an 8GB.
@OP: could you share your boot script seperate from the Ubuntu image?
and, are you able to successfully use unionfs? I'll share details too if there is interest05-03-2011 10:04 PMLike 0 - Wondered about Ubuntu.
Been running Debian squeeze for a while on my V. Sid works too.
My setup is based much on Saurik's work too, but I suspect the loop-mounted filesystem image is slowing things down for you. I'm using an ext4 partition instead (started with ext2 but SD cards are cheap and I'd rather the journaling cause wear than get ext2 corruption in a crash.)
Since Android mostly lives in flash memory, I bind-mount everything into the root filesystem. Rare crashes don't seem to mess anything up.
Debian file-managers make a great root explorer in the VNC.
Main geeky uses are Firefox (actually Iceweasel) for browsing Android can't handle and saving web pages, file compression/decompression without picky semifunctional apps, the compilers, a real bash terminal... I'm sure I forgot something.
I started with a 2GB card and am now using an 8GB.
@OP: could you share your boot script seperate from the Ubuntu image?
and, are you able to successfully use unionfs? I'll share details too if there is interest
Because it does slow things down, I never made a startup script. I would imagine that it would just be that single line "bootubuntu". The rest of it is set to autostart within the image.
/root/.vnc/xstartup:
Code:#!/bin/sh xrdb $HOME/.Xresources xsetroot -solid grey icewm & lxsession
Code:export USER=root cd / rm -r -f tmp mkdir tmp cd / vncserver -geometry 800x600
...But I just realized now why it hasn't been working.
Code:vncserver -geometry 800x600
I am very interested in your setup. If it runs faster, we should scrap what I stole from that video and go with yours.05-03-2011 10:36 PMLike 0 - bigsupersquido_O
...But I just realized now why it hasn't been working.
Code:vncserver -geometry 800x600
Saurik's page details that process well, after setting the password in linux you need to enter it in the VNCviewer.
edit:sorry, Saurik uses SSH. The best description I've found for the VNC is here: on xda
Your setup runs without a VNC password? Interesting.
I am very interested in your setup. If it runs faster, we should scrap what I stole from that video and go with yours.
My current boot script needs reduced with a couple of loops, right now it's overly redundant for debugging and I never bothered to clean it up since it's working.
I'll post it relatively soon.
Another detail I forgot to mention, is I leave the root filesystem R/W since my version of this runs there instead of in an image. It also works ok with a chroot in the card partition, but I like the root access to everything from Debian which is trickier to manage running from the card instead of binding subdirectories into the / directory of Android.05-04-2011 04:06 PMLike 0 - bigsupersquido_OStandard disclaimer:
this script may bork your phone, trash your userdata, format system files, and etc., ad nauseum. Use at your own risk.
This script remounts / and /system both read/write and leaves them that way until you type exit in the bash shell of the chroot. Without r/w mounting, installing Debian packages gives some errors, since it's running in the real root filesystem.
All that aside, it's never hurt my device since beginning this experiment in early March, and I've had less than 5 crashes which required a reboot; no crashes at all since March.
Ok, enough suspense.
I've tested my condensed boot script for a day and can't find any obvious glitches, so here it is attached as boot.txt; the forum wouldn't let me attach it without an extension, so rename as boot with no extension.
I remount system r/w, copy the file to /system/xbin and chmod 4755 /system/xbin/boot
Assuming boot.txt is on your phone in /sdcard/download you can type this in a terminal:
Code:su mount -o remount /system /system cp /sdcard/download/boot.txt /system/xbin/boot chmod 4755 /system/xbin/boot
Code:adb remount adb push boot.txt /system/xbin/boot adb shell su chmod 4755 /system/xbin/boot exit
to use the script as-is, your linux flavor should be in the 2nd card partition.
open a terminal and type
Code:su boot
when you're finished with linux, reopen the same terminal and type
Code:exit
notes:
after much experimentation, I prefer the shell in SL4A for a terminal (even though the devs say it's old connectbot) because it runs the terminal as a service rather than just a process. It seems to be less likely for Android's oom killer to terminate that way.
hopefully this helps someone else out. I spent quite a while getting it just how I wanted it, many googlings and picking bits from here and there.
edit: just FYI, I tested this with Cyanogen and AOSP ROMs, with busybox symlinked to the commands it replaces. Doesn't work with stock ROM or others where you have to type things like 'busybox mount -o /system /system'
Also, I initially copied all files from overlapping Android directories into their Debian counterparts, with no overwrites, BEFORE running the boot script (this only needs to be done once AFAIK)
Code:yes n | cp -aiv /etc/* /sd-ext/etc yes n | cp -aiv /root/* /sd-ext/root yes n | cp -aiv /sbin/* /sd-ext/sbin yes n | cp -aiv /sys/* /sd-ext/sys
05-05-2011 08:06 PMLike 0 - Thanks for posting this! I'm going to try this when I have time.
And here is the bootubuntu script:
http://www.mediafire.com/?qwc6bwtvk56ab6tbigsupersquid likes this.05-05-2011 10:48 PMLike 1 - bigsupersquido_Othe bootubuntu script is similar in function.
there is a piece of it I'm going to cannibalize and absorb into mine, the part which checks for the existence of a directory before creating it.
let me know if my script gives you trouble and I'll try to help with it.
I forgot to mention, many of the chroot 'boot' methods I've looked at can't be politely shut down and require phone reboot to unmount. Mine (and it looks like your bootubuntu script as well if I'm reading it right,) can be exited and even run again afterwards without rebooting.
My eventual goal with this is to avoid the VNC viewer (another big slowdown for the chroot) and get access to the framebuffer device from linux. Android configures the fb device differently than X, and trying to use it as-is results in a blank screen. It doesn't lock up the phone, but no display without reboot.
@mmarz, you said in the first post that there was a problem with the soft keyboard? I haven't noticed any issues with mine except that I can't find a free 'full' keyboard for esc,ctrl,alt and F-keys.
The android-VNC-viewer I'm using (on google code , also an older version is in the market,) has them in the 'send keys' submenu, but I haven't gotten a soft keyboard with more than a ctrl key to use in the terminal.
(I added my 2 cents on the swype beta forum about special keys but they don't seem to care.)
The chroot method I'm using usually only seems to slow Android down if some CPU-intensive work is going on in the chroot, like building a package from source, running debootstrap, or something like that.
I'll wager the loop-mount is causing most of your system lag.05-06-2011 10:26 AMLike 0 - Maybe it is just with my soft keyboard that it is not mapped correctly. I am using the SlideIt keyboard. It may not be free, but it has lots features including the arrow keys. Or maybe it is my Debian image. The tutorial I took that image from also noted the keys being mapped incorrectly. Would you mind sharing how you setup your Debian package?05-06-2011 10:45 AMLike 0
- bigsupersquido_OMaybe it is just with my soft keyboard that it is not mapped correctly. I am using the SlideIt keyboard. It may not be free, but it has lots features including the arrow keys. Or maybe it is my Debian image. The tutorial I took that image from also noted the keys being mapped incorrectly. Would you mind sharing how you setup your Debian package?
I used debootstrap on my pc first, with the --foreign option since qemu won't run correctly on my old CPU.
then I ran a chroot on the phone, directly on the sdcard ext partition to complete the debootstrap --second-stage. The script for that chroot is simpler, since no directories get bound, just mounting the sd-ext partition and proc, sysfs, and devpts.
this was a major pain to get working since Android init doesn't use /dev/initctl but debootstrap expects it to be live. basically it ( debootstrap --second-stage ) locks up consistently at "I: configuring sysvinit"
(and a few other operations do the same thing.) A workaround is to create /dev/initctl yourself in the sd-ext partition, writing something to it before running debootstrap --second-stage and then when it hangs, reading from the chroot's /dev/initctl in another terminal instance often tricks the installer into thinking the node is live, and it continues.
Code:mknod sd-ext/dev/initctl p
Code:cat test > sd-ext/dev/initctl
Code:cat /sd-ext/dev/initctl
once debootstrap completes on the phone, exit the chroot. Then Saurik's instructions come back into play, copying /etc/resolv.conf from Android and so on. Then, copy Android's overlapping directories, and use the boot script I posted to run Debian and begin the apt-get marathon for a window manager, tightvncserver, and so on.
When I've got more time, maybe late tonight, I'll put up a full how-to thread starter, since I don't remember seeing many, if any (except for running linux natively INSTEAD of Android,) examples on the web which use my direct-mounted-partition method for chroot, although Saurik's is close (if only I had unionfs! but I don't want to bug AOSP for a kernel module, and haven't yet compiled my own kernel)mmarz likes this.05-06-2011 12:30 PMLike 1 - bigsupersquido_Ofor whomever may be interested, when I began this I couldn't find a small, fresh debian filesystem image for download so I had to learn to use debootstrap.
to save hassle for the community, I have uploaded a base install, debootstrapped on my V, uploaded from my V with iceweasel in debian. no extra packages. you'll need to apt-get tightvncserver and a window manager unless you just want the bash shell. I like xfce4 it's relatively small but functional; lots of people seem to like matchbox wm, too.
it's ready to go once you copy over the extra files from Android's /etc /root /sbin and /sys directories.
(mount the extended partition with debian at /sd-ext first)
Code:yes n | cp -aiv /etc/* /sd-ext/etc yes n | cp -aiv /root/* /sd-ext/root yes n | cp -aiv /sbin/* /sd-ext/sbin yes n | cp -aiv /sys/* /sd-ext/sys
here is the filesystem image
careful! use my script here at your own risk.
you can also chroot into the sd-ext directly, I'll post a script soon for you if you're worried about running in the root filesystem.
root password is root.
change it with
passwd
if you want.JerryScript likes this.05-08-2011 05:34 PMLike 1 - for whomever may be interested, when I began this I couldn't find a small, fresh debian filesystem image for download so I had to learn to use debootstrap.
to save hassle for the community, I have uploaded a base install, debootstrapped on my V, uploaded from my V with iceweasel in debian. no extra packages. you'll need to apt-get tightvncserver and a window manager unless you just want the bash shell. I like xfce4 it's relatively small but functional; lots of people seem to like matchbox wm, too.
it's ready to go once you copy over the extra files from Android's /etc /root /sbin and /sys directories.
here
careful! use my script at your own risk.
you can also chroot into the sd-ext directly, I'll post a script soon for you if you're worried about running in the root filesystem.
root password is root.
change it with
passwd
if you want.
i prefer xfce4.8 over 4.6 and thats only in testing atm, unless it is pinned05-08-2011 07:12 PMLike 0
- Forum
- LG Android Phones
- More LG Phones
- LG Optimus Series
- Virgin Mobile Optimus V
- Optimus V Rooting, ROMs, and Hacks
Running Ubuntu Parallel to Android
LINK TO POST COPIED TO CLIPBOARD