Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,740,412 Members 45,479 Now Online
XDA Developers Android and Mobile Development Forum

Ubuntu Installer on Play Store

Tip us?
 
RubenRybnik
Old
(Last edited by RubenRybnik; 24th April 2012 at 08:26 PM.)
#21  
RubenRybnik's Avatar
Senior Member - OP
Thanks Meter 147
Posts: 543
Join Date: Jan 2012
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

AT&T Samsung Galaxy III
Current ROM: CS Rom

XDA Gallery - Chrome Extension
 
RubenRybnik
Old
#22  
RubenRybnik's Avatar
Senior Member - OP
Thanks Meter 147
Posts: 543
Join Date: Jan 2012
Quote:
Originally Posted by kidio007 View Post
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.

AT&T Samsung Galaxy III
Current ROM: CS Rom

XDA Gallery - Chrome Extension
The Following User Says Thank You to RubenRybnik For This Useful Post: [ Click to Expand ]
 
hairdewx
Old
#23  
Senior Member
Thanks Meter 265
Posts: 651
Join Date: Feb 2009
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?
See Xperia Play Games on my YouTube channel

http://www.youtube.com/user/hairdewx
 
RubenRybnik
Old
#24  
RubenRybnik's Avatar
Senior Member - OP
Thanks Meter 147
Posts: 543
Join Date: Jan 2012
Quote:
Originally Posted by hairdewx View Post
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.

AT&T Samsung Galaxy III
Current ROM: CS Rom

XDA Gallery - Chrome Extension
 
barryflanagan
Old
#25  
Senior Member
Thanks Meter 78
Posts: 258
Join Date: Aug 2009
Location: Dublin
Quote:
Originally Posted by RubenRybnik View Post
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
Old
#26  
Senior Member
Thanks Meter 61
Posts: 523
Join Date: Jun 2007
Location: NY
Quote:
Originally Posted by barryflanagan View Post
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.
Tmobile USA - HTC AMAZE (stock)
SD Card - 32 GB class 10

Asus Transformer T201 w/ Dock.
Unlocked/Custom ROM
ROM: Flavor of the week.
 
RubenRybnik
Old
#27  
RubenRybnik's Avatar
Senior Member - OP
Thanks Meter 147
Posts: 543
Join Date: Jan 2012
Quote:
Originally Posted by barryflanagan View Post
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.

AT&T Samsung Galaxy III
Current ROM: CS Rom

XDA Gallery - Chrome Extension
 
barryflanagan
Old
#28  
Senior Member
Thanks Meter 78
Posts: 258
Join Date: Aug 2009
Location: Dublin
Quote:
Originally Posted by RubenRybnik View Post
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
Old
(Last edited by barryflanagan; 25th April 2012 at 10:04 AM.) Reason: Forgot to attach file
#29  
Senior Member
Thanks Meter 78
Posts: 258
Join Date: Aug 2009
Location: Dublin
Quote:
Originally Posted by Mangala_Dharma View Post
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:
Select 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:
Select 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.

Quote:
Originally Posted by Mangala_Dharma View Post
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/
Attached Files
File Type: txt ubuntu.sh.txt - [Click for QR Code] (3.1 KB, 13 views)
 
barryflanagan
Old
#30  
Senior Member
Thanks Meter 78
Posts: 258
Join Date: Aug 2009
Location: Dublin
Quote:
Originally Posted by RubenRybnik View Post
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:
Select 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:
Select Code
umount /data/local/mnt/
losetup -d /dev/block/loop25
Quote:
Originally Posted by RubenRybnik View Post
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes