Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,778,591 Members 36,669 Now Online
XDA Developers Android and Mobile Development Forum

[WIP] [DEV] [HOWTO] Ubuntu on Nook Color! UPDATE 1/5/11

Tip us?
 
devastatorx
Old
(Last edited by devastatorx; 6th January 2011 at 03:37 AM.)
#1  
devastatorx's Avatar
Senior Member - OP
Thanks Meter 123
Posts: 171
Join Date: Feb 2009
Location: Indianapolis
Default [WIP] [DEV] [HOWTO] Ubuntu on Nook Color! UPDATE 1/5/11

DISCLAIMER: You know the risks, bricking, breaking etc. I'm not, nor is anyone else responsible if something goes wrong with your device, especially should it turn into a cave troll and bludgeon someone to death.

You will have to be rooted for this to work.

Update 1/5/11
Changed the install and loader scripts re-compressed and uploaded, new download link. Stream lined the installation process (removed 5 steps)

Update 1/4/11

reflect changes to ubuntu.sh and bootubuntu scripts and streamlining the process. Added screenshots
_________________________

I was over at nexusonehacks.net and looking at the ubuntu on nexus one hack and was thinking that this could be ported to the nook color. The idea is to run ubuntu from an img on the sd card.

The following is a modified version of the "how to" orginally posted here

http://nexusonehacks.net/nexus-one-h...us-oneandroid/

Credits
The guys at NexusOneHacks
xda user munday who has modified the scripts to work for the nook color
Devs at XDA Developer for the Ubuntu ARM image for HTC HD2
Saurik (Jay Freeman) for the Debian G1 script, which was hacked for Ubuntu on Nexus One! and then re-hacked for the Nook Color by munday

Here we go:

1) Go download the ubuntu file here: http://www.megaupload.com/?d=67BU4Y3T

2) Extract the contents using 7zip http://www.7-zip.org/download.html

3) Copy the extracted folder "ubuntu" to the root of your SD card
4) Unmount the nook from your pc, go into the app NookColor Tools (if you don't have it download it here courtesy of Ben 74 and click All Settings->Development then uncheck Auto Mount. This will prevent the SD card from being mounted automatically when plugged into the PC

5) Plug the Nook back into your pc and open a command line then navigate to your android sdk folder ie C:\android-sdk or wherever you have it and type
Code:
adb devices
Hit enter and make sure that the nook color comes up (should be the SN of your Nook)

Note: This can also be done from terminal emulator instead of adb...but it is kind of a pain

6) Now we want to go into the command line on the nook so type
Code:
adb shell
Hit enter and this should bring up a "#" sign.

7) Type
Code:
su
hit enter (I do this just as a force of habit)

8) Now we navigate to the ubuntu folder we just copied to our sd card by entering
Code:
cd /sdcard/ubuntu
hit enter. To confirm you are where you want to be you can type
Code:
ls
and it should list the contents of the ubuntu folder.

9) Run the setup script ubuntu.sh by entering the following:
Code:
sh ./ubuntu.sh
hit enter

10) Now type
Code:
bootubuntu
and hit enter

11) So now we have ubuntu command line up and running which should look like:
Code:
root@localhost:/#
We will need to get some packages to run a gui and then connect to it via VNC client. So we need to update a few things first. Type:
Code:
apt-get update
then
Code:
apt-get install tightvncserver
now we need the gui elements so enter this:
Code:
apt-get install lxde
12) Type the following:
Code:
export USER=root
vncserver -geometry 1024600
this sets the resolution...you can change it to play around, but the native resolution for the nook is 1024x600. This is also where you will set the password for your vnc server...make sure to remember it

13) Next, we are going to add the following to /root/.vnc/xstartup file using cat command: (hit enter after each line and ignore the fact that it looks like it does it twice)
Code:
cat > /root/.vnc/xstartup
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
icewm &
lxsession
After hitting enter after the last line press "Ctrl+D" twice then press enter

14) We need the vnc server to start every time we start ubuntu, type this:
Code:
cat > front
export USER=root
cd /
rm -r -f tmp
mkdir tmp
cd /
vncserver -geometry 1024600
Same as before, hit enter after each line then after hitting enter for the last line press "Ctrl+D" twice then press enter.

15) Enter this
Code:
cat front /root/.bashrc > temp
Then
Code:
cp temp /root/.bashrc

16) Now on the nook open up your vnc viewer app (android vnc viewer or PocketCloud...or whatever you use)

Use the following settings:
Host Address: 127.0.0.1 (some don't require this)
Password: the password you set up in step 16
Port: 5901

Save and then click connect and you should be up and running on ubuntu! To leave ubuntu type exit from adb. This should kill ubuntu. Exit adb and then you can disconnect the nook from your pc.

To start ubuntu from the nook open up a terminal emulater and type:

Code:
bootubuntu
Hit enter, this should bring up the root@localhost, hhen press "Home" key and open up your vnc app. Now you are ready to rock your Linux tablet!

You could also use gscript lite to automate the process of starting ubuntu so you don't have to type it in the terminal everytime. You can get gscript lite from the market or download the file I have attached.

It does seem a little laggy..just a little...for now anyway

To exit ubuntu: Disconnect the vnc client then hold the "Home" key (I use button savior which brings up a nice little task manager) and click the Terminal emulator when it pops up under running tasks. Once you are back in the terminal you can type:
Code:
exit
to shut down ubuntu.

Enjoy and make sure you thank munday and the guys at nexusonehacks and all the devs who helped make it possible.

-devastator

EDIT:

I noticed that after rebooting the nook would hang at the "Future of reading" screen....if this happens turn the device off remove the sd card the turn the nook back on. It should boot fine. After it's finished you can return the sd card and mount it. This is strange and I'm looking into it. I'm not sure if this is limited to me or if it is universal to all nooks. It also still fails at shutting ubuntu down for some reason. I'm still looking into this.g into this.
Attached Thumbnails
Click image for larger version

Name:	snap20110104_053643.jpg
Views:	8573
Size:	35.9 KB
ID:	480520   Click image for larger version

Name:	snap20110104_124210.jpg
Views:	6623
Size:	19.0 KB
ID:	480521   Click image for larger version

Name:	snap20110104_130046.jpg
Views:	7285
Size:	37.7 KB
ID:	480522   Click image for larger version

Name:	snap20110104_124453.jpg
Views:	6714
Size:	24.2 KB
ID:	480523   Click image for larger version

Name:	snap20110104_130105.jpg
Views:	6284
Size:	38.2 KB
ID:	480525  

Attached Files
File Type: apk GScript_Lite.apk - [Click for QR Code] (56.4 KB, 276 views)

Previous Devices: ADP G1 CM6 | GarminFone rooted | Moto CliqXT rooted running 2.1 | HTC Droid Eris rooted running 2.2.1 | Moto Droid rooted running 2.2.1 | HTC HD2 OzDroid ROM 2.15 Radio JDMode 1.0 Android | HTC Evo 4g CM7 | Samsung Epic 4G E.R.A. EI22 | Motorola Photon 4g CM9

Current Devices: Sprint Samsung Galaxy S3 on Liquid Smooth Stable | Nook Color on Jelly Bean AOSP dualbooting NookBuntu 0.3 from SD
The Following 10 Users Say Thank You to devastatorx For This Useful Post: [ Click to Expand ]
 
munday
Old
(Last edited by munday; 7th January 2011 at 11:39 PM.)
#2  
Junior Member
Thanks Meter 19
Posts: 26
Join Date: Oct 2010
I got it going, just needed a few "busybox"-es here and there . It needs some work, right now to get X you have to use VNC.
It's sluggish but a bit more work might just yield something a bit more usable. I'll play more tomorrow night.

Here's my scripts:

ubuntu.sh

Code:
mount -o remount,rw /dev/block/mmcblk0p5 /system
busybox modprobe ext2

rm -f /data/local/bin/fsrw
rm -f /data/local/bin/bootubuntu
rm -f /data/local/bin/unionfs
rm -f /data/local/bin/installer.sh
rm -f /data/local/bin/mountonly

mkdir /data/local/mnt

#busybox clear
rm  /system/bin/fsrw
rm  /system/bin/bootubuntu
rm  /system/bin/unionfs
rm -/system/bin/mountonly

busybox cp -f fsrw /system/bin
busybox cp -f bootubuntu /system/bin
busybox cp -f unionfs /system/bin
busybox cp -f mountonly /system/bin


cd /sdcard/ubuntu

busybox chmod 4777 *

cd /system/bin/

busybox chmod 4777 *

cd /

#busybox clear

echo " "
echo "Ubuntu Chroot Bootloader v0.1"
echo "Ubuntu Bootloader is now installed!"
echo "This process does NOT damage Android OS!"
echo " "
echo "Original Installer by Charan Singh"
echo "Modified for Ubuntu Chroot by Max Lee at NexusOneHacks.net"
echo " "
echo "To enter the Debian Linux console just type 'bootubuntu'"

bootubuntu

Code:
mount -o remount,rw /dev/block/mmcblk0p5 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
export mnt=/data/local/mnt
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
busybox mknod /dev/loop2 b 7 0
mount -o loop,noatime -t ext2 $kit/ubuntu.img $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
busybox sysctl -w net.ipv4.ip_forward=1
echo "Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4"
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "Setting localhost on /etc/hosts "
echo "127.0.0.1 localhost" > $mnt/etc/hosts
echo "READY TO ROCK AND ROLL BABY! "
echo "Brought to you by NexusOneHacks.net and the open source community! "
echo " "
busybox chroot $mnt /bin/bash

#After exit command is executed clear it all up
echo " "

echo "Shutting down Ubuntu"
umount $mnt/dev/pts
umount $mnt/proc 
umount $mnt/sys 
umount $mnt

Then just followed the instructions at nexusonehacks.
note: to run bootubuntu i had to use sh and the use the full path:
Code:
# sh /system/bin/bootubuntu
other note: I was using adb not a term app on the nook.

Obligatory video
I can't post links yet so check: youtube.com/watch?v=TnXfZ6aagn8 for a really boring video

EDIT: switched the names, DOH!
The Following 3 Users Say Thank You to munday For This Useful Post: [ Click to Expand ]
 
devastatorx
Old
#3  
devastatorx's Avatar
Senior Member - OP
Thanks Meter 123
Posts: 171
Join Date: Feb 2009
Location: Indianapolis
I also had to use sh and the full path also. Thanks for the update on the script...gonna try it in the morning (it's 2am here) will also see if I can help to get it running smoother. What class SD card are you using? I imagine a class 4 or higher would yeild better results as far as responsiveness goes.

Previous Devices: ADP G1 CM6 | GarminFone rooted | Moto CliqXT rooted running 2.1 | HTC Droid Eris rooted running 2.2.1 | Moto Droid rooted running 2.2.1 | HTC HD2 OzDroid ROM 2.15 Radio JDMode 1.0 Android | HTC Evo 4g CM7 | Samsung Epic 4G E.R.A. EI22 | Motorola Photon 4g CM9

Current Devices: Sprint Samsung Galaxy S3 on Liquid Smooth Stable | Nook Color on Jelly Bean AOSP dualbooting NookBuntu 0.3 from SD
 
munday
Old
#4  
Junior Member
Thanks Meter 19
Posts: 26
Join Date: Oct 2010
The sd is a class 2 that came in one of my dev phones. I'll pick up a faster one tomorrow after work and test it out.

It's just about 3am here now, we must be in the same time zone.
I'm going to bed now, but first here's a modded version of the script you had originally posted that also works now.

bootubuntu
Code:
#!/bin/sh
mount -o remount,rw /dev/block/mmcblk0p5 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
busybox [ ! -d /data/local/ubuntu ] && mkdir /data/local/ubuntu
export mnt=/data/local/ubuntu
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
busybox mknod /dev/loop1 b 7 0
busybox losetup /dev/block/loop1 /sdcard/ubuntu/ubuntu.img
mount -t ext2 /dev/block/loop1 /data/local/ubuntu
#mount -o loop,noatime -t ext2 $kit/ubuntu.img $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
busybox sysctl -w net.ipv4.ip_forward=1
echo "Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4"
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "Setting localhost on /etc/hosts "
echo "127.0.0.1 localhost" > $mnt/etc/hosts
echo "READY TO ROCK AND ROLL BABY! "
echo "Brought to you by NexusOneHacks.net and the open source community! "
echo " "
busybox chroot $mnt /bin/bash

#After exit command is executed clear it all up
echo " "

echo "Shutting down Ubuntu"
umount $mnt/dev/pts
umount $mnt/proc 
umount $mnt/sys 
umount $mnt
busybox losetup -d /dev/loop1
#unregistering the loopback device just seems to die. need to fix or remove.
I'll look at the N1 formus tomorrow too and see if they have made progress in getting X to run fast or without need for VNC.
The Following User Says Thank You to munday For This Useful Post: [ Click to Expand ]
 
wethegamerz
Old
#5  
Junior Member
Thanks Meter 0
Posts: 6
Join Date: Oct 2010
Nice work, I am addicted in seeing the crazy crap people are doing everyday.
 
devastatorx
Old
(Last edited by devastatorx; 4th January 2011 at 08:49 AM.)
#6  
devastatorx's Avatar
Senior Member - OP
Thanks Meter 123
Posts: 171
Join Date: Feb 2009
Location: Indianapolis
Couldn't sleep so I'm messing around with it now...I'm using a class 4 and have it up and running. It does seem to be a little laggy, but I don't have a class 2 to compare it to. Let me know what you find out, I'll keep playing with it also to see if I can get it to be more responsive...but we are definately on our way to having a great little linux tablet in addition to android. You should also be able to use this for other builds of linux also by just changing out the .img file to a flavor of your choosing. I'm excited

I have also updated the OP with the how to and credits. Really appreciate your help munday.

Previous Devices: ADP G1 CM6 | GarminFone rooted | Moto CliqXT rooted running 2.1 | HTC Droid Eris rooted running 2.2.1 | Moto Droid rooted running 2.2.1 | HTC HD2 OzDroid ROM 2.15 Radio JDMode 1.0 Android | HTC Evo 4g CM7 | Samsung Epic 4G E.R.A. EI22 | Motorola Photon 4g CM9

Current Devices: Sprint Samsung Galaxy S3 on Liquid Smooth Stable | Nook Color on Jelly Bean AOSP dualbooting NookBuntu 0.3 from SD
 
devastatorx
Old
(Last edited by devastatorx; 4th January 2011 at 11:01 AM.)
#7  
devastatorx's Avatar
Senior Member - OP
Thanks Meter 123
Posts: 171
Join Date: Feb 2009
Location: Indianapolis
I noticed that after rebooting the nook would hang at the "Future of reading" screen....if this happens turn the device off remove the sd card the turn the nook back on. It should boot fine. After it's finished you can return the sd card and mount it. This is strange and I'm looking into it. I'm not sure if this is limited to me or if it is universal to all nooks.


Edit:
Running into some strange occurrences...it appears that when you type exit from the terminal to kill ubuntu, I believe ubuntu stays running...anyway, I'm going to bed and will work on it more tomorrow.

Previous Devices: ADP G1 CM6 | GarminFone rooted | Moto CliqXT rooted running 2.1 | HTC Droid Eris rooted running 2.2.1 | Moto Droid rooted running 2.2.1 | HTC HD2 OzDroid ROM 2.15 Radio JDMode 1.0 Android | HTC Evo 4g CM7 | Samsung Epic 4G E.R.A. EI22 | Motorola Photon 4g CM9

Current Devices: Sprint Samsung Galaxy S3 on Liquid Smooth Stable | Nook Color on Jelly Bean AOSP dualbooting NookBuntu 0.3 from SD
 
Link3737
Old
#8  
Senior Member
Thanks Meter 10
Posts: 132
Join Date: Jul 2010
Quote:
Originally Posted by devastatorx View Post
You should also be able to use this for other builds of linux also by just changing out the .img file to a flavor of your choosing. I'm excited
Are there any increased risks with changing the version you use?
 
devastatorx
Old
#9  
devastatorx's Avatar
Senior Member - OP
Thanks Meter 123
Posts: 171
Join Date: Feb 2009
Location: Indianapolis
Well, you will want to make sure that the build supports ARM based devices.

Previous Devices: ADP G1 CM6 | GarminFone rooted | Moto CliqXT rooted running 2.1 | HTC Droid Eris rooted running 2.2.1 | Moto Droid rooted running 2.2.1 | HTC HD2 OzDroid ROM 2.15 Radio JDMode 1.0 Android | HTC Evo 4g CM7 | Samsung Epic 4G E.R.A. EI22 | Motorola Photon 4g CM9

Current Devices: Sprint Samsung Galaxy S3 on Liquid Smooth Stable | Nook Color on Jelly Bean AOSP dualbooting NookBuntu 0.3 from SD
 
devastatorx
Old
(Last edited by devastatorx; 4th January 2011 at 06:45 PM.)
#10  
devastatorx's Avatar
Senior Member - OP
Thanks Meter 123
Posts: 171
Join Date: Feb 2009
Location: Indianapolis
Quote:
Originally Posted by munday View Post
Then just followed the instructions at nexusonehacks.
note: to run bootubuntu i had to use sh and the use the full path:
Code:
# sh /system/bin/bootubuntu
I fixed this, the scripts were backwards, I have updated the OP to reflect the changes and bootubuntu now works

Previous Devices: ADP G1 CM6 | GarminFone rooted | Moto CliqXT rooted running 2.1 | HTC Droid Eris rooted running 2.2.1 | Moto Droid rooted running 2.2.1 | HTC HD2 OzDroid ROM 2.15 Radio JDMode 1.0 Android | HTC Evo 4g CM7 | Samsung Epic 4G E.R.A. EI22 | Motorola Photon 4g CM9

Current Devices: Sprint Samsung Galaxy S3 on Liquid Smooth Stable | Nook Color on Jelly Bean AOSP dualbooting NookBuntu 0.3 from SD

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes