How to install ubuntu on the Droid 4

Discussion in 'Droid 4 Hacks' started by greekchampion04, Feb 25, 2012.

  1. greekchampion04
    Offline

    greekchampion04 Member

    Joined:
    Mar 22, 2011
    Messages:
    66
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +0
    How to install ubuntu on the Droid 4


    Huge thanks to zacthespack for creating the ubuntu installer app and original boot script and to zeroktal for modifying the script to work on the D4 and helping me get it working on my device.


    I decided to take my experience in setting this up and put it into a how-to so that others could enjoy the experience of having ubuntu on the Droid 4. If zackthespac or zeroktal have any problems with me making and putting this guide up, please let me know and I will remove it.


    Knowledge Required:
    • working knowledge of command line
    • working knowledge of vi
    • OR the ability to learn how to use both

    Tools Required:

    Step by Step:
    1. Install BusyBox, Terminal, and Android VNC Viewer
    2. Install and run Ubunutu Installer App
    3. Follow the on-screen instructions and click next
    4. Download either the Small or Large image to your phone, (use zeroktal's ubuntud4.zip file instead of the boot script provided in the guide) after the image downloads (will take a while because the file is HUGE) click next
    5. For this screen, the instructions differ from the app.
      1. With your D4 plugged into your PC in USB Mass Storage, create a directory (folder) called ubuntu in the EXTERNAL sdcard's root*
      2. Extract the image you downloaded to that directory
      3. Download and extract the attached .sh (ununtud4.zip) to that directory
      4. Disconnect your phone from your PC
      5. Open terminal and run the following commands:

      su [ENTER]
      mount -o remount,rw,exec,suid /dev/block/vold/179:1 /mnt/sdcard-ext [ENTER]
      cd /mnt/sdcard-ext/ubuntu [ENTER]
      sh ubuntud4.sh [ENTER]
      960x540 [ENTER]**

      If you get an error message: ubuntud4.sh: 45: syntax error: end of file unexpected (expecting "then") see troubleshooting section below.

      killall -TERM Xtightvnc [ENTER]
      vncserver :1 -geometry 960x540 [ENTER]**

      6. Open androidVNC app and enter the following settings:
      Nickname: Anything you want
      Password: ubuntu
      Address: localhost
      Port: 5901
      Color Format: 24-bit color (4 bpp)
      7. Hit connect
      8. Hit your menu soft button and then set input mode to touchpad
      9. You have ubuntu on your Droid 4!

    To "shut down" ubuntu:
    • press the menu button, select disconnect in VNC
    • In terminal type this command 3 times (terminal will close itself when you are done):
      exit [ENTER]

    To "start up" ubuntu again:
    • Follow steps 5-8 above

    Troubleshooting:
    If you get the error message: ubuntud4.sh: 45: syntax error: end of file unexpected (expecting "then") you are about to have fun with vi at the command line.


    Do the following from inside terminal:
    su [ENTER]
    cd /mnt/sdcard-ext/ubuntu [ENTER]
    vi ubuntud4.sh [ENTER]


    If you see ^M or ^ at the end of any line (remember to scroll all the way to the right to see the end of long lines) remove it. once you do that, everything should work just fine. (See the Vi Cheat Sheet above for help with Vi)


    Note: Vol Up + E is [ESC] by default in this terminal emulator


    Notes:
    * It does not have to be on the external SD, but if you put it on the internal SD you will have to modify things as needed-- if you dont know what needs to be changed, just put it on the external SD.
    ** Screen size can be whatever you want it to be, but 960x540 is the size of the D4 screen.
    *** This is a fairly involved process... especially when it comes to editing the .sh file in vi things can get very frustrating and hard, but just take your time and you will get it. As always, doing anything with root access on your phone, especially on the command line has risks. I am not responsible if anything goes wrong with your phone... proceed at your own risk!
    Last edited: Feb 25, 2012
  2. guidot
    Offline

    guidot Developer Relations Staff Member Premium Member

    Joined:
    Feb 10, 2010
    Messages:
    7,352
    Likes Received:
    274
    Trophy Points:
    198
    Location:
    Massachusetts
    Ratings:
    +274
    Stickied! Awesome, now to see how to make it work on my D3!
  3. nitrojuga
    Offline

    nitrojuga New Member

    Joined:
    Feb 25, 2012
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    Awesome! Thanks for the tutorial, greek. I've been trying to get ubuntu running on my D4 for the last couple of days to no avail. I originally got the "ubuntud4.sh: 45: syntax error: end of file unexpected (expecting "then")" message and deleted the ^M's in the script. Now I've run into another problem though.Here is a couple of screen shots.




    View attachment 47821 View attachment 47822
  4. mccompunerd
    Offline

    mccompunerd New Member

    Joined:
    Dec 9, 2009
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    Nitro, after you run SU, but before you run the script run this command and it should take care of those errors
    Code:
    mkdir /data/local/mnt
    Ran into the same thing on mine.
  5. nitrojuga
    Offline

    nitrojuga New Member

    Joined:
    Feb 25, 2012
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    Thanks mc! I tried that and it pretty much said I had already made that directory. However, restarted my phone and tried again and everything worked! Thanks a ton guys!
  6. nitrojuga
    Offline

    nitrojuga New Member

    Joined:
    Feb 25, 2012
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    Anybody got flash running on this? Or is it even available for the ARM architecture?
  7. djdarkside
    Offline

    djdarkside New Member

    Joined:
    Apr 1, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    Is anyone else getting just a gray screen when they remote in? What could be causing this? View attachment 47888
  8. nitrojuga
    Offline

    nitrojuga New Member

    Joined:
    Feb 25, 2012
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    I got that when I just followed the guide from the market. I followed this guide to a t and it doesn't do that anymore.


    Sent from my DROID4 using Tapatalk
  9. djdarkside
    Offline

    djdarkside New Member

    Joined:
    Apr 1, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    The only part I had to modify is when I make the vnc connection, I can only connect threw port 5900 and not 5901.

    Sent from my DROID4 using DroidForums
  10. djdarkside
    Offline

    djdarkside New Member

    Joined:
    Apr 1, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    I figured it out, i misread void for vold when mounting the sdcard partition at step 2. Confirmed working.

    Sent from my DROID4 using DroidForums
  11. greekchampion04
    Offline

    greekchampion04 Member

    Joined:
    Mar 22, 2011
    Messages:
    66
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +0
    bingo, and thats why i made the guide.

    glad it worked for you too!
  12. dopeismarcus
    Offline

    dopeismarcus Member

    Joined:
    May 5, 2010
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +0
    QUESTION:

    After I delete all the ^M and ^ what do i do next? I try to hit the command ":x" to exit and save changes but it just creates another line. Also when I press VOL UP + E for escape nothing happens.
    Last edited: Mar 2, 2012
  13. ndd
    Offline

    ndd Member

    Joined:
    Apr 1, 2011
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +0
    has anyone tried ubuntu with the lapdock? I can only get the ubuntu cursor to move if I hold the left mouse button down (USB mouse, assume trackball would be the same) and drag it. the cursor then follows *very* slowly...
  14. greekchampion04
    Offline

    greekchampion04 Member

    Joined:
    Mar 22, 2011
    Messages:
    66
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +0
    yeah it did exactly the same for me... but it stands to reason that it would be veeerryyyy slow... think about how stacked up it is... the layers

    1) android OS
    2) linux
    3) vnc into linux
    4) webtop
    5) I/O device
  15. ndd
    Offline

    ndd Member

    Joined:
    Apr 1, 2011
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +0
    I can understand it being slow, but I'm not sure why the cursor in the ubuntu window doesn't follow the mouse without my having to hold the left button down. it's kind of like the focus isn't correctly being given to the ubuntu window...
Search tags for this page

droid 4 ubuntu

,

droid razr ubuntu

,

how to install ubuntu on droid razr

,

install ubuntu on droid razr

,
install ubuntu on xt890 razr i
,
installing ubuntu on droid razr
,
linux on motorola droid 4
,

ubuntu droid razr

,
ubuntu for droid razr
,

ubuntu on droid 4