[Guide] How to Install Ubuntu On Galaxy Nexus

Search This thread

fire & ice

Member
May 18, 2012
20
39
Los Angeles
First before I start. I just wanted to say that this is not my work. This is simply a guide
to assist other galaxy nexus users who would like to run ubuntu but don't have an understanding
on what they should be doing precisely. The original thread called "linux on android" will be
posted at the bottom of the thread for those wanting to thank the original author. I couldn't
find a guide specific to our device hence the creation of this one. If this has not been posted
in the correct area, moderators please feel free to move it to the correct subforum.



Here is the part where I say, I'm not responsible for anything that happens to your phone. You do
this at your own discretion. This is something to tinker with for anyone who likes to mess with
their phone and show off a little bit.
Also be sure to follow my instructions exactly how I write them to avoid any unnecessary confusion.



As a base, I am using AOKP B39 and franco kernel Nightly 192.
If you have terminal emulator or androidVNC currently installed please clear app data and uninstall.
This of course is to be extra careful.

First things first: You want to have root and a kernel installed that has loop device support.
Like I've mentioned already, I am using Franco Nightly 192 and it is working perfectly fine
therefore I see no reason why it should not work for you. Best results in my opinion will come from using my
ROM base and kernel.

Next here are links to the following files you need. These files are quite big and there are 3
different kinds. The difference between each kind is explained on the page. Remember to keep in
mind how much space you must have on your phone before downloading a file. You don't want to waste
your time downloading the full image if you don't have the space to install it.

Here is the link to the full/small/core images. Download the version of ubuntu you wish to run on
your phone and make sure it is the latest which as of today is dated June 8th 2012.

Remember that the "core" version is for experienced ubuntu users only as it has no GUI. only
command line.

http://sourceforge.net/projects/linuxonandroid/files/Ubuntu/12.04/


Once you have downloaded the image you wish to run. You may extract the img file from the zip file
using 7zip or winrar. Both work perfectly fine. You will notice that once you extract the file
there is a ubuntu.img and an ubuntu.img.md5
The md5 file is a checksum file, if you wish to validate the integrity of the file you just downloaded
go ahead and use a program such as cygwin to compare the md5 hashes.

Moving on, once you have extracted the ubuntu.img file. Move the file onto your galaxy nexus
internal memory to the root of your sdcard inside a folder named "ubuntu".
If you have done this correctly your directory should be as follows. /sdcard/ubuntu

Next you want to download the bootscript which I will attach at the bottom of this thread. Extract the ubuntu.sh file from the zip i posted below.
Once you have downloaded the ubuntu.sh file I have attached. You need to place that file in
the same /sdcard/ubuntu directory where your unbuntu.img file is located.


To confirm you are on the right track you need to install terminal emulator from the
google play store as well as install androidVNC. Once you have both apps freshly
installed you can go ahead and open up terminal emulator, grant it superuser permission
and then type the following:

su

(followed by the enter key) you should see the $ turn into a # symbol.

Next you type:

cd /sdcard/ubuntu

(again followed by the enter key) now your directory should be changed to the /sdcard/ubuntu folder

Next command:

ls

(once more followed by the enter key) This should list all files currently in the folder if you
see ubuntu.img as well as ubuntu.sh listed then you are right where you need to be.

Once you have confirmed that both files are listed we can go ahead and start the process of starting
up ubuntu. In terminal emulator type the following:

sh ubuntu.sh (all commands are followed by enter key by the way)

Terminal emulator should start the launch sequence then ask you if you want to start VNC server.

Type "y" then hit enter. Type "y" without quotations of course.
Next it will ask you if you want to start the ssh server. Again type "y".

Screenshot_2012-06-24-16-21-44.png


Next it will ask you for the screen size you wish to use. You can choose whatever resolution you
wish to use. I like to use the nexus native resolution which is 1280x720.
Therefore I type "1280x720" and press enter.


Screenshot_2012-06-24-16-22-24.png


Next it will ask you if you would like to save your settings type "y".
Screenshot_2012-06-24-16-22-43.png


Finally your terminal should say "[email protected]:/#"

Screenshot_2012-06-24-16-23-19.png


Now you are ready to start up androidvnc. Press the home button and DO NOT EXIT terminal emulator.

Once you open up android VNC enter the following information:

nickname: ubuntu
password: ubuntu
address: localhost
port: 5900


Check off the keep password option then scroll down to the botton of that page where it says
Color Format and change it to 24-bit color (4bpp)
Screenshot_2012-06-24-16-23-54.png


Then press connect and voila whatever ubuntu version you downloaded should start up. The mouse should basically be used as if the screen was a track pad.
Screenshot_2012-06-24-16-24-19.png


Exiting ubuntu is also easy. Just hit the settings button and a prompt should pop up with an option that says disconnect. Simpy disconnect then switch over to terminal emulator which should still be running and type:

exit

Wait around 30 seconds and it should say It shut off correctly. Type exit once more and It will close the directory you were in. One more exit and terminal emulator will close itself.

The next time you want to load up ubuntu just open up terminal emulator follow the first 2 steps and once you load up ubuntu.sh your config file should be loaded and you will be able to skip all the tedious settings. Then go over to androidVNC and your settings should also be saved. All you do is hit connect and you should be good to go.

Good luck and hope you all enjoy it. I'll post pictures of the steps that I think will be helpful. Also if this helped you out. Hit the thanks button please.

Also don't forget to checkout the original thread for further information and details.

http://forum.xda-developers.com/showthread.php?t=1585009
 

Attachments

  • ubuntu.rar
    1.8 KB · Views: 1,430

Afwasmassi

Senior Member
Dec 4, 2011
267
46
Amsterdam
This looks awesome, downloading atm and will test on Rascream/Trinity

Edit: Seems that trinity kernel doesnt support loop so it wont work.
 
Last edited:

sert00

Senior Member
May 28, 2011
1,091
496
cesena,IT
in april i buyed the paid version of this app (ubuntu,because months ago backtrack and debian wasn't released i think)but never ever tried due to many probems\errors on vnc.thank you very much for this guide,now i'm downloading the 12.04 full and retry with yours tutorial.appreciated man!:good:
 

mastergrifis

Senior Member
Mar 29, 2011
61
0

Attachments

  • Screenshot_2012-08-13-20-51-35.jpg
    Screenshot_2012-08-13-20-51-35.jpg
    25 KB · Views: 2,568

Echo5ive

Member
Aug 21, 2012
18
2
South Bend, IN
Thanks for the guide. I did exactly what you said, but I got this error:

http://dl.xda-developers.com/attach.../5/9/1/1/3/Screenshot_2012-08-13-20-51-35.jpg

That's probably connected to the kernel's loop device. I tried first with the one included in the rom (liquid beta1 JB), then I flashed the last release of Franco (r241) but got the same error. Am I missing something?
Thanks for your help :)

I got the same thing running BAMF Paradigm and Franco's 241 nightly. It appears to be a problem with the busy box. I got the same message and researched that busybox distribution (is it a distribution?) and came across this:
https://play.google.com/store/apps/...ndroid&feature=nav_result#?t=W251bGwsMSwyLDNd

It booted to the shell and asked if I want to start VNC/SSH, I am able to connect to VNC/SSH from my phone (duh) and my laptop but the VNC client comes up and displays an error message:
"Xsession: unable to start X session --- no "/home/ubuntu/.xsession" file, no "/home/ubuntu/.Xsession" file, no session managers, no window managers, and no terminal emulators found; aborting."

I will get some screen shots up tomorrow. I'm using the v4 image from the download site. It might just be the image. I did an MD5 check and everything matched up.

I know this isn't your project, does anybody have any ideas? I tried installing ubuntu-desktop from command line but there was not enough room for the install...


EDIT: I feel like an idiot now... The OP clearly states that the core version has no GUI. That might be why I couldn't get to a GUI... :p I guess I could put the LAMP packages on it and use webmin... Or I'll just get the small package.
 
Last edited:

Maximilian Mary

Senior Member
Jan 16, 2011
885
283
Wisconsin
Thanks for the guide. I did exactly what you said, but I got this error:

http://dl.xda-developers.com/attach.../5/9/1/1/3/Screenshot_2012-08-13-20-51-35.jpg

That's probably connected to the kernel's loop device. I tried first with the one included in the rom (liquid beta1 JB), then I flashed the last release of Franco (r241) but got the same error. Am I missing something?
Thanks for your help :)

The error is from the script trying to use the busybox that's included with the app. In order for it to work without the app installed, it needs to be changed to point to /system/xbin/busybox instead of /data/data/com.whatever/busybox. That is assuming that you have busybox installed (and that your busybox takes the same arguments for the loop command as the busybox the app provides).
 

fizkid

New member
Jun 1, 2008
4
0
I'm using the same Rom build as you. How do you move the files into root of /? I am using Astro browser and it wont let me copy or move anything into that directory....I cannot see any way to do it through Windows either. Any help?

I assume I am getting my errors because the file is not located in that directory.

ttp://pic90.picturetrail.com/VOL2353/13103118/24172961/403735977.jpg[/url]
ttp://pic90.picturetrail.com/VOL2353/13103118/24172961/403735976.jpg[/url]
 

Echo5ive

Member
Aug 21, 2012
18
2
South Bend, IN
Looks like your Ubuntu image is corrupt. Did you download it on Wi-Fi?

The files should not be in the root of your filesystem either. Everything should be at /sdcard/ubuntu and it's case sensitive. If you know the image is good, just delete the md5 file and it won't do the check.


Sent from my Galaxy Nexus using xda app-developers app
 

fizkid

New member
Jun 1, 2008
4
0
Looks like your Ubuntu image is corrupt. Did you download it on Wi-Fi?

The files should not be in the root of your filesystem either. Everything should be at /sdcard/ubuntu and it's case sensitive. If you know the image is good, just delete the md5 file and it won't do the check.


Sent from my Galaxy Nexus using xda app-developers app

I can only make my file path /storage/sdcard0/Ubuntu. I see no way to get it to plain old sdcard/Ubuntu

I downloaded it via wifi multiple times and same error. Tried small and large images too with same error.

I deleted the md5. Fails now during checking loop device...MISSING. Unable to create loop device.

I tried the kernal that came with the AKOP 39 rom as well as franco.Kernel-milestone2.zip, I cant find the franco 192 kernal that you are using anywhere

I did this EAILY on the first try with my Triumph many months ago....no idea why I'm having so many problems with my GNex...
 

Echo5ive

Member
Aug 21, 2012
18
2
South Bend, IN
Try clearing the app data, uninstalling, and then reinstalling the terminal emulator you are using. (And a reboot wouldn't hurt...) I haven't tried it on AOKP but it should handle it fine.

The Franco kernel I use is the most current release at the time of this writing, #241.

Sent from my Galaxy Nexus using xda app-developers app
 
Last edited:

fizkid

New member
Jun 1, 2008
4
0
Try clearing the app data, uninstalling, and then reinstalling the terminal emulator you are using. (And a reboot wouldn't hurt...) I haven't tried it on AOKP but it should handle it fine.

The Franco kernel I use is the most current release at the time of this writing, #241.

Sent from my Galaxy Nexus using xda app-developers app

Still a no go with #241 Kernal.

Checking loop device... MISSING
Creating loop device...ubuntu.sh [86]: /data/data/com.zpwebsites.completelinuxinstaller/files/busybox: not found
FAILED
Error: Unable to create loop device

I have Busy Box Free v 1.20.2 installed.
 

Echo5ive

Member
Aug 21, 2012
18
2
South Bend, IN
Are you using the ubuntu.sh file from the OP or the app from one of my previous posts? I initially tried installing that app to install the specific busy box instance referred to in the script.

If you are using the app and trying to launch from there, try modifying the .sh file to point to your installed version (should be /system/xbin/busybox).

Sent from my Galaxy Nexus using xda app-developers app
 

Top Liked Posts

  • There are no posts matching your filters.
  • 31
    First before I start. I just wanted to say that this is not my work. This is simply a guide
    to assist other galaxy nexus users who would like to run ubuntu but don't have an understanding
    on what they should be doing precisely. The original thread called "linux on android" will be
    posted at the bottom of the thread for those wanting to thank the original author. I couldn't
    find a guide specific to our device hence the creation of this one. If this has not been posted
    in the correct area, moderators please feel free to move it to the correct subforum.



    Here is the part where I say, I'm not responsible for anything that happens to your phone. You do
    this at your own discretion. This is something to tinker with for anyone who likes to mess with
    their phone and show off a little bit.
    Also be sure to follow my instructions exactly how I write them to avoid any unnecessary confusion.



    As a base, I am using AOKP B39 and franco kernel Nightly 192.
    If you have terminal emulator or androidVNC currently installed please clear app data and uninstall.
    This of course is to be extra careful.

    First things first: You want to have root and a kernel installed that has loop device support.
    Like I've mentioned already, I am using Franco Nightly 192 and it is working perfectly fine
    therefore I see no reason why it should not work for you. Best results in my opinion will come from using my
    ROM base and kernel.

    Next here are links to the following files you need. These files are quite big and there are 3
    different kinds. The difference between each kind is explained on the page. Remember to keep in
    mind how much space you must have on your phone before downloading a file. You don't want to waste
    your time downloading the full image if you don't have the space to install it.

    Here is the link to the full/small/core images. Download the version of ubuntu you wish to run on
    your phone and make sure it is the latest which as of today is dated June 8th 2012.

    Remember that the "core" version is for experienced ubuntu users only as it has no GUI. only
    command line.

    http://sourceforge.net/projects/linuxonandroid/files/Ubuntu/12.04/


    Once you have downloaded the image you wish to run. You may extract the img file from the zip file
    using 7zip or winrar. Both work perfectly fine. You will notice that once you extract the file
    there is a ubuntu.img and an ubuntu.img.md5
    The md5 file is a checksum file, if you wish to validate the integrity of the file you just downloaded
    go ahead and use a program such as cygwin to compare the md5 hashes.

    Moving on, once you have extracted the ubuntu.img file. Move the file onto your galaxy nexus
    internal memory to the root of your sdcard inside a folder named "ubuntu".
    If you have done this correctly your directory should be as follows. /sdcard/ubuntu

    Next you want to download the bootscript which I will attach at the bottom of this thread. Extract the ubuntu.sh file from the zip i posted below.
    Once you have downloaded the ubuntu.sh file I have attached. You need to place that file in
    the same /sdcard/ubuntu directory where your unbuntu.img file is located.


    To confirm you are on the right track you need to install terminal emulator from the
    google play store as well as install androidVNC. Once you have both apps freshly
    installed you can go ahead and open up terminal emulator, grant it superuser permission
    and then type the following:

    su

    (followed by the enter key) you should see the $ turn into a # symbol.

    Next you type:

    cd /sdcard/ubuntu

    (again followed by the enter key) now your directory should be changed to the /sdcard/ubuntu folder

    Next command:

    ls

    (once more followed by the enter key) This should list all files currently in the folder if you
    see ubuntu.img as well as ubuntu.sh listed then you are right where you need to be.

    Once you have confirmed that both files are listed we can go ahead and start the process of starting
    up ubuntu. In terminal emulator type the following:

    sh ubuntu.sh (all commands are followed by enter key by the way)

    Terminal emulator should start the launch sequence then ask you if you want to start VNC server.

    Type "y" then hit enter. Type "y" without quotations of course.
    Next it will ask you if you want to start the ssh server. Again type "y".

    Screenshot_2012-06-24-16-21-44.png


    Next it will ask you for the screen size you wish to use. You can choose whatever resolution you
    wish to use. I like to use the nexus native resolution which is 1280x720.
    Therefore I type "1280x720" and press enter.


    Screenshot_2012-06-24-16-22-24.png


    Next it will ask you if you would like to save your settings type "y".
    Screenshot_2012-06-24-16-22-43.png


    Finally your terminal should say "[email protected]:/#"

    Screenshot_2012-06-24-16-23-19.png


    Now you are ready to start up androidvnc. Press the home button and DO NOT EXIT terminal emulator.

    Once you open up android VNC enter the following information:

    nickname: ubuntu
    password: ubuntu
    address: localhost
    port: 5900


    Check off the keep password option then scroll down to the botton of that page where it says
    Color Format and change it to 24-bit color (4bpp)
    Screenshot_2012-06-24-16-23-54.png


    Then press connect and voila whatever ubuntu version you downloaded should start up. The mouse should basically be used as if the screen was a track pad.
    Screenshot_2012-06-24-16-24-19.png


    Exiting ubuntu is also easy. Just hit the settings button and a prompt should pop up with an option that says disconnect. Simpy disconnect then switch over to terminal emulator which should still be running and type:

    exit

    Wait around 30 seconds and it should say It shut off correctly. Type exit once more and It will close the directory you were in. One more exit and terminal emulator will close itself.

    The next time you want to load up ubuntu just open up terminal emulator follow the first 2 steps and once you load up ubuntu.sh your config file should be loaded and you will be able to skip all the tedious settings. Then go over to androidVNC and your settings should also be saved. All you do is hit connect and you should be good to go.

    Good luck and hope you all enjoy it. I'll post pictures of the steps that I think will be helpful. Also if this helped you out. Hit the thanks button please.

    Also don't forget to checkout the original thread for further information and details.

    http://forum.xda-developers.com/showthread.php?t=1585009
    4

    That is a universal guide. I made this thread specifically for the galaxy nexus. Please do not post links as that can confuse other users on what they should be doing. Thank you.

    Sent from my Galaxy Nexus using xda premium
    1
    1
    Great guide, i am gonna try to make a complete ROM + awesome kernel :D

    Sent from my Galaxy Nexus using xda app-developers app
    1
    I got this error....what to do? Please help me

    Sent from my Galaxy Nexus using xda app-developers app