[Guide] Ubuntu chroot on rooted TPT

Search This thread

Anapmac

Member
Dec 27, 2010
33
36
Hey ThinkPadders,

So I found myself needing to do some programming on the road this weekend but dont have access to a laptop. So I'm plugging in a bunch of peripherals to my TPT and hoping to work off it. (UPDATE: It worked great! Just ran out of space in my pre-allocated image, see update #2 below) Forgive me if the outcome is a bit rough or this exists elsewhere, I'm in a bit of a rush but thought I'd throw this quickly out to anyone who may find it usefull (or is nice enough to complete it).

There's just a small modification from the Ubuntu on android instructions on AndroLinux. Sorry I cant post links as a crappy member X_x, but I think you know what to do with this:

www.androlinux.com/android-ubuntu-development/how-to-install-ubuntu-on-android/


Change the mount calls in each of the scripts from:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
to:
mount -o remount,rw -t yaffs2 /dev/block/mmcblk0p3 /system

That's about it. I've installed build essentials just with apt-get and got simple STL c++ to compile, so things seem good so far.

Here are pics of the TPT running vnc and ssh to localhost. I attached modified scripts if you dont want to do it yourself. All credit should go to Max Lee at AndroLinux and Charan Singh.

(And a hurrah for getting our kernel source!!)

UPDATE #1 (2-27-2012):
Terminal/ssh usages are great, but experiences with the stock ubuntu GUI are a little slow (probably due to the lack of tegra drivers on tested distributions). You can improve this GREATLY by using a lighter weight windows manager (lxde, xfce, unity 2d, etc).

UPDATE #2 (2-28-2012):
Also, you can skip using an image entirely. Since then I've partitioned a 32GB sdcard into 10GB fat32 + 22GB ext2 partitions and just directly copied a preinstalled/debootstrap'ed ubuntu and mounted it. This way you don't have to pre-allocate space with an image and can use both partitions for general storage (the fat32 is just for windows specific access). You could probably use space on the internal sdcard if you like. But I have a 16GB model so I went straight for an external solution.

I can extend this guide or create a one-click windows script to handle the entire setup/installation if there's interest.
 

Attachments

  • tpt_androlinux_scripts.zip
    1.9 KB · Views: 278
  • tpt_ubuntu_ssh.jpg
    tpt_ubuntu_ssh.jpg
    247.4 KB · Views: 2,172
  • tpt_ubuntu_vnc.jpg
    tpt_ubuntu_vnc.jpg
    191.9 KB · Views: 2,079
Last edited:

hidd3n_bit

Member
Dec 6, 2011
10
3
Cool stuff anapmac.
I too have an ubuntu chroot on my thinkpad (actually just copied the loop file from my droid x and didn't even have to change any settings)
Just a tip: I highly recommend swapping out the default window manager for lxde.
lxde is much more lightwight and will run a lot faster.
Also, you may want to try pointing apt at the debian repositories, debian seems to have more complete ARM repositories than ubuntu does.
 
  • Like
Reactions: Anapmac

splotz

Senior Member
Feb 10, 2012
108
10
Europe
How about libre office. Could it run in an usable speed on ubuntu on android, or would it do it if ubuntu only could get installed?
 

danjac

Senior Member
Feb 4, 2012
196
121
Hey,
could anyone help me...i managed to do all and it finally worked.
but i don't think it is quite useable, so what d0 I have to do to make all steps undone?

thanks for your help.
dan
 
Last edited:

baser5nature

Member
Nov 3, 2009
15
2
thanks for posting the changes required to get this working. I got it working with the ubuntu.img from the guide at androlinux.com

I've used the instructions there also to build an image of from ubuntu 11.10. I simply replaced the ubuntu.img with my own and all is working ok. I'm currently installing unity to see how slow it will be. or if it works at all.
 

Anapmac

Member
Dec 27, 2010
33
36
Cool stuff anapmac.
I too have an ubuntu chroot on my thinkpad (actually just copied the loop file from my droid x and didn't even have to change any settings)
Just a tip: I highly recommend swapping out the default window manager for lxde.
lxde is much more lightwight and will run a lot faster.
Also, you may want to try pointing apt at the debian repositories, debian seems to have more complete ARM repositories than ubuntu does.

Thanks for the tip. I did find loading firefox somewhat slow when I took the screenshots. This past weekend though I was only accessing the distribution through a terminal emulator (just ran the bootubuntu script to setup the chroot). After working with it, I'm very satisfied with this setup :) I'm planning to buy an external SD to use host a large ubuntu image (or anything else that's ARM compatible?). Maybe I'll look into the GUI if I get a chance.

There's also a native ubuntu setup on some android devices. That would be interesting to see how well the GUI performs when android isn't running next to it. Luckily for me, the terminal is perfect since I use vim :D

Hey,
could anyone help me...i managed to do all and it finally worked.
but i don't think it is quite useable, so what d0 I have to do to make all steps undone?

thanks for your help.
dan

Hey danjac,
when you exit out of the shell that bootubuntu launches, it unmounts the required loopback and folders for you. The setup script, ubuntu.sh, simply copies a few files into known locations (deleting any existing files from previous runs). These files are:
  • /system/bin/fsrw
  • /system/bin/bootubuntu
  • /system/bin/unionfs
  • /system/bin/mountonly

You can just delete these by hand. Otherwise, I've attached a shortened version of the setup script (now only contains the clean-up and not the file copies) that does just this. Besides those files you just need to delete your ubuntu image file. Also, I dont believe the mounts (calls to losetup and mount) persist through reboots. Someone please correct me on that if I'm wrong. But if true, you wont have anything ubuntu related running if you've done a simple reboot lately. It is probably best to reboot before running this script. FYI, the script is run from the TPT's terminal (either using a terminal app or adb).
 

Attachments

  • clean-ubuntu.zip
    555 bytes · Views: 57
  • Like
Reactions: danjac

Anapmac

Member
Dec 27, 2010
33
36
thanks for posting the changes required to get this working. I got it working with the ubuntu.img from the guide at androlinux.com

I've used the instructions there also to build an image of from ubuntu 11.10. I simply replaced the ubuntu.img with my own and all is working ok. I'm currently installing unity to see how slow it will be. or if it works at all.

Cool. Let me know how it goes. I'm curious how well we can get an ubuntu GUI to run under chroot. I really like the integration it gives. Though we're probably running on software rendering no matter what UI we use. Nvidia released linux tegra drivers for hardware acceleration:
(H)ttp://developer.nvidia.com/linux-tegra
(curse you linking!!! still too forum newb for this)
hopefully I (or anyone ;)) can get time to mess around with this.
 
Last edited:

danjac

Senior Member
Feb 4, 2012
196
121
Hey danjac,
when you exit out of the shell that bootubuntu launches, it unmounts the required loopback and folders for you. The setup script, ubuntu.sh, simply copies a few files into known locations (deleting any existing files from previous runs). These files are:
  • /system/bin/fsrw
  • /system/bin/bootubuntu
  • /system/bin/unionfs
  • /system/bin/mountonly

You can just delete these by hand. Otherwise, I've attached a shortened version of the setup script (now only contains the clean-up and not the file copies) that does just this. Besides those files you just need to delete your ubuntu image file. Also, I dont believe the mounts (calls to losetup and mount) persist through reboots. Someone please correct me on that if I'm wrong. But if true, you wont have anything ubuntu related running if you've done a simple reboot lately. It is probably best to reboot before running this script. FYI, the script is run from the TPT's terminal (either using a terminal app or adb).

Hey Anapmac,

thank you very much for the information/script.
You are right, it does not survive a reboot.
Once again, thanks for your help.
 

Anapmac

Member
Dec 27, 2010
33
36
Yea, my dreams are coming true! I hope they're not picky about using the dock though. I'd still rather just open up a local terminal and work from there (for those of you who keep line widths in code, the character width can perfectly be 80 in portrait mode using android terminal emulator :D). Should work anyway though, seems like a chroot solution with dock integration. Either way, that makes for an AWESOME thin client to access any workstations. Add that to having a mobile data plan, who needs to be in the office! Love being able to fiddle with these devices so much.
 
Last edited:

baser5nature

Member
Nov 3, 2009
15
2
I wasn't able to get unity to work, I'm really not that strong in linux though. Based on things I've read around other linux forums, it's not likely to get it to work, but luckily canonical is taking care of that for us.

I tried gnome-classic and it worked ok, I wouldn't call it unusable, tried ubuntu-2d and 3d and they just don't work, finally settled with xfce after installing xubuntu-desktop via apt-get and then messing with the xstartup in /root/.vnc to start xfce with vnc.
vncserver -geometry 1280x752 fits perfectly in the screen space available without hiding the honeycomb status bar.

Although android vnc works quite well for free. I grabbed Jump Desktop back when it was on sale, and the mouse integration feels more like a native install.

I've been using Terminal Emulator in android to edit files and things with my folio keyboard, but there are a few annoying things with that. the vol-dwn button as Ctrl only works with onscreen keyboards, so I have to take the thinkpad out of the folio keyboard for certain keystrokes in apps like vi and nano. Funny enough the enter key on my onscreen keyboards, isn't accepted when saving a file with nano. I have to return to the folio keyboard to hit enter... wierd.

Cool. Let me know how it goes. I'm curious how well we can get an ubuntu GUI to run under chroot. I really like the integration it gives. Though we're probably running on software rendering no matter what UI we use. Nvidia released linux tegra drivers for hardware acceleration:
(H)ttp://developer.nvidia.com/linux-tegra
(curse you linking!!! still too forum newb for this)
hopefully I (or anyone ;)) can get time to mess around with this.



Sent from my ThinkPad Tablet using Tapatalk
 
  • Like
Reactions: Anapmac

Anapmac

Member
Dec 27, 2010
33
36
Thanks for checking on that baser.

I've been plugging in a full keyboard whenever I wanted to code, so I'm not sure what issues come from using the folio. I did experience some funky keyboard (hardware) mappings when I was using the GUI though. I'd have to do some remappings of the keyboard keys to get it 100% working, I figure we could probably do the same for the folio. For instance, my caps lock key is normally mapped to ctrl. If the folio has one it may be a good solution (I've never really seen one and I'm assuming it doesnt have a ctrl or alt from your experiences).

As for the GUI responsiveness, I tried using a ubuntu image which was compiled with the nvidia tegra drivers (see Linux for Tegra for details, but dont try their test image). It FELT more responsive to me, but I didnt get a chance to run solid benchmarks on my different distributions though. My experience using the ubuntu GUI on the TPT is pretty slim, so I could be completely wrong on that visible speedup.

I got a hold of a nice big 32GB sd card over the weekend, so I plan to put a large ubuntu/debian distribution on it this weekend. I'll try to get some updates on the keyboard issues and tegra drivers around then.
 

Anapmac

Member
Dec 27, 2010
33
36
Check it out, there are tegra drivers in the next ubuntu arm release :D
https://launchpad.net/ubuntu/precise/armel/nvidia-tegra
It's to be released in april. I'm sure this has to do with canonical's android announcement. Sweet! I'm curious, so I may look into setting up a 12.04 distro this weekend to see if there's a noticeable speed up.

So, I definitely understand the desktop usage awesomeness. But I'm still not sure what android (mobile) gains from getting an ubuntu GUI. It seems all the added benefit comes from the command line tools, where android apps can cover any graphical needs. Thoughts?
 
Last edited:

lfwake08

Senior Member
Dec 29, 2008
127
14
North Florida
One-click?

UPDATE #2 (2-28-2012):
Also, you can skip using an image entirely. Since then I've partitioned a 32GB sdcard into 10GB fat32 + 22GB ext2 partitions and just directly copied a preinstalled/debootstrap'ed ubuntu and mounted it. This way you don't have to pre-allocate space with an image and can use both partitions for general storage (the fat32 is just for windows specific access). You could probably use space on the internal sdcard if you like. But I have a 16GB model so I went straight for an external solution.

I can extend this guide or create a one-click windows script to handle the entire setup/installation if there's interest.

A one-click script would be awesome! I know there's others who would appreciate it as well, I'm just gona take one for the n00b team and ask for it. No rush, if you have time it'd be great but either way thanks for your work!
 

tatusmaker

Member
Oct 29, 2005
18
0
tutorial

can anyone please guid me to a tutorial for this? if it's possible do with android terminal emulator.....l'm a noob ,just don't know how to do it
 

ChiefOHara

Member
Aug 8, 2008
30
1
Hey guys!

Since the ubuntu touch preview came out yesterday, I thought I'll give this thread a bump. What do you guys think about it? Can we port this to our good old TPT? I just stumbled over the Porting howto: https://wiki.ubuntu.com/Touch/Porting
I mean, thanks to Koshu, we have CM10 running, so porting should work? But I have to admit that I don't have a lot of experience with this kind of stuff
 

taeuschkoerper

New member
Feb 28, 2010
3
0
Hey guys!

Since the ubuntu touch preview came out yesterday, I thought I'll give this thread a bump. What do you guys think about it? Can we port this to our good old TPT? I just stumbled over the Porting howto:
I mean, thanks to Koshu, we have CM10 running, so porting should work? But I have to admit that I don't have a lot of experience with this kind of stuff

This would realy be very cool.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    Hey ThinkPadders,

    So I found myself needing to do some programming on the road this weekend but dont have access to a laptop. So I'm plugging in a bunch of peripherals to my TPT and hoping to work off it. (UPDATE: It worked great! Just ran out of space in my pre-allocated image, see update #2 below) Forgive me if the outcome is a bit rough or this exists elsewhere, I'm in a bit of a rush but thought I'd throw this quickly out to anyone who may find it usefull (or is nice enough to complete it).

    There's just a small modification from the Ubuntu on android instructions on AndroLinux. Sorry I cant post links as a crappy member X_x, but I think you know what to do with this:

    www.androlinux.com/android-ubuntu-development/how-to-install-ubuntu-on-android/


    Change the mount calls in each of the scripts from:
    mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
    to:
    mount -o remount,rw -t yaffs2 /dev/block/mmcblk0p3 /system

    That's about it. I've installed build essentials just with apt-get and got simple STL c++ to compile, so things seem good so far.

    Here are pics of the TPT running vnc and ssh to localhost. I attached modified scripts if you dont want to do it yourself. All credit should go to Max Lee at AndroLinux and Charan Singh.

    (And a hurrah for getting our kernel source!!)

    UPDATE #1 (2-27-2012):
    Terminal/ssh usages are great, but experiences with the stock ubuntu GUI are a little slow (probably due to the lack of tegra drivers on tested distributions). You can improve this GREATLY by using a lighter weight windows manager (lxde, xfce, unity 2d, etc).

    UPDATE #2 (2-28-2012):
    Also, you can skip using an image entirely. Since then I've partitioned a 32GB sdcard into 10GB fat32 + 22GB ext2 partitions and just directly copied a preinstalled/debootstrap'ed ubuntu and mounted it. This way you don't have to pre-allocate space with an image and can use both partitions for general storage (the fat32 is just for windows specific access). You could probably use space on the internal sdcard if you like. But I have a 16GB model so I went straight for an external solution.

    I can extend this guide or create a one-click windows script to handle the entire setup/installation if there's interest.
    1
    Cool stuff anapmac.
    I too have an ubuntu chroot on my thinkpad (actually just copied the loop file from my droid x and didn't even have to change any settings)
    Just a tip: I highly recommend swapping out the default window manager for lxde.
    lxde is much more lightwight and will run a lot faster.
    Also, you may want to try pointing apt at the debian repositories, debian seems to have more complete ARM repositories than ubuntu does.
    1
    Cool stuff anapmac.
    I too have an ubuntu chroot on my thinkpad (actually just copied the loop file from my droid x and didn't even have to change any settings)
    Just a tip: I highly recommend swapping out the default window manager for lxde.
    lxde is much more lightwight and will run a lot faster.
    Also, you may want to try pointing apt at the debian repositories, debian seems to have more complete ARM repositories than ubuntu does.

    Thanks for the tip. I did find loading firefox somewhat slow when I took the screenshots. This past weekend though I was only accessing the distribution through a terminal emulator (just ran the bootubuntu script to setup the chroot). After working with it, I'm very satisfied with this setup :) I'm planning to buy an external SD to use host a large ubuntu image (or anything else that's ARM compatible?). Maybe I'll look into the GUI if I get a chance.

    There's also a native ubuntu setup on some android devices. That would be interesting to see how well the GUI performs when android isn't running next to it. Luckily for me, the terminal is perfect since I use vim :D

    Hey,
    could anyone help me...i managed to do all and it finally worked.
    but i don't think it is quite useable, so what d0 I have to do to make all steps undone?

    thanks for your help.
    dan

    Hey danjac,
    when you exit out of the shell that bootubuntu launches, it unmounts the required loopback and folders for you. The setup script, ubuntu.sh, simply copies a few files into known locations (deleting any existing files from previous runs). These files are:
    • /system/bin/fsrw
    • /system/bin/bootubuntu
    • /system/bin/unionfs
    • /system/bin/mountonly

    You can just delete these by hand. Otherwise, I've attached a shortened version of the setup script (now only contains the clean-up and not the file copies) that does just this. Besides those files you just need to delete your ubuntu image file. Also, I dont believe the mounts (calls to losetup and mount) persist through reboots. Someone please correct me on that if I'm wrong. But if true, you wont have anything ubuntu related running if you've done a simple reboot lately. It is probably best to reboot before running this script. FYI, the script is run from the TPT's terminal (either using a terminal app or adb).
    1
    I wasn't able to get unity to work, I'm really not that strong in linux though. Based on things I've read around other linux forums, it's not likely to get it to work, but luckily canonical is taking care of that for us.

    I tried gnome-classic and it worked ok, I wouldn't call it unusable, tried ubuntu-2d and 3d and they just don't work, finally settled with xfce after installing xubuntu-desktop via apt-get and then messing with the xstartup in /root/.vnc to start xfce with vnc.
    vncserver -geometry 1280x752 fits perfectly in the screen space available without hiding the honeycomb status bar.

    Although android vnc works quite well for free. I grabbed Jump Desktop back when it was on sale, and the mouse integration feels more like a native install.

    I've been using Terminal Emulator in android to edit files and things with my folio keyboard, but there are a few annoying things with that. the vol-dwn button as Ctrl only works with onscreen keyboards, so I have to take the thinkpad out of the folio keyboard for certain keystrokes in apps like vi and nano. Funny enough the enter key on my onscreen keyboards, isn't accepted when saving a file with nano. I have to return to the folio keyboard to hit enter... wierd.

    Cool. Let me know how it goes. I'm curious how well we can get an ubuntu GUI to run under chroot. I really like the integration it gives. Though we're probably running on software rendering no matter what UI we use. Nvidia released linux tegra drivers for hardware acceleration:
    (H)ttp://developer.nvidia.com/linux-tegra
    (curse you linking!!! still too forum newb for this)
    hopefully I (or anyone ;)) can get time to mess around with this.



    Sent from my ThinkPad Tablet using Tapatalk