Related
This hasn't been thoroughly tested as i'm on a Desire and have issues getting Ubuntu to start up due to some kernel issues regarding loopback devices but this should (Theoretically ) work.
If you'd like to test this out you have to first use the following tutorial
http://forum.xda-developers.com/showthread.php?t=718952
Then replace the ubuntu.img of that package with this... (I kept the .img named ubuntu.img so as to alleviate the need to modify the bootubuntu chroot script)
http://www.multiupload.com/CO5NRRKN80
Post back here if it works.
I've attached a file with the five scripts that you need to boot this .img. Do NOT download the package in the first thread as that is for ubuntu.
In short...
1. Create a folder on the root of your sdcard called ubuntu
2. Extract both scripts.rar and ubuntu.rar in that folder
3. Follow the tutorial as posted in the first thread that I linked.
Upon performing sh ./ubuntu.sh and bootubuntu with new ubuntu.img, i received the following:
Code:
Ubuntu Chroot Bootloader v0.1
Ubuntu Bootloader is now installed!
This process does NOT damage Android OS!
Original Installer by Charan Singh
Modified for Ubuntu Chroot by Max Lee at NexusOneHacks.net
To enter the Debian Linux console just type 'bootubuntu'
# bootubuntu
mknod: /dev/loop2: File exists
mount: can't setup loop device: No such file or directory
mount: mounting devpts on /data/local/mnt/dev/pts failed: No such file or directory
mount: mounting proc on /data/local/mnt/proc failed: No such file or directory
mount: mounting sysfs on /data/local/mnt/sys failed: No such file or directory
net.ipv4.ip_forward = 1
Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4
bootubuntu: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
bootubuntu: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
Setting localhost on /etc/hosts
bootubuntu: cannot create /data/local/mnt/etc/hosts: directory nonexistent
READY TO ROCK AND ROLL BABY!
Brought to you by NexusOneHacks.net and the open source community!
chroot: can't execute '/bin/bash': No such file or directory
Shutting down Ubuntu
umount: can't umount /data/local/mnt/dev/pts: No such file or directory
umount: can't umount /data/local/mnt/proc: No such file or directory
umount: can't umount /data/local/mnt/sys: No such file or directory
umount: can't umount /data/local/mnt: Invalid argument
#
So ur saying replace the Ubuntu img nd replace it with what u posted maemo 5? N how how I boot then
Su
Su
Bootubuntu?
Sent from my Nexus One using XDA App
got a loop /dev/loop1:no such devices or address
lemme try these new scripts..
got this
# su
# bootubuntu
failed: No such file or directoryk3 on /system
mknod: not found
mount: not found
mount: not found
mount: not found
mount: not found
sysctl: not found
Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4
: directory nonexistentte /data/local/mnt
: directory nonexistentte /data/local/mnt
Setting localhost on /.etc/hosts
: directory nonexistentte /data/local/mnt
READY TO ROCK AND ROLL BABY!
Brought to you by NexusOneHacks.net and the open source community!
chroot: not found
: not found
: not found
Shutting down Ubuntu but when i replace them with my old ubuntu files, ubuntu runs fine on or off the computer...mayb make this directory /data/local/mnt?
Yes, su su bootubuntu
I think I may need to make a slight modification to together boot script. Bear with me.
http://forum.xda-developers.com/attachment.php?attachmentid=359312&d=1279019428
Updated scripts.
Has anyone tried the new scripts yet?
Edit: double post...
I Did, i re-ran sh ./ubuntu.sh and then just in case, ran su su twice, then ran bootubuntu. results:
Code:
Ubuntu Chroot Bootloader v0.1
Ubuntu Bootloader is now installed!
This process does NOT damage Android OS!
Original Installer by Charan Singh
Modified for Ubuntu Chroot by Max Lee at NexusOneHacks.net
To enter the Debian Linux console just type 'bootubuntu'
# su
# su
# bootubuntu
failed: No such file or directoryk3 on /system
mknod: not found
mount: not found
mount: not found
mount: not found
mount: not found
sysctl: not found
Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4
: directory nonexistentte /data/local/mnt
: directory nonexistentte /data/local/mnt
Setting localhost on /.etc/hosts
: directory nonexistentte /data/local/mnt
READY TO ROCK AND ROLL BABY!
Brought to you by NexusOneHacks.net and the open source community!
chroot: not found
: not found
: not found
Shutting down Ubuntu
umount: not found
umount: not found
umount: not found
umount: not found
#
cmonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
It would be really good if we can modify the scripts so we are able to still run ubuntu and maemo5 don't you guys think?
Few months ago, there was a post on XDA:
http://forum.xda-developers.com/showthread.php?t=718952
and a link to:
http://nexusonehacks.net/nexus-one-hacks/how-to-install-ubuntu-on-your-nexus-oneandroid/
They explain how to install and run Ubuntu on Nexus One.
But a lot of people got problems when running script bootubuntu and ubuntu.sh, and I was one of them.
After Cyanogen Mod 6.0 was released, I could successfully run Ubuntu according to given instructions, but later I discovered the two scripts (ubuntu.sh and bootubuntu) don't always work, and I found them very complex and unnecessary statements can be removed.
Since few months ago I've been refining the two scripts to make them able to boot Ubuntu with less likelihood to get error. I thought I would like to share my findings to everyone interested.
Here are some reasons why it's useful to have Ubuntu on Nexus One
1. Fully functional web browser Firefox
2. Fully functional office suite OpenOffice
3. Fully functional Linux terminal with lots of ultilities
4. Fully functional image manipulation tool Gimp
5. Ability to run lots of useful native Linux programs
6. Python, gcc, g++..
I'll talk about my findings in next few posts.
Post #2: simplify ubuntu.sh, remove unnecessary script files
Post #3: simplify bootubuntu, forcibly umount
Post #4: how to shutdown Ubuntu properly if terminal application was closed by Android
Post #5: a little script which should be run before exiting from Ubuntu
Post #6: how to start GNOME desktop (instead of LXDE) and get correct keyboard mapping
Post #7: a possible solution to loop device's "resource or device busy" error
About my Nexus One:
bought on 2nd March
Cyanogen Mod 6.0
IntersectRaven HAVS CM CFS 1020 kernel
Busybox 1.17
Radio 5.0.8
Gapps hdpi 20101020.1
Please don't hesitate to tell me if I made any mistake, I'm a Linux beginner because I taught myself Linux, my University will teach Unix next semester.
Attachment: ubuntu_scripts.zip
contains all modified scripts.
Finding #1:
In original Zip package, there are five scripts, but only two of them are actually used to install and boot up Ubuntu.
fsrw, mountonly, unionfs are not necessary to install and boot ubuntu, thus their reference can be removed from ubuntu.sh
Here is my simplified version of ubuntu.sh
#-------------------------------
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
rm -f /system/bin/bootubuntu
rm -r -f /data/local/ubuntu
cp -f bootubuntu /system/bin
cd /
echo "Type 'bootubuntu' to boot Ubuntu"
#-------------------------------
Simplified ubuntu.sh removed unnecessary statements to reduce risk of error.
Also I discovered:
Files in /sdcard/ubuntu can not be chmod, and it's unnecessary to chmod 4777 to them.
chmod 4777 /system/bin/* will cause some Android softwares to malfunction (e.g. Orbot), also it *possibly* cause some roms to fail to boot up next time (CM6.0)
Finding #2:
Here's my simplified bootubuntu script, there are minor changes to script flow and removed all unnecessary statements:
#-------------------------------
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
echo "SETTING VARIABLES"
export bin=/system/bin
export mnt=/data/local/ubuntu
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
if [ ! -d /data/local/ubuntu ]
then
mkdir /data/local/ubuntu
fi
echo "SETTING UP LOOP DEVICE"
losetup /dev/block/loop1 /sdcard/ubuntu/ubuntu.img
echo "MOUNTING"
mount -t ext2 /dev/block/loop1 /data/local/ubuntu
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
echo "SETTING UP NETWORK"
sysctl -w net.ipv4.ip_forward=1
echo "nameserver 208.67.222.222" > $mnt/etc/resolv.conf
echo "nameserver 208.67.220.220" >> $mnt/etc/resolv.conf
echo "127.0.0.1 localhost" > $mnt/etc/hosts
echo "Brought to you by NexusOneHacks.net and the open source community! "
chroot $mnt /bin/bash
echo "UMOUNTING"
umount -lfr $mnt/dev/pts
umount -lfr $mnt/proc
umount -lfr $mnt/sys
umount -lfr $mnt
losetup -d /dev/block/loop1
#-------------------------------
and it forcibly,lazily,read-only-if-failed umount $mnt, thus losetup -d will less likely to fail and eliminate the problem when booting ubuntu second time.
Finding #3:
If terminal application is terminated automatically by Android system, in this situation, the Ubuntu is not properly umounted.
Thus we change ubuntu.sh into:
#------------------------------
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
rm -f /system/bin/bootubuntu
rm -f /system/bin/exitu
rm -r -f /data/local/ubuntu
cp -f bootubuntu /system/bin
cp -f exitu /system/bin
cd /
echo "Type 'bootubuntu' to boot Ubuntu"
#------------------------------
and we create a new script named "exitu" in sdcard/ubuntu directory:
#------------------------------
export mnt=/data/local/ubuntu
echo "UMOUNTING"
umount -lfr $mnt/dev/pts
umount -lfr $mnt/proc
umount -lfr $mnt/sys
umount -lfr $mnt
losetup -d /dev/block/loop1
#------------------------------
remember to run "sh ./ubuntu.sh" to copy new exitu script into /system/bin.
Then whenever you went back to terminal, found Ubuntu terminal is gone, simply type exitu (remember to be su first) to exit ubuntu, then bootubuntu again to enter ubuntu terminal. It's harmless to execute exitu multiple times to ensure $mnt is umounted successfully.
Sometimes exitu still can not successfully remove loop1 assignment with /sdcard/ubuntu/ubuntu.img, but seems like it doesn't really matter, ubuntu still can boot up successful even loop1 was not unassigned successfully
Finding #4:
To reduce likelihood of getting "device or resource busy" error when removing loop device assignment, it's good to have this script in your Ubuntu, and run the script before exiting from Ubuntu:
#-------------------
export USER=root
vncserver -kill :1
vncserver -kill :2
sudo reboot
sudo halt
#-------------------
(remember, the script should be in your Ubuntu's file system, not your android's file system!)
run the script before you exiting from Ubuntu, this will greatly reduce likelihood of getting device or resource busy error when exiting.
Finding #5:
For those of you who prefer to enter GNOME desktop manually (no automatically start-up), this script may help, also this script should be able to fix androidVNC keyboard mapping problem:
(this script should be in Ubuntu)
#--------------------
cd /
rm -r -f tmp
mkdir tmp
cd /
export USER=root
export XKL_XMODMAP_DISABLE=1
vncserver -geometry 800x600
#--------------------
regarding the guide:
http://nexusonehacks.net/nexus-one-hacks/how-to-install-ubuntu-on-your-nexus-oneandroid/
if you would like to enter gnome and not to autostart desktop environment, please don't follow its instruction on making change to /root/.vnc/xstartup and /root/.bashrc
instead, create a script as I mentioned above, and run the script to bring up VNC server, and you will get GNOME desktop in VNC with correct keyboard mapping
Finding #6
If you're constantly getting "device or resource busy" error when mounting loop1 to /data/local/ubuntu, the reason might be caused by Android App2SD (Froyo version), if you have any software installed on SD card, it may cause all loop devices to be busy all the time (even newly created loop device!) And busy loop device can not be mounted, thus generates "device or resource busy" error message.
Most people had the same problem few months ago, when they execute bootubuntu, they get an error saying loop device is busy, and even changing loop device wouldn't help.
Now I think the reason is determined. After uninstalled all applications which are on SD card (or move all of them from SD card to internal storage), the Ubuntu can boot successfully without getting "device or resource busy" error when mounting loop device.
Edit 2010-11-04:
If bootubuntu gets executed before Android loads all app2sd applications, it is possible solves the loop device busy error even with App2SD applications installed. It requires a very perfect timing, today after few experiments on my phone, I worked out a process which can always boot up Ubuntu on my phone:
1. Reboot phone
2. as soon as you enter lock screen, unlock screen
3. quickly go to terminal emulator
4. become su by typing su and enter
5. type bootubuntu and wait (type it fast... practice )
-------------
1-5 must be done before SD "Checking for errors" notification disappears, if you fail to do so.. reboot and try again
------------
6. as soon as SD "Checking for errors" notification disappears, hit enter IMMEDIATELY
Now you should be able to enter Ubuntu terminal.
Do NOT exit from your Android terminal (don't press back or home button), wait 1-2 minutes for Android to load applications on SD card.
Once you reboot your phone, you'll need to repeat the above procedure again to enter Ubuntu successfully.
Also chmod 4777 is horrible from a security point of view. It makes all the system bin files writable by anyone and run with root privileges (setuid root).
Sent from my Nexus One using XDA App
houzuoguo said:
Finding #6
If you're constantly getting "device or resource busy" error when mounting loop1 to /data/local/ubuntu, the reason might be caused by Android App2SD (Froyo version), if you have any software installed on SD card, it may cause all loop devices to be busy all the time, thus loop device can not be mounted to /data/local/ubuntu anymore.
Most people had the same problem few months ago, when they execute bootubuntu, they get an error saying loop device is busy, and even changing loop device wouldn't help.
Now I think the reason is determined. After uninstalled all applications which are on SD card (or move all of them from SD card to internal storage), the Ubuntu can boot successfully without getting "device or resource busy" error when mounting loop device.
Click to expand...
Click to collapse
This is because with Froyo apps to SD android creates an encrypted loopback device for each app on the SD card, so depending on the number of apps on your SD card loop0-7 may be in use. I solve this by using a high loop number with losetup - loop99.
Sent from my Nexus One using XDA App
Use a higher loop device, the best option
It worked for me on loop7, but to be on the safe side, decided to use a higher loop number as suggested, but it requires to create the loop device as it doesn't exists, use mknod:
Code:
echo "SETTING UP LOOP DEVICE"
mknod /dev/block/loop99 b 7 99
losetup /dev/block/loop99 /sdcard/ubuntu/ubuntu.img
Now is working on loop99 too!. The clean up section for both bootubuntu and exitu scripts:
Code:
echo "UMOUNTING"
umount -f $mnt/dev/pts
umount -f $mnt/proc
umount -f $mnt/sys
umount -f $mnt
losetup -d /dev/block/loop99
rm /dev/block/loop99
I'm not sure about how I am cleaning up the new node, rm erases it... but is this the best method? rebooting the phone will erase the node anyway so maybe an if clause to test for the node loop99 before creating it will be better.
fralacos said:
It worked for me on loop7, but to be on the safe side, decided to use a higher loop number as suggested, but it requires to create the loop device as it doesn't exists, use mknod:
Code:
echo "SETTING UP LOOP DEVICE"
mknod /dev/block/loop99 b 7 99
losetup /dev/block/loop99 /sdcard/ubuntu/ubuntu.img
Now is working on loop99 too!. The clean up section for both bootubuntu and exitu scripts:
Code:
echo "UMOUNTING"
umount -f $mnt/dev/pts
umount -f $mnt/proc
umount -f $mnt/sys
umount -f $mnt
losetup -d /dev/block/loop99
rm /dev/block/loop99
I'm not sure about how I am cleaning up the new node, rm erases it... but is this the best method? rebooting the phone will erase the node anyway so maybe an if clause to test for the node loop99 before creating it will be better.
Click to expand...
Click to collapse
thanks a lot
I tried this idea already but it seems doesn't work under CM6.0...
and the problem was, every newly created loop device will always be busy, if app2sd is used. (Don't know why)
I'm going to try a different approach, I try to mount loop device to /data/local/ubuntu before Android mounts all app2sd applications
mathrock said:
This is because with Froyo apps to SD android creates an encrypted loopback device for each app on the SD card, so depending on the number of apps on your SD card loop0-7 may be in use. I solve this by using a high loop number with losetup - loop99.
Sent from my Nexus One using XDA App
Click to expand...
Click to collapse
thanks.
my finding is, Android froyo app2sd uses dm-xx loop devices for sd applications, for example, now I have three games on sd card, by entering mount in terminal, i read that
/dev/block/dm-0,dm-1,dm-2 are used.
After I removed all SD applications and reboot system, all of those dm-xxx devices are not mounted anymore.
Also the only difference between mount result with app2sd and mount result without app2sd is usage of dm-xx devices.
Finally I've found solution to the "device or resource busy" error
but it seems like people are now less interested in running Ubuntu on Nexus One
the original post got more than 35k hits and more than 200 replies
Hi houzuoguo!!
I'm trying to type bootubuntu when enter in system, but i think i'm not fast enough or that not work for me. Everytime i get:
# bootubuntu
SETTING VARIABLES
SETTING UP LOOP DEVICE
losetup: /dev/block/loop1
MOUNTING
mount: mounting /dev/block/loop1 on /data/local/ubuntu failed: Device or resource busy
mount: mounting devpts on /data/local/ubuntu/dev/pts failed: No such file or directory
mount: mounting proc on /data/local/ubuntu/proc failed: No such file or directory
mount: mounting sysfs on /data/local/ubuntu/sys failed: No such file or directory
SETTING UP NETWORK
net.ipv4.ip_forward = 1
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexistent
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexistent
bootubuntu: cannot create /data/local/ubuntu/etc/hosts: directory nonexistent
Brought to you by NexusOneHacks.net and the open source community!
chroot: can't execute '/bin/bash': No such file or directory
UMOUNTING
umount: can't forcibly umount /data/local/ubuntu/dev/pts: No such file or directory
umount: can't forcibly umount /data/local/ubuntu/proc: No such file or directory
umount: can't forcibly umount /data/local/ubuntu/sys: No such file or directory
umount: can't forcibly umount /data/local/ubuntu: Invalid argument
losetup: /dev/block/loop1: Device or resource busy
#
Whats the problem then?¿?
Thanks in advance.
devex said:
Hi houzuoguo!!
I'm trying to type bootubuntu when enter in system, but i think i'm not fast enough or that not work for me. Everytime i get:
# bootubuntu
SETTING VARIABLES
SETTING UP LOOP DEVICE
losetup: /dev/block/loop1
MOUNTING
mount: mounting /dev/block/loop1 on /data/local/ubuntu failed: Device or resource busy
mount: mounting devpts on /data/local/ubuntu/dev/pts failed: No such file or directory
mount: mounting proc on /data/local/ubuntu/proc failed: No such file or directory
mount: mounting sysfs on /data/local/ubuntu/sys failed: No such file or directory
SETTING UP NETWORK
net.ipv4.ip_forward = 1
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexistent
bootubuntu: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexistent
bootubuntu: cannot create /data/local/ubuntu/etc/hosts: directory nonexistent
Brought to you by NexusOneHacks.net and the open source community!
chroot: can't execute '/bin/bash': No such file or directory
UMOUNTING
umount: can't forcibly umount /data/local/ubuntu/dev/pts: No such file or directory
umount: can't forcibly umount /data/local/ubuntu/proc: No such file or directory
umount: can't forcibly umount /data/local/ubuntu/sys: No such file or directory
umount: can't forcibly umount /data/local/ubuntu: Invalid argument
losetup: /dev/block/loop1: Device or resource busy
#
Whats the problem then?¿?
Thanks in advance.
Click to expand...
Click to collapse
I worked on that problem for few weeks and finally I discovered, once I moved all SD applications back to Internal storage, loop1 no longer be busy.
Are you using Froyo app2sd?
houzuoguo said:
thanks a lot
I tried this idea already but it seems doesn't work under CM6.0...
and the problem was, every newly created loop device will always be busy, if app2sd is used. (Don't know why)
I'm going to try a different approach, I try to mount loop device to /data/local/ubuntu before Android mounts all app2sd applications
Click to expand...
Click to collapse
Some of us are still interested in this info but ubuntu runs pretty slow on the nexus. I say it would be nice to have the newest ubuntu (10.10) installed on the nexus one. Possibly the netbook remix version.
Lou2serious said:
Some of us are still interested in this info but ubuntu runs pretty slow on the nexus. I say it would be nice to have the newest ubuntu (10.10) installed on the nexus one. Possibly the netbook remix version.
Click to expand...
Click to collapse
thanks haha, good to hear that I'm not the only one still interested in running Ubuntu on Nexus One.
I'm thinking, if Nexus Two can be overclocked to 1.4Ghz, together with top class SD card, the speed will be enough to run Ubuntu fluently.
Hi! Thanx for ur work! It helped me.....
Now i´m having another issue....i´m triying either to resize the ubuntu.img to make it bigger so i can install the stuff i want ( clean install has 100 mb left) or (preffered option) mounting my sdcard so i can install the native programs from there...any ideas?¿
I think the simple way is just to create another file bigger.
funkatiko said:
Hi! Thanx for ur work! It helped me.....
Now i´m having another issue....i´m triying either to resize the ubuntu.img to make it bigger so i can install the stuff i want ( clean install has 100 mb left) or (preffered option) mounting my sdcard so i can install the native programs from there...any ideas?¿
Click to expand...
Click to collapse
You might want to build your own rootfs - check this site out - it worked great for me.
https://wiki.ubuntu.com/ARM/RootfsFromScratch
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-hacks/how-to-install-ubuntu-on-your-nexus-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:
[email protected]:/#
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 1024×600
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 1024×600
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 [email protected], 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.
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!
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.
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.
Nice work, I am addicted in seeing the crazy crap people are doing everyday.
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.
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.
devastatorx said:
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
Click to expand...
Click to collapse
Are there any increased risks with changing the version you use?
Well, you will want to make sure that the build supports ARM based devices.
munday said:
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
Click to expand...
Click to collapse
I fixed this, the scripts were backwards, I have updated the OP to reflect the changes and bootubuntu now works
devastatorx said:
I fixed this, the scripts were backwards, I have updated the OP to reflect the changes and bootubuntu now works
Click to expand...
Click to collapse
sweet, i can't wait to get home to play more!!!
I've tried running ubuntu.sh from the terminal emulator (With su) and from ADB, and have not had success with either.
The readout is:
Code:
': File existste '/system/bin
': File existste '/system/bin
': File existste '/system/bin
: not found
: not found
cd: can't cd to /sdcard/ubuntu
: not found
: No such file or directory
: not found
cd: can't cd to /system/bin
: not found
: No such file or directory
: not found
cd: can't cd to /
: not found
: not found
Ubuntu Chroot Bootloader v0.1
Ubuntu Bootloader is now installed!
etc., etc.
Is there a problem with how I copied the script? I assume the first part about the file existing is due to this being the third or fourth time I've tried running the script (Unsuccessfully), but I've no idea how to interpret the rest.
Thanks
munday said:
sweet, i can't wait to get home to play more!!!
Click to expand...
Click to collapse
I sent you a message
Link3737 said:
I've tried running ubuntu.sh from the terminal emulator (With su) and from ADB, and have not had success with either.
The readout is:
Code:
': File existste '/system/bin
': File existste '/system/bin
': File existste '/system/bin
: not found
: not found
cd: can't cd to /sdcard/ubuntu
: not found
: No such file or directory
: not found
cd: can't cd to /system/bin
: not found
: No such file or directory
: not found
cd: can't cd to /
: not found
: not found
Ubuntu Chroot Bootloader v0.1
Ubuntu Bootloader is now installed!
etc., etc.
Is there a problem with how I copied the script? I assume the first part about the file existing is due to this being the third or fourth time I've tried running the script (Unsuccessfully), but I've no idea how to interpret the rest.
Thanks
Click to expand...
Click to collapse
Try using these, just unrar and then copy them in your ubuntu folder, if it asks to overwrite just click yes...also you have autmounting of the sd card turnned off in nook color tools settings right?
Yeah, it must have been an error on my end. Using the updated scripts you posted worked like a charm.
Thanks!
Link3737 said:
Yeah, it must have been an error on my end. Using the updated scripts you posted worked like a charm.
Thanks!
Click to expand...
Click to collapse
Good to hear!
I'm currently working on making this a port to the SD card so that with the sd card in it boots into ubuntu from power off, and with the sd card out it boots to android then you replace the sd and use it for storage like normal. It will also run a lot snappier....well that's the idea anyway.
devastatorx said:
Good to hear!
I'm currently working on making this a port to the SD card so that with the sd card in it boots into android from power off, and with the sd card out it boots to android then you replace the sd and use it for storage like normal. It will also run a lot snappier....well that's the idea anyway.
Click to expand...
Click to collapse
Booting from SD in the same fashion as Nookie Froyo? That sounds like it would give a huge performance boost over the current method, I can't wait to see what you come up with.
This should be acheivable using the method mentioned in this topic:
http://forum.xda-developers.com/showthread.php?t=873243 thanks to clockworx.
Currently looking into this
devastatorx said:
This should be acheivable using the method mentioned in this topic:
http://forum.xda-developers.com/showthread.php?t=873243 thanks to clockworx.
Currently looking into this
Click to expand...
Click to collapse
I was thinking the exact same thing, the nook seems to like booting from sd, so we should be able to set up the partitions like the foryo sd and edit the init.rc and env.txt to boot ubuntu instead of android. Just a theory though. It's my plan for tonight anyway.
munday said:
I was thinking the exact same thing, the nook seems to like booting from sd, so we should be able to set up the partitions like the foryo sd and edit the init.rc and env.txt to boot ubuntu instead of android. Just a theory though. It's my plan for tonight anyway.
Click to expand...
Click to collapse
I also stumbled across this: http://androix.org/ Which talks about a native android xserver which does a way with the vnc aspect altogether. I downloaded and attempted to install but I get the error "There is a problem parsing the package" and I haven't had any luck plus there isn't much documentation.
Let me know how it goes munday, I'll be working on the same thing later (have to take the fiance out for dinner)
question
I was just curious, after installing ubuntu can we install flash as we would had we booted linux from netbook?
Bt5 & ubuntu chroot scripts, slighly modified from att GNote version. credit goes to (i assume) msullivan
scripts
http://dl.dropbox.com/u/4109264/chroot.zip
image
BT5 https://www.box.com/s/bi2ix44bi1urufdpatjq
Or Download it from Backtrack's website.
choose BT5
Arch: arm
Image: IMG
http://www.backtrack-linux.org/downloads/
::Ubuntu image and scripts:::
http://ubuntuone.com/1Ew1232e3D51PCjYOkkQU7
http://ubuntuone.com/6majPjQf42Mplb0RZpMjIF
unzip chroot.zip into /sdcard/bt5/ on your phone
(I can't give you the bt5.img I have, it already has a bunch of my stuff in it, just download the bt5.img here, from msullivans post, and take just the bt5.img and put it in your /sdcard/bt5/ folder with that you unzipped earlier.
You should have these files in /sdcard/bt5
bt.sh
mountonly
unionfs
fsrw
bt5.img
Once your files match what's shown above open terminal and:
gain root access for terminal
Code:
su
run the script from the directory
Code:
sh /sdcard/bt5/bt.sh
or change to the dir /sdcard/bt5
Code:
cd /sdcard/bt5
and run sh bt.sh
Code:
sh bt.sh
You should see it start up, and you'll be prompted to start VNC. type Y, for yes, enter
Because our phones are awesome, we want 1280X800 on our images. So, after you have answered yes to starting VNC, we need to edit /usr/bin/startvnc file.
Code:
vi /usr/bin/startvnc
change the last line to (it should say something like vncserver -geometry 800X480)
vncserver -geometry 1280x800
At this point the easy way is restart your phone, and start up bt5 again.
then go to VNC
Nickname: BackTrack5
Password: root
Address: 127.0.0.1
Port: 5901
_______________________________________________________
TL;DR:
scripts http://dl.dropbox.com/u/4109264/chroot.zip
BT5 https://www.box.com/s/bi2ix44bi1urufdpatjq
Or Download it from Backtrack's website.
choose BT5
Arch: arm
Image: IMG
http://www.backtrack-linux.org/downloads/bt5.img
edit /usr/bin/startvnc (in chroot) to vncserver -geometry 1280x800
restart phone, run bt.sh; sh /sdcard/bt5/bt.sh, and start up VNC
It's awesome, and works great with the BT mouse/keyboard, and the extra resolution makes it feel better than the old OQO's . it's awesome
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
also, if you want ubuntu, download the ARM ubuntu.img on XDA (there are everywhere) and just drop it in the folder, rename it to bt.img. (easy way) or change the bt.sh to reflect ubuntu.img everywhere it says bt.img
very interested in this... is this BT5 regular or or is this the version 5 R1 release?
- Dan
Mine is regular bt5, not sure what the images i linked to are. My image is a year old and was used on my atrix too. But i see no reason a new image would'nt work. I'll try to post an image tonight
Any luck finding an image?
images posted. ubuntu image soon.
edounn said:
images posted. ubuntu image soon.
Click to expand...
Click to collapse
Can't wait.
Thanks uploader.
Sorry to bother you but I'm getting the following error:
$ export PATH=/data/local/bin:$PATH
$ su
# sh /sdcard/bt5/bt.sh
mkdir failed for /data/local/mnt, File exists
Loop device exists
losetup: /dev/block/loop255: No such file or directory
mount: Invalid argument
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
net.ipv4.ip_forward = 1
/sdcard/bt5/bt.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
/sdcard/bt5/bt.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
/sdcard/bt5/bt.sh: cannot create /data/local/mnt/etc/hosts: directory nonexistent
Ubuntu is configured with SSH and VNC servers that can be accessed from the IP:
eth0: No such device
chroot: can't execute '/bin/bash': No such file or directory
Shutting down BackTrack ARM
failed.
failed.
failed.
failed.
losetup: /dev/block/loop255: No such device or address
#
Any ideas?
Sent from my SGH-I717R using xda premium
dan.expo said:
chroot: can't execute '/bin/bash': No such file or directory
Shutting down BackTrack ARM
failed.
failed.
failed.
failed.
losetup: /dev/block/loop255: No such device or address
#
Any ideas?
Click to expand...
Click to collapse
do you have busybox installed? if not, do that. if so, try running it twice.
Johnsondr80 said:
Can't wait.
Thanks uploader.
Click to expand...
Click to collapse
np guy with 379px signature ;-)
Yes, I have the newest version 1.19.4 from the installer but no avail.
Sent from my SGH-I717R using xda premium
dan.expo said:
Yes, I have the newest version 1.19.4 from the installer but no avail.
Sent from my SGH-I717R using xda premium
Click to expand...
Click to collapse
looks like it doesn't like your loop back for some reason
type in your terminal:
ls -l /dev/block | grep loop
you'll get a result back that shows loop## maybe try on of those instead of loop255
Yep, I am getting the same error as dan.expo
Ya it looks like I only have loop 1-7 so I guess I need to edit the script to one of those?
Sent from my SGH-I717R using xda premium
dan.expo said:
Ya it looks like I only have loop 1-7 so I guess I need to edit the script to one of those?
Sent from my SGH-I717R using xda premium
Click to expand...
Click to collapse
make sure you have losetup -d/dev/block/looop255 in your script.
Anyone fix error yet?
Sent from the best phone in the world Galaxy Note!!!
it works fine on mine and my buddies. I'll upload the script I have once more. The ones having problems? have you flashed anything? Both the ones I have seen personally working, mine and my buddies, both are stock, rooted, normal stuff.
/mnt/sdcard/bt5 # cat bt.sh
Code:
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
export kit=/sdcard/bt5
export bin=/system/bin
export mnt=/data/local/mnt
export USER=root
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/loop255 ]; then
echo "Loop device exists"
else
busybox mknod /dev/block/loop255 b 7 255
fi
#mount -o loop,noatime -t ext2 $kit/bt5.img $mnt
losetup /dev/block/loop255 $kit/bt5.img
mount -t ext2 /dev/block/loop255 $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 "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 bt5" > $mnt/etc/hosts
echo "Ubuntu is configured with SSH and VNC servers that can be accessed from the IP:"
ifconfig eth0
echo " "
busybox chroot $mnt /bin/bash
echo "Shutting down BackTrack ARM"
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
losetup -d /dev/block/loop255
I have the overclock kernel and stock rogers rom. I managed to get the universal phone bt5 script working without issue (not optimized for the note mind you).
Sent from my SGH-I717R using xda premium
i think i changed something, and uploaded the normal one, just change the vnc file as per the instructions on the main post, and it'll be ready to go.
dan.expo said:
Sorry to bother you but I'm getting the following error:
$ export PATH=/data/local/bin:$PATH
$ su
# sh /sdcard/bt5/bt.sh
mkdir failed for /data/local/mnt, File exists
Loop device exists
losetup: /dev/block/loop255: No such file or directory
mount: Invalid argument
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
net.ipv4.ip_forward = 1
/sdcard/bt5/bt.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
/sdcard/bt5/bt.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
/sdcard/bt5/bt.sh: cannot create /data/local/mnt/etc/hosts: directory nonexistent
Ubuntu is configured with SSH and VNC servers that can be accessed from the IP:
eth0: No such device
chroot: can't execute '/bin/bash': No such file or directory
Shutting down BackTrack ARM
failed.
failed.
failed.
failed.
losetup: /dev/block/loop255: No such device or address
#
Any ideas?
Sent from my SGH-I717R using xda premium
Click to expand...
Click to collapse
check your mount
type mount and look for /dev/block/mmcblk0pXX /system something like that where XX is the number you need to change in the script file.
should look somethinig like this
mount -o remount,rw /dev/block/mmcblk0p24 /system
24 depending on what you see in your file system.
i'm on Tmobile Galaxy Note. and i was able to use this script by changing that
Build your own Ubuntu Filesystem and Run (chroot) with Android
NOTE: This is an ongoing project for me so I am not done with this post,
Everything works but obviously room for Improvement. Starting with the Mounts in script, not sure proper mounts i should use.
e.g.
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
or:
mount -t devpts none $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sys $mnt/sys
or:
mount -t dev $mnt/dev/pts
mount -t proc $mnt/proc
mount -t sysfs $mnt/sys
???
Lets get on with it.
I was having trouble with corrupted image file or ubuntu.img that i made so i tried a different method.
I kept getting input/output errors.
Using a partition on my external sdcard and Mounting it back to the external card,
to hold the file system, instead of an image file, Mounted in a Loop device.
I dont have the time to to get into detail of the steps involved, I gotta get back to work.
If you want to do this bad enough,im sure you will figure it out.
My Tools:
Ubuntu 13.10 setup on VirtualBox in Windows8 Envirement
Sdcard is class 10 64G, however i have tried class 4 16G and 16G class 10 and it worked too.
SdcardFormatter: https://www.sdcard.org/downloads/formatter_4/
Galaxy Note3 SM-N900P
First
any sdcard will do.
Now im not going to get into how to figure out the "start sector" (mine is 2048 for the particular card im using) all i can say is,
if its a "stock card", and you haven't partitioned it before, you should be ok. If your not sure use SdcardFormatter to get card back to stock.
In ubuntu find your card:
open Gparted and top right corner select: yor sdcard
Mine is sdb..
(Make sure all partitions are unmounted)
Click on first partition then select: information...It will tell you the start sector, make note.
select: last partition,
Do same for last step: if applicable for end sector.
Make sure all partitions are Unmounted
MAKE SURE WHEN YOU DO THE NEXT STEP, YOUR NOT DELETING YOUR SYSTEM
delete all partitions,
select: unnallocated space,
select: the unnallocated space,
select: new,
select: space before 0, space after, (leave space for whatever your system or image size is mine was 3.94G) so i left 4G.
select: fat32 for file system
select: ok
select: next unallocated space,
select: space before is 0 space after is 0
select: file system ext4
select: ok
MAKE SURE WHEN YOU DO THE NEXT STEP YOUR NOT DELETING YOUR SYSTEM
DONT FORMAT ANYTHING
select: apply
Check information again, check for start and end sector to see if they match the origanal settings you took note of at the begining.
If they are different, use SD Formater ^LINK^ to set sdcart back to stock setting.
Try again after you do some homework on Partitioning and formating sdcards.
Make your Image:
Install Qemu:
sudo apt-get install qemu-user-static qemu-system
sudo apt-get install debootstrap
Make dirctory:
mkdir ~/arm
Or whatever
Then make another directory:
mkdir ~/arm/ubuntu
Or whatever
Go to that directory:
cd ~/arm
Then:
Make an image...........................Pick one or make your own size:
dd if=/dev/zero of=ubuntu.img bs=8k count=524000 >...3.99
dd if=/dev/zero of=ubuntu.img bs=8k count=350000 >...2.9G
dd if=/dev/zero of=ubuntu.img bs=8k count=510000 >...3.6G...........etc.
Example: for a 4G do:
dd if=/dev/zero of=ubuntu.img bs=8k count=524000
Make Filesystem:
sudo mkfs.ext3 -F ubuntu.img
YES THATS EXT3:
Set the Filesystem checking interval:
tune2fs -c 0 ubuntu.img
Mount Filesystem:
sudo mount -o loop ubuntu.img ubuntu
Bring in Base System:
sudo debootstrap --arch armhf --foreign raring ubuntu
You can change raring for other distros, such as stable, or hoary. look in /usr/share/debootstrap/scripts
Make folders for sdcard links:
sudo mkdir ubuntu/media && sudo mkdir ubuntu/media/sdcard && sudo mkdir ubuntu/media/extSdCard
Or you can use your own sdcard settings
Copy Qemu file over to Ubuntu folder:
sudo cp /usr/bin/qemu-arm-static ubuntu/usr/bin
Run first Chroot:
LANG=C sudo chroot ubuntu /usr/bin/qemu-arm-static -cpu cortex-a9 /bin/bash
Finish Installation:
/debootstrap/debootstrap --second-stage
Exit Chroot
exit
Mount some stuff
sudo mount -t proc none ubuntu/proc/ && sudo mount -t devpts devpts ubuntu/dev/pts
Start second Croot:
sudo chroot ubuntu /usr/bin/qemu-arm-static -cpu cortex-a9 /bin/bash
Set some Variables:
export HOME=/root && export USER=root && export LC_ALL=C
Create User:
adduser [PICK A USER NAME]
Set Root Password:
passwd
Add some Groups for permissions:
groupadd -g 3001 aid_net_bt_admin && usermod -G aid_net_bt_admin -a dad && groupadd -g 3002 aid_net_bt && usermod -G aid_net_bt -a dad && groupadd -g 3003 aid_inet && usermod -G aid_inet -a dad && groupadd -g 3004 aid_net_raw && usermod -G aid_net_raw -a dad && groupadd -g 3005 aid_net_admin && usermod -G aid_net_admin -a dad && groupadd -g 3006 aid_net_bw_stats && usermod -G aid_net_bw_stats -a dad && groupadd -g 3007 aid_net_bw_acct && usermod -G aid_net_bw_acct -a dad && groupadd -g 3008 aid_net_bt_stack && usermod -G aid_net_bt_stack -a dad
For Raring...........................
echo "deb http://ports.ubuntu.com saucy main restricted universe multiverse" >> /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 428D7C01
For Quantal.........................
echo "deb http://ports.ubuntu.com quantal main restricted universe multiverse" >> /etc/apt/sources.list
For Wheezy.........................
echo "deb http://ftp.us.debian.org/debian stable main contrib non-free" >> /etc/apt/sources.list
Dont hold me to the last one you may want to double check.
Update Package Manager
apt-get update
Now you can add packages, these are some of the programs i use:
(i dont like to add all packages at once, i break them up because somtimes i notice dpkg error's when i try all at once).
apt-get install git gnupg flex bison gperf build-essential zip curl
apt-get install xfce4 xfce4-goodies
apt-get --reinstall install xfonts-base
apt-get install samba samba-common system-config-samba
Debian: apt-get install openoffice.org
Ubuntu: sudo apt-get install libreoffice
apt-get install tightvncserver streamtuner2
apt-get install xchat-gnome xchat
MAKE SURE YOU INSTALL TIGHTVNCSERVER..................Thats how you will connect to Ubuntu.........,if you want GUI.
Add permissions for sudo:
visudo
Example root ALL=(ALL:ALL) ALL
dad ALL=(ALL:ALL) ALL
(My username is dad)
Dont know if you need this or not i do it:
chmod a+rw /dev/null
chmod 1777 /tmp
To Fix SDCARD
groupadd -g 1015 sdcard-rw && usermod -a -G sdcard-rw dad && groupadd -g 1016 extSdCard-rw && usermod -a -G extSdCard-rw dad
Exit Chroot
exit
Unmount some stuff
sudo umount ubuntu/proc/ && sudo umount ubuntu/dev/pts && sudo umount ubuntu
Transfer your Image to Sdcard
Now Dump the image to Sdcard:
MAKE SURE THE EXT4 PARTITION ON SDCARD IS UNMOUNTED
My sdcard was sdb, so sdb1 would be partition 1 sdb2 would be partition 2
sudo dd if=ubuntu.img of=/dev/sdb2
...........If you notice below, it took 2.8 hrs to dump the image.
[email protected]:/media/dad/Development/arm$ sudo dd if=ubuntu.img of=/dev/sdb2
[sudo] password for dad:
8160000+0 records in
8160000+0 records out
4177920000 bytes (4.2 GB) copied, 10371.3 s, 403 kB/s
[UPDATE]
So far I have not found any problems using the copy command to transfer filesystem over to sdcard.
example:
sudo cp -rp ubuntu/* /media/dad/4920cacb-49aa-4366-8fb7-016b8e502406 (only takes 15-20min)
(Make sure your ubuntu.img is mounted in the ubuntu folder) using:
sudo mount -o loop ubuntu.img ubuntu
To Chroot it.............
With sdcard in Phone,
Connect to windows usb:
IN WINDOWS:
Open File Explorer:
Create directory "ubuntu" on root of sdcard
Copy ext4ubuntu.sh to root of sdcard (not in the ubuntu folder)
ON PHONE:
Open Terminal:
su
cd /storage/extSdCard
chmod 777 ext4ubuntu.sh
sh ./ext4ubuntu.sh
Ready to go.
Connect to Ubuntu:
Get bVNC Free from Market
In Terminal type:
login dad
vncserver :0 -geometry 960x540
Open VNC Viewer and enter:
localhost:0 for ip address
and password if you want.
Connect
Notes:
I was able to sudo cp -rp ubuntu/* /media/dad/912c45f4-b0bd-4e14-a55d-d8d9bcd4bd6a (which is the path to my sdcard), worked the second time i tried it.
( I mounted the ubuntu.img then copied all files to sdcard)
The first time i tried it i got dpkg errors.
That took only 20min to copy vrs. almost 3 hrs using dd if=
Here are some after thought I made note of, I havent tried them yet but u can, just let us know your experiances with them.
Some things you can put in a script to run after ubuntu started.
df doesn't work, there is no mtab file containing the currently mounted filesystems:
grep -Ev "rootfs|tmpfs|cgroup|mmcblk|usbfs|asec|storage" /proc/mounts | sort -r | uniq > /etc/mtab
if you can only run vncserver/Xvnc as root Try
chmod 01777 /tmp/.X11-unix
or
Fix Upstart
dpkg-divert --local --rename --add /sbin/initctl > /dev/null 2>&1
ln -s /bin/true /sbin/initctl > /dev/null 2>&1
Sources:
http://the.taoofmac.com/space/blog/2013/04/28/2330
http://whiteboard.ping.se/Android/Debian
http://linux-expert.net/?Trucs_et_astuces___Android___Tutoriel_:_Chroot_Debian
http://forum.xda-developers.com/showthread.php?t=2598481
http://gautampk.tumblr.com/post/23032189096/ubuntuonandroid-linuxshell#
BELOW IS:.....ext4ubuntu.sh
Just copy and paste into txt editor and name it ext4ubuntu.sh
Dont make too much fun of it. Im still learnen.
###################################################################Cut
echo "This will Install Ununtu ...................."
sleep .8
c=5 # seconds to wait
REWRITE="\e[25D\e[1A\e[K"
echo "Starting..."
while [ $c -gt 0 ]; do
c=$((c-1))
sleep 1
echo -e "${REWRITE}$c"
done
echo -e "${REWRITE}Done."
mount -o remount,rw /dev/block/mmcblk0p23 /system
export bin=/system/bin
export mnt=/storage/extSdCard/ubuntu
export TMPDIR=/tmp
export PATH=$bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:$PATH
export HOME=/root
export PWD=/root
export SHELL=/bin/bash
export TERM=linux
export EDITOR=/usr/bin/nano
export VISUAL=/usr/bin/vi
echo "Mounting File System..........................."
sleep .5
mount -t ext4 -o rw,noatime /dev/block/mmcblk1p2 $mnt
sleep .5
echo "Mounting and Binding Neccesary Devices..............."
sleep .5
echo ".................................DONE!.................."
sleep .5
mount -o bind /dev $mnt/dev
echo "dev"
sleep .5
mount -t devpts devpts $mnt/dev/pts
echo "devpts......................................................"
sleep .5
mount -o bind /proc $mnt/proc
echo "proc..................................................."
sleep .5
mount -o bind /sys $mnt/sys
echo "sys..............................................."
sleep .5
sysctl -w net.ipv4.ip_forward=1
echo "inet................................."
sleep .5
echo "MOUNTING SD CARDS................"
sleep .5
mount -o bind /data/media/0 $mnt/media/sdcard
echo "Card: sdcard............"
sleep .5
mount -o bind /storage/extSdCard $mnt/media/extSdCard
echo "Card: extSdCard....."
sleep .5
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 "Ubuntu Has Started "
echo "Enjoy "
echo "..."
chroot $mnt /bin/bash
echo " "
echo "Shutting down Ubuntu"
busybox umount $mnt/dev/pts
busybox umount $mnt/proc
busybox umount $mnt/sys
busybox umount $mnt
echo "...It might have Worked... "
#####################################################################END
holy crap. ok. Thanks dude
femmyade2001 said:
holy crap. ok. Thanks dude
Click to expand...
Click to collapse
Thanks
Might be a good idea to post commands between
Code:
tags
Man o man. This looks very interesting.
Any screenshots?
Sent from my SM-N900P using XDA Premium 4 mobile app
yotaking said:
Man o man. This looks very interesting.
Any screenshots?
Sent from my SM-N900P using XDA Premium 4 mobile app
Click to expand...
Click to collapse
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Homefix said:
View attachment 2637812
Click to expand...
Click to collapse
Best post of the day.
Sent from my SM-N900P using Xparent BlueTapatalk 2