Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,741,682 Members 42,666 Now Online
XDA Developers Android and Mobile Development Forum

How to install ubuntu on the Droid 4

Tip us?
 
grandkodiak
Old
(Last edited by grandkodiak; 5th April 2012 at 04:57 PM.)
#31  
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Apr 2012
Default help

hey all, having problem with my droid razr maxx ubuntu. it was working great for awhile, but i didnt use it for a bit, and reset my phone a few times for other lockups.

anywho, i go to go back into it today and when i boot in

su
cd sdcard/ubuntu
sh ubuntu.sh
su
echo USER=root
tightvncserver -geometry 1024x800

I get:
warning localhost:1 is taken because of /tmp/.x1-lock
remove file if no x server on localhost:1
new x desktop is on localhost:2

Ive used:
tightvncserver -kill :1 (2 or 3 or whatever new ones i make kill sucessfully)

But get:
youll have to kill the xtightvnc process manually



How do I get out of this? I cant find the .x1-lock file it mentions to delete, and theres no way to kill :1 (at least that I know about)

I was reading that this happens when ubunutu isnt shut down properly (didnt know just using exit didnt do the trick) so now I cant vnc into my ubuntu anymore and only have the terminal fun****ion!

thanks all!

ps, ive read through all 25 pages of
http://forum.xda-developers.com/show...718952&page=15
which mentions the lock file problem, but i dont understand from the post how to resolve that, and having less then 10 posts to this forum i cant post the question there.



edit. found it reading over my post, it was case sensitive: rm /tmp/.X1-lock and rm /tmp/.X1-unix/X1 for anyone who finds this psot wioth same problems
 
garlick2
Old
#32  
Member
Thanks Meter 52
Posts: 90
Join Date: Dec 2011
Hey, I have D4 with an ICS AOKP ROM, I got Ubuntu up and running, super excited about that, but I can't seem to get my lapdock to work with the device.

I didn't know if I needed the webtop.apk, which isn't available yet on ICS, or if there was another app I could download to work for me as the transfer??

Does anyone have any suggestions?? The mousepad works on ICS when I dock it, it just won't show HDMI through the HDMI port, so no mirroring.

Any suggestions would be great, would love to get Ubuntu working on the dock so this becomes a REAL working unit.
 
devilsclaw
Old
#33  
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Apr 2012
The reason the vncserver requires being on :1 is because the webtop interface is already running.

I added to the top of the ubuntud4.sh script
/etc/init.d/webtop-shutdown.sh

and at the bottom
/etc/init.d/webtop-restart.sh

with this you don't have to modify anything else besides the ubuntud4.sh

I did edit the init.sh to autofill in my preferences.

What I am really looking to do though is getting the webtop which is the pre-built ubuntu that is already installed on the phone to listen on the tcp port. currently is is ran with -nolisten tcp and I have tried to remove that from the scrip yet it still shows so it must be somewhere else.
 
devilsclaw
Old
#34  
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Apr 2012
I unmount the loop245 you have to kill all the processes that are spwaned by ubuntu you can do that like this


Code:
Select Code
for pid in `lsof | grep "\/data\/local\/mnt\/ubun" | awk '{print $2}'`
do 
  kill $pid
done
or a single line

Code:
Select Code
for pid in `lsof | grep "\/data\/local\/mnt\/ubun" | awk '{print $2}'` ; do kill $pid ; done


---------- Post added at 09:28 AM ---------- Previous post was at 09:00 AM ----------

Here is the script I use
The REZ=1024x768
wont do anything unless you edit your init.sh to not get that info.

Code:
Select Code
##########################################
#Ubuntu boot script V5 for Android       #
#Built by Zachary Powell (zacthespack)   #
#Thanks to everyone at XDA!           #
#Modified to work with the D4 by Zeroktal#
##########################################
perm=$(id|cut -b 5)
if [ "$perm" != "0" ];then echo "This script requires root! Type: su"; exit; fi
/etc/init.d/webtop-shutdown.sh
mount -o remount,rw /dev/block/mmcblk0p5 /system
mount -o remount,rw,exec,suid /dev/block/vold/179:1 /mnt/sdcard-ext
export kit=/sdcard-ext/ubuntu
export bin=/system/bin
export mnt=/data/local/mnt/ubun
export USER=root
export REZ=1024x768
mkdir $mnt
export PATH=$bin:/usr/bin:/usr/local/bin:/usr/sbin:/bin:/usr/local/sbin:/usr/games:$PATH
export TERM=linux
export HOME=/root
if [ -b /dev/block/loop254 ]; then
        echo "Loop device exists"
else
        busybox mknod /dev/block/loop254 b 7 254
fi
losetup /dev/block/loop254 $kit/ubuntu.img
mount -t ext2 /dev/block/loop254 $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
/system/xbin/busybox mount -o bind /sdcard-ext $mnt/sdcard
/system/xbin/busybox sysctl -w net.ipv4.ip_forward=1
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "127.0.0.1 localhost" > $mnt/etc/hosts
echo "Ubuntu is configured with SSH and VNC servers that can be accessed from the IP:"
ifconfig lo
echo " "
busybox chroot $mnt /root/init.sh

echo "Shutting down Ubuntu ARM"
/etc/init.d/webtop-restart.sh
for pid in `lsof | grep "\/data\/local\/mnt\/ubun" | awk '{print $2}'`
do
        kill $pid
done
export mnt=/data/local/mnt/ubun
umount $mnt/sdcard
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
losetup -d /dev/block/loop254
This is my init.sh
Code:
Select Code
#!/bin/bash
#############################################
# Asks User to screen size and saves as REZ #
#############################################
#echo "Now enter the screen size you want in pixels (e.g. 800x480), followed by [ENTER]:"

#read REZ
#REZ=960x540

##############################################
# Pick which desktop environment to use, this#
# is done by having a xstartup file for each #
# desktop, then renaming the one you want to #
# use to 'xstartup' before boot              #
##############################################
#echo "Please select which Desktop environment you want to use, type the number to select it then press [ENTER]"
#echo "1 - LXDE"
#echo "2 - Gnome"
#echo "Make your Selection:"
#read DESKTOP
DESKTOP=1
if [ $DESKTOP == 1 ]
        then
        mv /root/.vnc/lxstartup /root/.vnc/xstartup
fi
if [ $DESKTOP == 2 ]
        then
        mv /root/.vnc/gxstartup /root/.vnc/xstartup
fi

###########################################
# Tidy up previous LXDE and DBUS sessions #
###########################################
rm /tmp/.X* > /dev/null 2>&1
rm /tmp/.X11-unix/X* > /dev/null 2>&1
rm /root/.vnc/localhost* > /dev/null 2>&1
rm /var/run/dbus/pid > /dev/null 2>&1

############################################################
# enable workaround for upstart dependent installs         #
# in chroot'd environment. this allows certain packages    #
# that use upstart start/stop to not fail on install.      #
# this means they will have to be launched manually though #
############################################################
dpkg-divert --local --rename --add /sbin/initctl > /dev/null 2>&1
ln -s /bin/true /sbin/initctl > /dev/null 2>&1


###############################################
# start vnc server with given resolution and  #
# DBUS server, (and optionally an SSH server) #
###############################################
vncserver :0 -geometry $REZ
dbus-daemon --system --fork > /dev/null 2>&1
/etc/init.d/ssh start


echo
echo "If you see the message 'New 'X' Desktop is localhost:0' then you are ready to VNC into your ubuntu OS.."
echo
echo "If VNC'ing from a different machine on the same network as the android device use the 1st address below:"
##########################################
# Output IP address of android device    #
##########################################
#ifconfig | grep "inet addr"

echo
echo "If using androidVNC, change the 'Color Format' setting to 24-bit colour, and once you've VNC'd in, change the 'input mode' to touchpad (in settings)"

echo
echo "To shut down the VNC server and exit the ubuntu environment, just enter 'exit' at this terminal - and WAIT for all shutdown routines to finish!"
echo

###############################################################
# Spawn and interactive shell - this effectively halts script #
# execution until the spawning shell is exited (i.e. you want #
# to shut down vncserver and exit the ubuntu environment)     #
###############################################################
/bin/bash -i

#########################################
# Disable upstart workaround and        #
# kill VNC server (and optionally SSH)  #
# Rename used xstartup to its first file#
#########################################
vncserver -kill :0
if [ $DESKTOP == 1 ]
        then
        mv /root/.vnc/xstartup /root/.vnc/lxstartup
fi
if [ $DESKTOP == 2 ]
        then
        mv /root/.vnc/xstartup /root/.vnc/gxstartup
fi
/etc/init.d/ssh stop
 
kirschnet
Old
#35  
Junior Member
Thanks Meter 0
Posts: 1
Join Date: Dec 2008
Default fille permissions on ubuntu directory?

For some reason I keep getting "cd: can't cd to ubuntu" whether it was created on the internal sdcard or external sdcard-ext directory. I am assuming the permissions are not right. If I try to look at the permissions with a "ls -l ubuntu" it says no such file or directory. Yet I can connect via windows explorer and can access the directory just fine.

What am I doing wrong?
 
nequeelrey
Old
#36  
Junior Member
Thanks Meter 0
Posts: 10
Join Date: May 2012
Default droid 4 wont boot

I did this, and ubuntu is running correctly through vnc, which is incredible! Thanks! But once I rebooted my droid, it booted to the eye, and then kept rebooting there, in an endless loop, and never booted until the battery died. Anyone know how to fix this, or have any suggestions how to proceed?

Thanks in advance.
 
zeroktal
Old
(Last edited by zeroktal; 15th November 2012 at 12:00 AM.) Reason: Another Fix :)
#37  
Senior Member
Thanks Meter 9
Posts: 108
Join Date: Nov 2006
I have modified the d4 script for ICS 4.04.
This also includes a few smaller fixes like directory creation for first time users.
Fixed: Directory creation
Fixed: Busybox in /system/bin OR /system/xbin
Fixed: Edited out /system remount as its not needed
Fixed: Added Remount of /sdcard-ext so that you can run the .sh directly from there.
Fixed: Killing Processes - Thanks to Devils Claw
Fixed: Unmounting filesystems correctly.

#Thanks to everyone at XDA! #
#Modified to work with the D4 by Zeroktal#
##########################################
#Fixed: Directory creation
#Fixed: Busybox in /system/bin OR /system/xbin
#Fixed: Edited out /system remount as its not needed
#Fixed: Added Remount of /sdcard-ext so that you can run the .sh directly from there.
#Fixed: Killing Processes - Thanks to Devils Claw
#Fixed: Unmounting filesystems correctly.
perm=$(id|cut -b 5)
if [ "$perm" != "0" ];then echo "This script requires root! Type: su"; exit; fi
#mount -o remount,rw /dev/block/mmcblk0p5 /system
mount -o remount,rw /dev/block/vold/179:97
export kit=/sdcard-ext/ubuntu
export bin=/system/bin
export mnt=/data/local/mnt/ubun
export mnt2=/data/local/mnt
export mnt3=/data/local/mnt/ubun/sdcard
export USER=root
mkdir $mnt2
mkdir $mnt
mkdir $mnt3
export PATH=$bin:/usr/bin:/usr/local/bin:/usr/sbin:/bin:/usr/local/sbin:/usr/games:$PATH
export TERM=linux
export HOME=/root
if [ -b /dev/block/loop254 ]; then
echo "Loop device exists"
else
busybox mknod /dev/block/loop254 b 7 254
fi
losetup /dev/block/loop254 $kit/ubuntu.img
mount -t ext2 /dev/block/loop254 $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
/system/bin/busybox mount -o bind /sdcard-ext $mnt/sdcard
/system/bin/busybox sysctl -w net.ipv4.ip_forward=1
/system/binx/busybox mount -o bind /sdcard-ext $mnt/sdcard
/system/binx/busybox sysctl -w net.ipv4.ip_forward=1
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "127.0.0.1 localhost" > $mnt/etc/hosts
echo "Ubuntu is configured with SSH and VNC servers that can be accessed from the IP:"
ifconfig lo
echo " "
busybox chroot $mnt /root/init.sh

echo "Shutting down Ubuntu ARM"
for pid in `lsof | grep "\/data\/local\/mnt\/ubun" | awk '{print $2}'` ; do kill $pid ; done
sleep 2
umount $mnt/sdcard
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
losetup -d /dev/block/loop254
Attached Files
File Type: zip ubuntud4v3.zip - [Click for QR Code] (1.0 KB, 13 views)
 
zeroktal
Old
#38  
Senior Member
Thanks Meter 9
Posts: 108
Join Date: Nov 2006
Default Haven't seen this

Quote:
Originally Posted by nequeelrey View Post
I did this, and ubuntu is running correctly through vnc, which is incredible! Thanks! But once I rebooted my droid, it booted to the eye, and then kept rebooting there, in an endless loop, and never booted until the battery died. Anyone know how to fix this, or have any suggestions how to proceed?

Thanks in advance.


I haven't seen this, have you made any other mods?
 
louisdk
Old
#39  
Junior Member
Thanks Meter 0
Posts: 4
Join Date: Jun 2010
Could somebody please make a video of a Motorola Droid 4 running Ubuntu or maybe just take some pictures?
 
zeroktal
Old
#40  
Senior Member
Thanks Meter 9
Posts: 108
Join Date: Nov 2006
Sure, I'm a bit pressed for time. I re-did the Ubuntu boot script as well to make things smoother.

Sent from my DROID4 using xda premium

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes