Ubuntu Installer on Play Store

Search This thread

RubenRybnik

Senior Member
Jan 6, 2012
573
144
Cary, NC
This is running pretty great so far, I'm impressed... That being said have several questions, which I will probably have to post in another more general topic, but thought I'd post here in case anyone has tried or has experience with this.

1.) Was wondering if anyone has gotten a "one click launch" working, I know there is a boot widget, which I use, and I've looked at the shell script, but I'm not sure what else would have to be edited or where the vnc files are for doing the following:
a.) Check to see if a running instance of Ubuntu is already up, if not do steps B and C, if it's already running then do step D
b.) Run the shell script like it does normally currently
c.) Choose some default settings for screen size and window manager ( ie. 1280 x 800 and Gnome ) automatically so you don't have to do this each time
d.) ( Ideally although not sure if it can be done ) launch the VNC client of your choice after terminal is done launching ubuntu

2.) Was wondering where files for the Ubuntu OS are kept if you have the img and shell script files in /sdcard/ubuntu. Would like to add some aliases, and customizations to the OS
3.) Can we switch to the bash shell by default Vs. sh? Or will that break anything? Would we just put that in the profile of the linux user? or in /etc/profiles?
4.) I know Ubuntu is being run as the root user, this worries me quite a bit, and although I don't think there is a work around, is there anything that can be done about this? What are some steps to secure the system if any are available? Changing the VNC Password? SSHD is started up correct? Can / Should this password be changed as well.

Anyways, like I said, might be best for a topic just on this app in Android General, but thought I'd see if it gets traction here first.

Oh ... and a "I know this probably wont work because we are 'remoted' in( through loopback ofcoarse )" but anyone try to get compiz working, lol


EDIT: After some pawing around on the mounted FS it looks like my above questions for 1 - A,B, and C can be accomplished by editing the init.sh shell script in the root home directory. You can override the prompting for geometry and shell if you wish here. I'll have to do some investigation on how the widget calls this init script, would be nice to have two small widgets one that prompts and one that just assumes the tablets resolution as the default for quick launch.

EDIT: As for 1 - D and question 2 & 3 not sure on those yet, still waiting for suggestions and looking around

EDIT 2: Ok answered question 2 ... Looks like everything gets mounted by the boot script ( instructed to put in /sdcard/ubuntu/ ) mounts everything to /data/local/mnt and root home dir is /data/local/mnt/root. Also the boot script chroots to the roots init.sh so that's how that gets launched. Now I'm wondering what happens when I flash a new ROM but keep the sdcard the same, not quite sure how the /data/local/mnt/root and other dirs( other that the remapped system dirs ) are getting mapped to that new mount location.

This is fun, lots of learning...

Sent from my Transformer Prime TF201 using Tapatalk 2
 
Last edited:

RubenRybnik

Senior Member
Jan 6, 2012
573
144
Cary, NC
Ah, I see. But what use has ubuntu without the GUI? I'm obviously new to this, but I assumed that you could use the ubuntu OS offline. Like open and use programs like open office. How would you be using ubuntu if you were at a place without internet?

I think you're a little confused here. When you run the Ubuntu installer( The one click boot with the app ) it basically mounts whatever storage and img it needs then starts a remoted desktop ( VNC in linux ) session. Then you get a VNC Client off the app store, and you connect to that session to the machine itself. So basically you connect to 127.0.0.1 which is 'localhost' meaning you don't need networking in the terms of "internet access". That being said, if you do have internet access then you can use browsers and such within Ubuntu from withing the remote session( Inside the VNC client )

I'd suggest maybe doing some googling on Ubuntu and VNC and remote sessions to get an idea. It's not too technical, but it'll help you understand what's going on a little better.
 
  • Like
Reactions: kidio007

hairdewx

Senior Member
Feb 28, 2009
675
276
Is the performance through VNC good enough to make it a daily use option?

Or is it more or less just a "novelty" in terms of performance?
 

RubenRybnik

Senior Member
Jan 6, 2012
573
144
Cary, NC
Is the performance through VNC good enough to make it a daily use option?

Or is it more or less just a "novelty" in terms of performance?

Yes, I think it's plenty fast enough for daily use. Now I wouldn't go and replace a whole eclipse development environment or watch movies and probably not music either on this. But it would be fine for a LAMP stack, light image editing, website coding, and obviously a great command line. Try it out, you really only have $1.50 to loose, and I think he has a free version out as well.
 

barryflanagan

Senior Member
Aug 17, 2009
260
78
Dublin
barry.flanagan.ie
Great info :) I have the 10.10 full image up and running and Firefox does seem to be working fine for me "out of the box". Think I'm going to try the 12 image and Xfce next.

Anyone have any optimization tips and tricks to get this running as fast as possible? I'm trying the Jump VNC client, seems pretty nice, just need to get some kind of gesture to hide the tablets nav bar as it covers the screen.

I find with jump desktop you need to set the vnc screen size to 1270x745 and then it fits perfectly. Most other vnc clients are happy with 1280x750
 

nonpaq

Senior Member
Jun 8, 2007
534
65
NY
Edit: Actually, in this 12.04 image doing "apt-get install xubuntu-desktop" does not appear to be as bad. A previous image wanted to download 750Mb of stuff!

Ok, new download of 12.04 loaded.

It took me a moment to realize that I just needed to enter the commands (like "apt-get install xubuntu-desktop" ) in the actual terminal running Ubuntu on android , and I did not need a terminal within the VNC (couldnt find one anyway). The "xubuntu-desktop" package downloads 250 mb.
 

RubenRybnik

Senior Member
Jan 6, 2012
573
144
Cary, NC
I find with jump desktop you need to set the vnc screen size to 1270x745 and then it fits perfectly. Most other vnc clients are happy with 1280x750

1280 x 800 works ok for me with jump desktop, but I use GestureControl to hide the nav bar which is really nice, gives you a true full screen experience.

Does anyone know how to backup the install so if you reflash a ROM or factory reset or anything to that matter it wont loose what pacages you've installed and your personalized settings( like aliases etc... )? Can we just switch the mount points to be /sdcard/mnts instead of /app/local/mnts? Where do those custom mounted files live ( like the root home directory ) after you stop the ubuntu instance from running( exiting the terminal emulator or rebooting your machine for instance? )

Again, going to move this thread to android q&a if we can't find answers here, I'll post a link to that thread here if I end up having to do that.
 

barryflanagan

Senior Member
Aug 17, 2009
260
78
Dublin
barry.flanagan.ie
1280 x 800 works ok for me with jump desktop, but I use GestureControl to hide the nav bar which is really nice, gives you a true full screen experience.

Does anyone know how to backup the install so if you reflash a ROM or factory reset or anything to that matter it wont loose what pacages you've installed and your personalized settings( like aliases etc... )? Can we just switch the mount points to be /sdcard/mnts instead of /app/local/mnts? Where do those custom mounted files live ( like the root home directory ) after you stop the ubuntu instance from running( exiting the terminal emulator or rebooting your machine for instance? )

Again, going to move this thread to android q&a if we can't find answers here, I'll post a link to that thread here if I end up having to do that.

Must try out gesture control.

The Ubuntu install is self-contained in ubuntu.img, so you can just copy that file to a USB suck or where ever.

If you repartition your microsd card and make an ext3 partition on it, you can also extract the contents of the img to that ext3 partition and then change the ubuntu.ah script to mount that instead of the .img file. Then you have a nice portable install.

I haven't run any speed tests to see if one if faster than the other
 

barryflanagan

Senior Member
Aug 17, 2009
260
78
Dublin
barry.flanagan.ie
Hey Barryflanagan, I'm playing with Zac's images and I am wondering if you got ubuntu to read any external storage media plugged into the dock : like sdcard or usb external drive. I don't know if it's because of the dock proper, or ubuntu, or chroot, but I got the prime on ubuntu to read microsd on the prime proper but nothing routing through the dock..
HI

Yes, this can be done. you need to edit the ubuntu.sh file so that it will try to mount /Removable/USBdisk1, and then unmount it again when you exit.

Two things need to be done:

1. Modify the ubuntu.sh script to mount the USB drive
2. Create the actual mount directory inside the ubuntu chroot.

I will attach a modified ubuntu.sh (uploaded as ubuntu.sh.txt, needs to be renamed), but here is what changes were made:

Section which checks what removable devices are present, then mounts it within the ubuntu chroot:
Code:
##########################################
#Checks if you have a external sdcard    #
#and mounts it if you do                 #
##########################################
if [ -d /sdcard/external_sd ]; then
	busybox mount -o bind /sdcard/external_sd  $mnt/external_sd
fi
if [ -d /Removable/MicroSD ]; then
	busybox mount -o bind /Removable/MicroSD  $mnt/external_sd
fi

if [ -d /Removable/USBdisk1 ] ; then
	busybox mount -o bind /Removable/USBdisk1 $mnt/USBdisk1
fi

...in the above, I added the reference to /Removable/USBdisk1

Then ,further down the script, we need to unmount this disk before exiting:

Code:
echo "Shutting down Ubuntu ARM"
for pid in `lsof | grep $mnt | sed -e's/  / /g' | cut -d' ' -f2`; do kill -9 $pid >/dev/null 2>&1; done
sleep 5
umount $mnt/sdcard
umount $mnt/external_sd
umount $mnt/USBdisk1

..again, you can see I added the "umount $mnt/USBdisk1".

One more thing you need to do, from WITHIN the ubuntu chroot, is to actually create the /USBdisk1 directory so that the mount will succeed. To do this, first load up your ubuntu chroot using:

sh ubuntu.sh

...and once this has loaded, within the same terminal type:

mkdir /USBdisk1
exit

...you are now back in Android. The next time you load up ubuntu, you should see your external USB stick or HD!

Note however, that the USB disk must be inserted before starting ubuntu. You can't hot plug it.

By the way, have anyone tried to get Wine working on the chroot ubuntu? Maybe with kernel overclocked to 1.8 it might work?

Wine will not work, because windows requires x86 processor, and will not run on Arm. Wine is not capable of emulating x86 on top of Arm. Whether the upcoming Windows RT (Arm version) can be made to run on non blessed hardware is an open question/
 

Attachments

  • ubuntu.sh.txt
    3.1 KB · Views: 13
Last edited:

barryflanagan

Senior Member
Aug 17, 2009
260
78
Dublin
barry.flanagan.ie
EDIT 2: Ok answered question 2 ... Looks like everything gets mounted by the boot script ( instructed to put in /sdcard/ubuntu/ ) mounts everything to /data/local/mnt and root home dir is /data/local/mnt/root. Also the boot script chroots to the roots init.sh so that's how that gets launched. Now I'm wondering what happens when I flash a new ROM but keep the sdcard the same, not quite sure how the /data/local/mnt/root and other dirs( other that the remapped system dirs ) are getting mapped to that new mount location.


The ubuntu.img file is basically an entire filesystem, much like is used in say VMWare or VirtualBox. So when this is mounted on /data/local/mnt (or wherever) it acts just like a normal filesystem and any changes made are within it. If you want to see exactly what is in the ubuntu.img (maybe to copy it onto an ext3 formatted MicroSD card partition), you can just do the following i na terminal as root:

Code:
# Create the loopback device (probably not needed if you have run ubuntu.sh before)
busybox mknod /dev/block/loop255 b 7 255

# Set up the loop device, pointing it to your ubuntu.img file (change the path if necessary)
busybox losetup /dev/block/loop255 /sdcard/ubuntu/ubuntu.img

# Mount the loopback device you just set up
busybox mount -t ext2 /dev/block/loop255 /data/local/mnt/
Now, if you "cd /data/local/mnt/" and do an "ls" you will see that there is a full Linux filesystem under there. Once you are finished investigating, just do

Code:
umount /data/local/mnt/
losetup -d /dev/block/loop25

This is fun, lots of learning...

Best way to discover Linux, having fun learning. I've been doing that since 1993 and am still having fun learning :)
 

Parastie

Senior Member
Apr 27, 2010
825
95
Malta
Has anyone tried using the HDMI out to a larger screen? I suspect it will work perfectly fine, but is it a "more useful" environment?
 

justPorter

Senior Member
Sep 20, 2011
83
16
ubuntu 10.10 works great, but i cant install chromium or java browser plugin. i get 404 errors.

When i do the full ubuntu 12 the menu is all jacked and firefox crashes. how are you guys getting it to work?

thanks
 

nonpaq

Senior Member
Jun 8, 2007
534
65
NY
When i do the full ubuntu 12 the menu is all jacked and firefox crashes. how are you guys getting it to work?

Yeah, the Unity desktop does not work properly in the 12.04 full image. I went with barryflanagan's idea of installing xfce as my desktop, basically creating an xubuntu 12.04 image.

The key is installing the xunbuntu desktop package from the terminal that opens in android, and editing the xstartup file as barryflanagan mentioned, then restarting the chroot Ubuntu. Xfce works very well as a desktop.

By the way, does closing the VNC app, then typing EXIT several times in the terminal until it closes, the proper way to leave Ubuntu? Does this clear out all memory, or do I need to reboot the tablet?
 

RubenRybnik

Senior Member
Jan 6, 2012
573
144
Cary, NC
Wow ... Thank you all for the great information, I'm not new to Linux by a long shot, but am new to the loopback, img mount and chroot methods described here. This is great. So I understand the img is a full filesystem, do changes persist back to the img when unmounted? My assumption is, when I exit out of ubuntu all the img mounted filesystem changes get persisted to that img file. If so, then so easy to back up. This also opens up the question, theoritically we should be able to use other ARM based distros correct? Was thinking Puppy Linux may be a faster running alternative with a much smaller foot print than ubuntu.
 

barryflanagan

Senior Member
Aug 17, 2009
260
78
Dublin
barry.flanagan.ie
Wow ... Thank you all for the great information, I'm not new to Linux by a long shot, but am new to the loopback, img mount and chroot methods described here. This is great. So I understand the img is a full filesystem, do changes persist back to the img when unmounted? My assumption is, when I exit out of ubuntu all the img mounted filesystem changes get persisted to that img file. If so, then so easy to back up. This also opens up the question, theoritically we should be able to use other ARM based distros correct? Was thinking Puppy Linux may be a faster running alternative with a much smaller foot print than ubuntu.

Yes, the img file is persistent. You could save it to a MicroSD and move it from phone to phone if you wanted and it would be exactly the same on all of them.

You should be able to use any arm based distro, yes. Not really sure how much faster Puppy for example would be. If you do a 'ps ax' in a terminal inside of the ubuntu image there is not actually all that much extra running - mostly the gui stuff. I'm still going through this 12.04 install and removing useless packages like pulseaudio (no sound via vnc anyway) and the screensavers to tighten things up, but its already running fast enough to be actually useful.

I have just got it running so that the session is no longer root, but running as my own user which is great. I'll write up how I have done it soon once I am happy with it, but that makes it much more useful to me and a fair bit more secure.
 

RubenRybnik

Senior Member
Jan 6, 2012
573
144
Cary, NC
Yes, the img file is persistent. You could save it to a MicroSD and move it from phone to phone if you wanted and it would be exactly the same on all of them.

You should be able to use any arm based distro, yes. Not really sure how much faster Puppy for example would be. If you do a 'ps ax' in a terminal inside of the ubuntu image there is not actually all that much extra running - mostly the gui stuff. I'm still going through this 12.04 install and removing useless packages like pulseaudio (no sound via vnc anyway) and the screensavers to tighten things up, but its already running fast enough to be actually useful.

I have just got it running so that the session is no longer root, but running as my own user which is great. I'll write up how I have done it soon once I am happy with it, but that makes it much more useful to me and a fair bit more secure.

Very cool! Maybe when you post instructions you could make an "Optimized Image" to post up so people can download a smaller img file without the extra packages, and would have any extra mods you add?
 

barryflanagan

Senior Member
Aug 17, 2009
260
78
Dublin
barry.flanagan.ie
Very cool! Maybe when you post instructions you could make an "Optimized Image" to post up so people can download a smaller img file without the extra packages, and would have any extra mods you add?

Better to feed back to zacthespack and let him integrate or not in his Installer apps. Otherwise I would feel obliged to support my image, and there goes the fun we were talking about :)
 

overhauling

Senior Member
Aug 15, 2011
563
735
I've used VNC Viewer with this and it has been working greatly. GNOME and LXDE work perfectly fine, LXDE faster than GNOME of course.

This seems to work better on AOKP since there's more free memory, but it works either way.

I've had problems installing a couple of things (Chromium + Eclipse IDE) though because of the architecture and the root permissions - you're always logged in as root.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    will installing ubuntu thru this app break future ota updates? I do have root, but i only use it for a working ipsec vpn right now


    No it shouldn't have any affect. It does not touch anything outside of /data/local (or wherever you install the ubuntu.img file - could be your sdcard) - no system files are changed.

    ---------- Post added at 04:24 PM ---------- Previous post was at 04:21 PM ----------

    Anyone having problems unzipping the beta Ubuntu 12.04 Full V1 download to get the image file? I've tried various unzip tools, and multiple download attempts, and it always comes up corrupt. The 12.04 small works fairly well.

    I think there was an issue with the Full V1 file. The dev re-uploaded today so you might try it again. However, the default Unity interface on Full does not seem to work on the Prime for whatever reason (Tegra 3 differences it has been said) so it might not be worth the effort until that is fixed. Firefox also does not work (I have never got Firefox of Chrome to work on any of these builds)

    The older Ubuntu version (10.10 was it?) works fine, except Firefox just crashes, and Midori is the only currently working browser

    ---------- Post added at 04:26 PM ---------- Previous post was at 04:24 PM ----------

    Do you have to unlock prime to use this? I have root, but it says something about needing kernel or something on the app.

    Your kernel needs to support the loop device which is the way that the ubuntu.img file gets "mounted" on the system. I dont recall if the stock kernel supports this but I would be surprised if it doesn't
    1
    Do you have to unlock prime to use this? I have root, but it says something about needing kernel or something on the app.
    1
    Stock kernel apparently has the loop device, as I have been able to run Ubuntu on stock (rooted of course).

    Thanks for info on new upload of 12.04 full. Didnt you say you installed Xfce and 12.04 worked well?

    Yes, Xfce I find works well. Just did not know how much effort you might be willing to put into it :)

    Bit of advice - don't use "apt-get install xubuntu-desktop" to change to Xfce. That wants to install a ton of stuff that is not needed. Just try installing the the meta package "xfce4" and then add the other bits you want. I then removed the Unity desktop and it booted straight in to Xfce.

    Edit: Actually, in this 12.04 image doing "apt-get install xubuntu-desktop" does not appear to be as bad. A previous image wanted to download 750Mb of stuff!

    Edit2: Oh, and to get xfce loading instead of Unity, you need to edit /root/.vnx/xstartup and change the last line:

    /etc/X11/Xsession

    to be

    startxfce4

    ..then restart the linux chroot by typing exit
    1
    Ah, I see. But what use has ubuntu without the GUI? I'm obviously new to this, but I assumed that you could use the ubuntu OS offline. Like open and use programs like open office. How would you be using ubuntu if you were at a place without internet?

    I think you're a little confused here. When you run the Ubuntu installer( The one click boot with the app ) it basically mounts whatever storage and img it needs then starts a remoted desktop ( VNC in linux ) session. Then you get a VNC Client off the app store, and you connect to that session to the machine itself. So basically you connect to 127.0.0.1 which is 'localhost' meaning you don't need networking in the terms of "internet access". That being said, if you do have internet access then you can use browsers and such within Ubuntu from withing the remote session( Inside the VNC client )

    I'd suggest maybe doing some googling on Ubuntu and VNC and remote sessions to get an idea. It's not too technical, but it'll help you understand what's going on a little better.