Related
This tutorial is based on this one for G1: http://www.saurik.com/id/10
Hi,
I'll show you how to run debian in chroot on our optimus one. It wont affect android in any way, and they can run simultaneously, side by side. You are only running bash from debian, not its kernel or any other low-level part. But you can use debian's programs.
Requirements
* Linux on your pc or in virtual machine
You need debootstrap to make debian image, so you need debian distro (maybe in *buntu it is too, but I am not sure). You dont need GUI, bash is all you need.
* Busybox(-> rooted phone)
Most custom roms comes with busybox, I am not sure how about store ROM.
* Terminal emulator on phone and/or ADB
I suggest you to make sure you have adb, because you dont wanna write it all on small touch keyboard.
Some knowledge about linux systems
If you are following this tutorial only because you want to /flex on your friends and you dont know anything about linux, then you really _should_ stop reading this tutorial.
I also recommend you to have a2sd, so we can put debian image on its partition, when it is on sdcard main partition, it _may_ cause some problems with usb mass storage.
So, lets start.
1. Getting debian image
Boot into debian and get bootstrap tool:
Code:
apt-get install debootstrap
Now, create an empty disk image, I'd say minimum size is about 150mb, but I recommend you use more:
Code:
dd if=/dev/zero of=debian.img seek=*size_in_bytes* bs=1 count=1
You need to create ext filesystem in image with this tool(you can try it with "sudo" if you have problems):
Code:
mke2fs -F debian.img
Image is ready now, now lets mount it so we can install debian into it:
Code:
mkdir debian
mount -o loop debian.img debian
Debootstrap tool will do all the work for us. You can try to use squeeze instead of lenny or download it from your country's mirror. "--variant=minbase" argument will install just base system with apt-get and only few other packages. (This also may need sudo)
Code:
debootstrap --verbose --arch armel --foreign lenny debian http://ftp.cz.debian.org/debian
umount debian
2. Mount the image
Now, we will use ADB shell to mount the image and finish debian installation. Do not forget to write "su" before you start, we need root for this.
You need to decide where to put debian.img. I suggest you to put it on a2sd partition, which is system/sd, so :
Code:
cp /sdcard/debian.img /system/sd
export kit=/system/sd
Our mount point will be /data/local/mnt, so lets make some variable to make it easier:
Code:
export mnt=/data/local/mnt
busybox mkdir -p $mnt
We also need to set these enviroment variables, and we can also make alias for busybox so we dont have to write busybox all the time.
Code:
export PATH=/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
alias _=busybox
Now we need to create loop device for image:
Code:
_ mknod /dev/loop0 b 7 0
And if nothing went wrong, you should be able to mount image now ("mount: no /etc/mtab" is normal) :
Code:
_ mount -o loop,noatime $kit/debian.img $mnt
3. Finalizing installation of debian
With mounted image, we can proceed to second stage of debian bootstrap:
Code:
_ chroot $mnt /debootstrap/debootstrap --second-stage
If you want install some packages with apt-get, you also need to add repo to sources.list. Of course, if you downloaded squeeze instead of lenny, you need to change "lenny" to "squeeze"
Code:
echo 'deb http://ftp.cz.debian.org/debian lenny main' >$mnt/etc/apt/sources.list
Set correct DNS servers - debian can't take them from Android.
Code:
echo 'nameserver 4.2.2.2' >$mnt/etc/resolv.conf
Done, installation over.
4. Running debian bash
To get to debian bash, use this command. You can try "cat /etc/issue.net" or "uname -a" so you can see its really debian.
Code:
_ chroot $mnt /bin/bash
But its not all yet, you need to mount some things for debian:
Code:
mount -t devpts devpts /dev/pts
mount -t proc proc /proc
mount -t sysfs sysfs /sys
Now link mtab to /proc/mounts. You need to do this only once.
Code:
rm -f /etc/mtab
ln -s /proc/mounts /etc/mtab
And if you want to use ssh server to log in into debian, you also should set root pass:
Code:
passwd root
5. Installing packages
First, you need to update packages list:
Code:
apt-get update
and now you can install whatever you want with "apt-get install"!
6. Finishing
I suggest you to write some .sh script so you can mount it all with one command, for example something like this: http://pastebin.com/VT6272d5
What packages have you tested?
sshd - works great, you can connect to phone via putty or ssh
mc - works, but phone screen is to small
gcc-avr - if you are programming for avr microcontrollers, you can compile it on your phone
netcat - telnet connection
git-core - works great
htop - you can see this on screnshot below
apache2 - works like a charm
xfce4, Xorg server and tightvncserver - working but slow, see screenshots
gnash - working but slow, see screenshots. This is the only option how to run flash content on optimus one xD
Iceweasel - if you are using vnc server, you can browse web pages
gcc, g++, autoreconf, cmake and whatever else is needed to build mangos - working
mysql-server - you have to set "user = root" in /etc/mysql/my.conf, but works
MaNGOS - http://getmangos.com/ takes long to build, but works! See this post and also this one.
..and maybe some more which I dont remember.
Hope this tutorial helped you
I'll try bootstrapping debian when I figure out what the hell is wrong with my system. I can't download files from ftp (but I can with wget and other progs. just not with pacman, debootstrap, and the like).
debian on optimus v
searched around to avoid multiple posts, and found this.
I've been running chroot debian on my V as well, squeeze then sid now going back to squeeze.
the main problem I've encountered was in the "debootstrap --second-stage", which generally froze at "I: configuring sysvinit". I thought that was from overloading the CPU, but turns out android init doesn't create /dev/initctl like debian does, so debootstrap hangs waiting for a response reading/writing /dev/initctl
I didn't have that issue using SL4A's shell instead of android terminal.
being a bit of a 'noid, I have used "mknod /dev/initctl p" in the chroot before running "debootstrap --second-stage" since reading of that solution. not sure if it's making much difference, because that didn't fix the issue before I found SL4A and was still using android terminal for shell functions.
I like xfce4 as a window manager in the VNC, it's small but still functional.
I did a bit of things different than saurik, but used his guide extensively, along with much googling for other deb->droid ports.
my chroot runs in the android root directory with bind-mounts since the custom kernel I like doesn't include unionfs. I also directly use an ext4 2nd partition on the SD rather than a loop-mounted filesystem image. (yes, ext4 journals will eventually frag my SD but the cost of another is worth the crash-resistance to me.)
my short-term goal is to mix inits between the two os's and run X through an android app frontend to avoid the framebuffer copy lag from the VNC. my 3 main reasons for debian on the phone are program development (works currently,) flash (actually gnash, and needs a working full-speed access to framebuffer, not working yet,) and emulators for J2ME and MAME (same boat as flash.)
so far trying to run X directly blanks my screen and forces a battery pull to get it back, so kinda giving up that route for the moment.
so installing Archlinux on O1 must be possible? how?
pymebrahimi said:
so installing Archlinux on O1 must be possible? how?
Click to expand...
Click to collapse
All must work, as long as they support running on ARM. AFAIK Arch doesn't have an (official) ARM port. You can try Arch Mobile though
This command fails me
Code:
_ mount -o loop,noatime $kit/debian.img $mnt
The error I get is no device or file exists.
Tried creating more number of loop devises too. Still it didn't work. I am using cyanogemmod 2.3.3 ROM.
onehomelist said:
This command fails me
Code:
_ mount -o loop,noatime $kit/debian.img $mnt
The error I get is no device or file exists.
Tried creating more number of loop devises too. Still it didn't work. I am using cyanogemmod 2.3.3 ROM.
Click to expand...
Click to collapse
What is the exact wording of the error?
The exact error that I get:
Code:
# busybox mknod /dev/loop0 b 7 0
# busybox mount -o loop,noatime $kit/debian.img $mnt
mount: can't setup loop device: No such file or directory
Instead of using $kit/debian.img, try manually pointing to the debian image.
For example, if you have it on the sdcard's debian folder:
Code:
/sdcard/debian/debian.img
That too didn't work.
make sure that debian image is where it should be. Also try to "ls /dev/" and look for loop0 - i had some problems with loop devices on mik's 2.3, but I did not really solved it, because I went back to froyo after while.
The loop0 device exists is /dev. As you have experienced same issue on the same ROM, I am convinced that its a ROM issue.
I just tried to install xorg, xfce4 & tightvncserver - everything work just fine, although its kinda slow
ext partition instead of loop filesystem
Tasssadar said:
I just tried to install xorg, xfce4 & tightvncserver - everything work just fine, although its kinda slow
Click to expand...
Click to collapse
I think it runs faster from a sdcard partition than a loop filesystem, if I remember right. I tested a loop-mounted preconstructed debian img from some tutorial for another device before debootstrapping my own.
partition your card with a second partition, ext2 if you're worried about journalling wearing out your sd, or ext4 if you're more worried about corrupting your precious debian filesystem in a crash or unclean umount. gparted in ubuntu seemed to work well for me.
resize your ntfs partition instead of deleting it or android may complain.
with your debian img mounted as a loop filesystem on a linux box at the same time as your new partition, you can copy everything from the img to the ext partition by:
Code:
cp -av /path/to/loopmountedimg/* /path/to/extpartition
if you replace the loop-mounting code in your boot script with a vold mount of your ext partition, android is supposed to umount the partition cleanly on powerdown or reboot.
on my optimus v, the mount looks like the following in my boot script (I'm posting the comments too for info)
# mount 2nd sdcard partition from vold, should prevent dirty unmount at reboot
# if your linux is on a different partition than 2, substitute that number for the 2 in .../vold/179:2 below
# first unmount it; if not already mounted, system will echo 'umount: can't forcibly umount /dev/block/vold/179:2: Invalid argument' but this isn't an error to worry about
Code:
umount -l /dev/block/vold/179:2
mount -o noatime,exec,suid /dev/block/vold/179:2 /$mnt
maybe someone here can use this info.
also, for anyone who wants to save some hours and bandwidth, I have a basic squeeze debootstrap uploaded to 4shared.
it shouldn't be missing any of the readme's or licensing docs, so it should be GPL ok AFAIK.
resolv.conf and sources.list are already configured for 3g access and the main Debian repository, so it's pretty much plug-n-play.
no extra packages. you'll need to apt-get tightvncserver and a window manager unless you just want the bash shell.
the first time you chroot in, you should use passwd to set a root password, and adduser to get a non-root account on there.
the only glitch is that I accidentally tar'd it into a compressed folder; so you can't just untar it into the ext partition, it needs unpacked with an archive manager. sorry!
here is the filesystem image
uncompressed, 9645 items, totalling 264.3 MB
compressed, 116.3 MB (121929580 Bytes)
Tried to put it on ext2 partition without image, its a bit faster but still very slow.
But i took some screenshots this time. You can see flash (well, gnash) player on optimus one working on last screenshot
And I have one question: is debian using its own libc or android's bionic?
Tasssadar said:
Tried to put it on ext2 partition without image, its a bit faster but still very slow.
Click to expand...
Click to collapse
guess I'm biased, first linux I used was on a 100MHz pentium 1, so this handheld flies by comparison.
But i took some screenshots this time. You can see flash (well, gnash) player on optimus one working on last screenshot
Click to expand...
Click to collapse
I could only get gnash to play ads. boo. froze up iceweasel every time I tried to open a flash video. what browser are you using? oh, man, it's iceweasel, isn't it?? also, chromium just refused to start on my optimus.
And I have one question: is debian using its own libc or android's bionic?
Click to expand...
Click to collapse
pretty sure it's standard debian libc. you could integrate the android toolchain if you were so motivated, probably.
bigsupersquid said:
I could only get gnash to play ads. boo. froze up iceweasel every time I tried to open a flash video. what browser are you using? oh, man, it's iceweasel, isn't it?? also, chromium just refused to start on my optimus.
Click to expand...
Click to collapse
Chromium does not work for me, too.
Well, it froze for me too, but after while it at least got to show what you see on the screenshot
bigsupersquid said:
pretty sure it's standard debian libc. you could integrate the android toolchain if you were so motivated, probably.
Click to expand...
Click to collapse
I was just thinking if this is possible, then normal android aplication could have libc included, if its needed.
Do you know MaNGOS? It is open-source server for World of Warcraft (for more info go to http://getmangos.com/). I just compiled it and I run it on my optimus one. And guess what - without world db, its really fast! I am extracting UDB to database right now, I will post some screenshots and results with full-featured db soon.
And thats why I love linux and android
I got no words to describe my eyes when reading that at the moment.
So, what you might wanna know if you wanna try it too:
All packages needed for mangos to compile are working good, except for mysql server: you need to set "user = root" in my.cnf - it is located in /etc/mysql/ - because you cant put any root rights to any other user than root, so mysql user cant create tcp socket.
You will most likely need swap file - optimus has plenty of RAM, but yet not enough. All you need is to compile kernel with CONFIG_SWAP=y and follow this tutorial: http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/. 512mb swap is enough. Just for the record, swap is working on optimus one, I think nobody tried it here yet.
Now as for the compilation of mangos, it is mostly working as it is, only problems are intel tbb library and g3dlite library.
TBB is not available for arm yet, so you need to compile without it. Use -DUSE_STD_MALLOC=0 in cmake line.
As for the g3dlite, things are little bit more tricky - you need it, and there are some asm() instructions in it, which are different for arm. I only commented them, because I dont know assembler: https://github.com/Tasssadar/mangos-arm/commit/67c442fa0c10e82b282b83a8fe485588f8786e12
I have no idea how it can even work without all that code in g3dlite, but it just does.
You can use scriptdev2 from its git, theres no problem in it.
Thats all, after that just "make" and get something good to read, because it will take really long. At least 5 hours for compilation and nearly hour and a half for linking of scriptdev2 and mangosd binary.
Creating of databases is just like on normal pc, so I just skip it...same goes for dbc files, maps and vmaps.
Loading of mangos takes around 4 minutes with full-featured db. mangos then takes around 180mb of ram and cpu usage is...surprisingly low, considering the fact that our cpu does not have hw float operations. I tried to clear Azjol Nerub instance (well, solo with gm character) and maximal cpu usage was 60%, when fighting a boss with lots of spawns. I could imagine some 5-man dungeon run would be just fine
Also, you will get slight lag when moving into new location, when phone loads map files from sdcard.
Thats all, see screenshots
Problem:
I've worked with every available distribution of Linux, trying to get the damn thing working on my phone. Troubleshooting the ***t out of it, and no deal. Constant errors/files not found etc. So, rather than post my logs and ask for help troubleshooting them (as I've obviously been unable to do), I thought I'd just ask:
Does anybody have a Linux build (besides android!) working on their phone that's running Gingerbread or ICS? If yes, can you post your software specs?
Here are mine currently:
Busybox- v1.19.3-Stericson in /system/xbin
Firmware Version- 2.3.5
Baseband Version- T959VUVKG6
Kernel- 2.6.35.7-T959VUVKI3-CL611444
Build Number- Gingerbread.VUVKI3
Mod Version- Octaine Team Acid
Thanks, this has been a pain in my **s for too long now!
S
I had both Fedora and Ubuntu working on Froyo at one point through lots of modifying and editing of the scripts.
What do you need them for anyway? I think it's more of a hassle to set them up than it's worth.
Well, I am working quite a bit now with linux for servers and such, and it's good to have a system (even minimal) that I can use/reference, plus it helps me get better at it.
Get this: I was so frustrated that I went back to BlackIce (keeping my gb bootloaders) and the damn thing loads right up, ubuntu 11.04, no problem. So, I then loaded up Valhalla's GB build and, sure enough, that works too. So, going with my luck I load octane 2.x GB which i've been digging of late and no deal, ubuntu just won't load.
Now, trying the same trick I cannot get it to work. It just won't load now when I SH it. Here's the instructions that worked before (and I've tried them all!):
http://www.nerd65536.com/2011/07/installing-ubuntu-in-android-version-2.html
Also, I hard bricked again (corrupted bootloaders from a Parallels Windows stallout) but did Adam's UnBrickable Mod and that's all better. Everybody needs to check it out, it's awesome:
http://forum.xda-developers.com/showthread.php?t=1333424
So FBI, any idea why linux is so temperamental? Once it SH's properly, it always works.
(Thanks to all the developers for their great roms!)
Yeah I noticed that slight changes from different ROMs based on the same kernel base had that effect too. I'm thinking it had to do something with the busybox installations since I had to edit the script sometimes. For some reason on some installs running mount won't work unless you use it as busybox mount. It was very iffy like that. I haven't even tried it again because of how frustrating it is to get even a boot. The other thing is that if you try to do a shutdown from ubutu/fedora it doesn't even kill the processes all the way so the only way you can clear some ram up with with a reboot.
Yeah man, I was figuring Busybox myself. I've tried old installs, new installs, xbin only, bin only, xbin & bin, etc. It's so frustrating because I can't figure it out. When it was working it was great, pretty stable.
So the first problem always lists as:
Remounting /system rw...
Mount: no such file or directory
Usage: mount [-r] [-w] etc, etc
So does this tell us that the system is not mounted rw? I used the Mount/system r/w application, but I cannot verify it's doing it's job. Everything is rooted properly, CWM also.
In Terminal on the phone I ran:
"mount | grep system"
which gave me
"/dev/block/st19 on /system type ext4 (rw,relatime,barrier=0,data=writeback)"
which leads me to believe the system is r/w.
I'm converting the system back from ext4 using CWM Voodoo to disable Lagfix and system Lagfix to see if this has any effect. Will report.
No deal. Didn't do a damn thing. I'm going to crack this if it's the last thing I do....
I'm using Better Terminal Pro, Bash shell, and under command line in options it lists the Shell as: /system/bin/sh-
The sh install.sh also tells me:
"Mounting: Loopback mount
mknod: /dev/block/loop254: File exists"
Does this mean that all (255) of my loops are used? Do I need to remove programs?
The available loop device thing never got resolved. Nameless originally fixed it by making it use 254 so that there was a low chance of the loop device being available, but the phone's OS is very iffy about letting a new loop device get assigned to a system image file. Can't really help you out since I never got it to consistently mount with different roms.
Linux on SGS4G Working! Done and Done!
Figured it out.
I can get Ubuntu 11.04, 11.10 & Debian 6 to mount repeatedly in all sorts of ui updatable configurations using this information:
http://www.nerd65536.com/2011/07/installing-ubuntu-in-android-version-2.html
It's a friggin Christmas Miracle! Can't tell you how much time I've wasted working this out, and it all boils down to the sh and run scripts.
So, without further ado, here goes.
!!Make sure you're rooted!!
!!The quotes just tell you what to type. Don't type them!!
1.
Download one of the three builds on the website listed above (or build your own, it should work fine). Extract it from tar.bz2, they should all extract to a linux file, this includes the necessary scripts. Put it on the sd-card on your phone.
2.
Download the new scripts that (Nerd) listed found here: http://ohm.nerd65536.com/android-linux/scripts-latest.tar.bz2
And extract them. You'll have another file that says linux. Open it, take the three files inside (install.sh, root-scripts & scripts) and paste them in the linux folder you moved to your sd-card. They will overwrite the ones currently there. These scripts work for sgs4g, the originals did not.
3.
Install the latest BusyBox in xbin if it's not already installed (must be rooted). Latest is 1.19.3
4.
Download a terminal client, like Better Terminal Emulator or Android Terminal Emulator. I use the first. The terminal needs to run the commands as root, especially the linux vnc command as it didn't want to work for me no matter if I started by typing su. Better Terminal Emulator has a check box to always start in root.
5.
Open up your terminal emulator and type su if you are not rooted there. Then change directory to the linux file on the sd-card. run the sh file there.
Like this:
"su"
"cd /sdcard/linux"
"sh install.sh"
If it works, the resulting dialog in terminal won't throw up any problems.
6.
Get back to / on sd by typing in terminal:
"cd /"
You should then have a: / # prompt, which means you are still rooted.
Enter:
"linux"
Which should result in a: [email protected]:/#
This means Linux is running. Congratulations. It should continue to run unless you shut down your phone.
7.
Download a VNC client, like Android VNC Viewer (free) or Remote VNC Pro, which I use. Add a new entry in it, with the following settings:
Host: localhost
Port: 5901
Password: cheesecake
Color: 24-bit
Name: Linux
When that's done save if you can or back out if you can't, and go back to your terminal emulator.
8.
It should still say: [email protected]:/#
If it doesn't, fine, if it does, just go back to root prompt by typing:
"exit"
Which should get you: / #. Then type:
"linux vnc"
Which should run itself and mount the chroot environment. It should tell you your new 'X' desktop is localhost:1, and have a: / # prompt again.
It might also ask you for a password, if so then put whatever password you'll remember in that's longer than 6 characters and verify it. This only happens once.
9.
Go back to your VNC client and if you entered a password in step 8. then edit your listing to your password instead of cheesecake, if not then don't.
Click on the Linux link and BAM! (shameless Emerilism), you're at your Linux desktop which should be running a iceWM desktop interface, which is fast. The LXDE desktop is nicer and if you want that then go into you're terminal and get into the linux shell by typing:
"linux"
And then switch to LXDE by typing:
"apt-get autoremove icewm- lxde+"
Which will run through the removal/ installation, and verify you want to download the <400mb files. Type:
"y"
And give it time to finish. When finished, just go back to your VNC client and hit Linux again, and you will have a nice looking functional desktop, with a cpu load graph on the bottom. I tried using Gnome desktop and Unity 2d, but both of these would install and not fully run with all options. They are heavier and slower, but cool non-the-less. Let me know if anyone has luck with these on Android.
Notes-
You only have to type "linux vnc" once in terminal to start linux every time you boot your phone. Otherwise, just open your VNC client and click on Linux to use it. Easy!
You will want to update and upgrade your linux after install, do so by typing in terminal:
"apt-get update"
"apt-get upgrade"
Also, you might run across a problem if you try to add-apt-repository, that's because that python command is not present. To use it, enable by typing:
"apt-get install python-software-properties"
Also of note, the downloadable linux builds are sized to about 2.15gig on your sd, which is big enough for most. There is a way to resize them which I tried but it gave me trouble in loading. I will try again and see if I can get it to work.
Here's the link from Dangermouse:
http://www.androidfanatic.com/community-forums.html?func=view&catid=9&id=1610
Thanks to Nerd65536 for the info, write-up and files. He fixed my problem.
sconsylman said:
Also of note, the downloadable linux builds are sized to about 2.15gig on your sd, which is big enough for most. There is a way to resize them which I tried but it gave me trouble in loading. I will try again and see if I can get it to work.
Here's the link from Dangermouse:
Click to expand...
Click to collapse
You're welcome.
It's actually a lot easier than that to make the image larger. Just pop the SD card into a Linux machine and:
(Assuming the original file is: /media/phone/linux/linux.img)
Code:
resize2fs /media/phone/linux/linux.img 4095M
And you're done. resize2fs is made of magic!
Note: Most SD cards are FAT32, which has a filesize limit of 4GiB. The above instructions will make the file a megabyte less than that.
nerd65536:
Thanks! Worked like a charm. Had to e2fsck -f /media/SDCARD/linux/linux.img (phone plugged in to Mint) before i did it to check over the file system, but then it ran immediately. Much appreciated.
Have you had any luck on native boot? I've been working a little on this, as I can't run BackTrack arm well virtually, it gets buggy. Granted the telephony systems won't work during, but the functionality should be pretty good if we could run it standard.
Also, while I'm thinking of it, is it possible to run the img from an ext4 partition on the card? I have an existing one being used for link2sd files and would much prefer using it as it's a far superior file system to fat32, without the 4G limits. Vnc should have no problem graphically, but would the linux.img chroot properly?
It would probably work but you would have to alter the script to mount the other partition if it doesn't do it automatically and change the path. Shouldn't be too hard.
I'm getting an error when I try running sh install.sh:
Code:
# sh install.sh
readlink: applet not found
Remounting /system rw ...
sh: Can't open /linux/scripts/fsrw
Installing scripts in /system/bin ...
cd: can't cd to /linux/scripts
cp: write error: No space left on device
cp: omitting directory 'root-scripts'
Unable to chmod /system/bin/root-scripts: No such file or directory
cp: omitting directory 'scripts'
Unable to chmod /system/bin/scripts: No such file or directory
cp: omitting directory 'tmp'
Unable to chmod /system/bin/tmp: No such file or directory
Mounting the Linux image ...
install.sh: /system/bin/linux: not found
Customizing the image ...
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
Installing root-scripts ...
mkdir failed for /data/local/mnt/root/scripts, No such file or directory
Unable to chmod /data/local/mnt/root/scripts: No such file or directory
cp: can't stat '/linux/root-scripts/*': No such file or directory
Unable to chmod /data/local/mnt/root/scripts/*: No such file or directory
Install finished
# linux
linux: not found
NuVanDibe said:
I'm getting an error when I try running sh install.sh:
Code:
# sh install.sh
readlink: applet not found
Remounting /system rw ...
sh: Can't open /linux/scripts/fsrw
Installing scripts in /system/bin ...
cd: can't cd to /linux/scripts
cp: write error: No space left on device
cp: omitting directory 'root-scripts'
Unable to chmod /system/bin/root-scripts: No such file or directory
cp: omitting directory 'scripts'
Unable to chmod /system/bin/scripts: No such file or directory
cp: omitting directory 'tmp'
Unable to chmod /system/bin/tmp: No such file or directory
Mounting the Linux image ...
install.sh: /system/bin/linux: not found
Customizing the image ...
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
Installing root-scripts ...
mkdir failed for /data/local/mnt/root/scripts, No such file or directory
Unable to chmod /data/local/mnt/root/scripts: No such file or directory
cp: can't stat '/linux/root-scripts/*': No such file or directory
Unable to chmod /data/local/mnt/root/scripts/*: No such file or directory
Install finished
# linux
linux: not found
Click to expand...
Click to collapse
cp: write-error.. no space left on device? You need more space dude
Yes, it is possible to use Debian (or any other ARM based distribution) binaries instead of busybox. These devices have plenty of horsepower, and a fair amount of space on them. There should be enough room to get proper versions of command line apps baked in
NOTE: This is a PROOF OF CONCEPT. Do not attempt unless you are familiar with linux, chroot, and are fine with potentially screwing up your phone!
Frankly, I got tired of the limited feature set and compatibility issues that come with busybox. So, I decided to see if I could come up with something better... all it took was a free app from the market, 4 GB carved out of my SD card, and a little bit of time.
I've played a bit with chroot (mostly using the "Linux Installer" app):
https://market.android.com/details?id=com.galoula.LinuxInstall&hl=en
My SD card has a 4GB SD-EXT partition on it, formatted as EXT4, and then a FAT32 partition. I have my phone set up to never unmount the SD-EXT partition. And, since I'm using ICS, it's not using that partition for anything yet anyways.
In any case, to save a whole lot of trouble and deal with potential corruption issues, I set up the linux chroot to use a folder instead of an image. This turned out to be handy, because I can access files and play around with bind mounts much more easily than I can with an image file.
Right now I've got Debian Stable installed using chroot to my SD-EXT partition. After getting to a Debian prompt, I updated apt:
apt-get update
apt-get install build-essential
Now we have a fully working GCC environment to use. However, the environment that Linux Installer provides comes with most tools already at your disposal.
Now what? I don't want to have to chroot to use these utilities. That's a waste of my time
Here, we have two options... one is somewhat easy, and one is really easy.
These are not statically compiled applications, so we do need a few libraries. To replicate the functionality of busybox (and so much more), you really only need about 15 of them.
---------------------- THE REALLY EASY WAY ----------------------
The really easy way to do this is to bind mount the following folders from the "chroot" (in my case it's /sd-ext/linux) to the root of the android device:
/bin
/lib
/usr
/sbin
I'm writing this from memory, but I believe (off the top of my head) the proper command is:
busybox mount -o bind,rw /sd-ext/linux/bin /bin
busybox mount -o bind,rw /sd-ext/linux/lib /lib
busybox mount -o bind,rw /sd-ext/linux/usr /usr
busybox mount -o bind,rw /sd-ext/linux/sbin /sbin
Please correct me if I'm wrong (and this is assuming that your chroot environment is in /sd-ext/linux
On some devices, /bin and /sbin already exist. Deal with that however you want.
Now, all you have to do is:
EXPORT PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/sbin
If you've done it properly, you can shut down your chroot environment, go to /bin, and run ./ping 8.8.8.8
If it doesn't work, you screwed up somewhere (or I did!).
---------------------- THE SOMEWHAT EASY WAY ----------------------
On the android side, make the following folder structure:
/bin
/lib
/sbin
/usr
/usr/bin
/usr/lib
/usr/local/bin
Also, set your path so you can actually use the programs:
EXPORT PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/sbin
Now, let's say we want to have Debian's version of 'ping' without having to chroot. Do the following:
Pop into your chroot environment, head into the /bin folder, and run the following command:
ldd /bin/ping
This will tell you what shared libraries ping uses. In my case, it uses:
/lib/libgcc_s.so.1
/lib/libc.so.6
/lib/ld-linux.so.3
Pop back over to the android side, and run the following commands (assuming that /sd-ext/linux is your chroot environment, and adjusting as necessary for the libraries that are actually used by the program you are attempting to make work)
cp /sd-ext/linux/bin/ping /bin
cp /sd-ext/linux/lib/libgcc_s.so.1 /lib
cp /sd-ext/linux/lib/libc.so.6 /lib
cp /sd-ext/linux/lib/ld-linux.so.3 /lib
Now type:
/bin/ping
You will get either get an error message about a shared library, command not found, or (if you're lucky) the Debian version of ping.
If you're not so lucky, i'd suggest copying over /usr/bin/ldd from the debian side and using it to figure out (on the android side) which libraries you're missing.
***HUGE NOTE***: Remember that folder structure we're using? It will disappear when you reboot your phone, so back it up! I would actually recommend using bind mounts and a shell script to have a more "persistent" folder structure, but that's just me...
Like I said, there's really only about 15 shared libraries or so that are needed to give us a plethora of applications at our disposal. I'll give up a bit of my phone's system space to be able to drop to a proper bash command line and pull up nano, use the full and complete version of tar, gzip, or whatever utility I want.
As I'm still playing with this, I don't have a test package or anything to put up. This is more of a proof of concept idea (that I've already partially implemented on my phone).
Also, GCC can get you a long way Since we're compiling on-device, there is no cross-compiler necessary. Inside of the chroot, I compiled patchELF
http://nixos.org/patchelf.html
I thought that utility might come in handy. Compiles slowly (this is a phone we're compiling on), but it works great.
The next step is to see if I can bake it in...
Hey all, This is my first post on the forum, so I thought I'd make it a guide.
I've run into a few roadblocks with installing some development tools like python and stuff, so I figured I'd try and make a filesystem image to hold all of it, what with Android preventing executables on your SD card from actually executing. You should NOT try and use this for freeing up space by moving apps to it. That just breaks things.
Things to know
A mount point is where you access the contents of a filesystem through.
A filesystem is basically a virtual disk.
I'm not responsible for your phone melting into a pool of acid or anything else you want to blame me for. You executed the commands, not me.
If there's been guides for this already, I didn't find them.
Playing with your system files is dangerous. Be careful
Playing with filesystems is even MORE dangerous. Don't do it unless you know what's going on.
Reversing and then combining two words in a sentence, then calling it a bit more dangerous is incredibly dangerous and can kill you. Don't do it.
As I said earlier: This is not intended to free up internal storage on your phone. It is intended to create extra space to put command-line executables.
This was created for those of us who have older phones that don't have a whole lot of internal storage. (Like the Milestone) This should also work on anything that meets the requirements listed below. I use it on a Motorola Milestone A853 running CyanogenMod 7.2.4f UMTS/SHOLES, and it took some tweaking, but it worked. Commands you put into your shell are marked with `bolded text and surrounded by back-ticks. Leave the back-ticks out. (`)`
Requirements! (obtained using `which <command name>` or a specified command)
Free space on your mSD
losetup (configuring loop devices)
mknod (creating loop devices)
mount (mounting filesystems)
mkdir (making directories)
su (root access)
umount (unmounting)
mke2fs (formatting)
Linux filesystem support (`cat /proc/filesystems | grep ext`)
Here we go!
This assumes you are going to use an ext4-formatted filesystem image mounted on /data/development/, with the image located at /mnt/sdcard/development.img. You WILL need to determine your phone's supported ext<num> filesystems using `cat /proc/filesystems | grep ext`. Choose the highest-numbered one.
Create the mountpoint, the image, and then format the image to ext4.
`mkdir /data/development/``dd if=/dev/zero of=/mnt/sdcard/development.img count=409600 bs=1024``mke2fs -l /mnt/sdcard/development.img -b 1024 -t ext4`
Create the block device, set it to point at the image, then mount it.
`mknod /dev/block/loop250 b 7 250``losetup /dev/block/loop250 /mnt/sdcard/development.img``mount -t ext4 /dev/block/loop250 /data/development`
Test it to see if it works.
`touch /data/development/testfile;ls /data/development/`
Use it.
Unmounting (/!\ For connecting to a computer to avoid corruption /!\)
`umount /mnt/sdcard/development.img``losetup -d /dev/block/loop250`
Well, that's all I've got. Suggestions and corrections, as well as good feedback are appreciated.
Some PAQs (Possibly Asked Questions)
Q: I'm getting some errors. Here they are: pastebin.com/some-errors
A: Great, I'll see what I did wrong, and if it's something on your end, I'll try and help you out.
Q: It dun werk
A: Tell me the errors instead of complaining about them. Just saying that does not help me and wastes my time and bandwidth.
Q: "No space left on device"; "Operation not permitted"; "No such file or directory"
A: SD card full; not root (or SD card is full, or something broke); Mount point doesn't exist or (if 'mount' returns that and the point exists) something not cool happened.
Usage guide on Non-Android devices
Some interesting bits of information for use on computers:
There's probably not an easy way to read/write/mount EXT2 filesystems on a Windows machine, so if you have a solution that's stable, go for it.
Linux computers definitely should support this, and I'm not sure about OSX computers, but in theory would work if you had the right things installed. iPhones ... well I have no idea what you'd do with it there.
Linux:
On the device:
THIS PART IS EXTREMELY IMPORTANT, NOT DOING THIS WILL RESULT IN BROKEN FILESYSTEMS!
`umount /mnt/sdcard/development.img`
`losetup -d /dev/block/loop250`Plug your phone into your computer, making sure that the computer mounts it and reads it as removable media, and that the image is present.
On the computer: (Path of your user folder, and the mount point at which your device's SD is mounted can and very likely will vary from distribution to distribution. Check your paths.)
`mkdir /home/user/android-devtools/`
`mount -o loop /media/user/android-sd/development.img /home/user/android-devtools/`Now, you can change things within the image as you normally would a file or folder. Be warned, sometimes doing this can create conflicts in the file permissions, so running the right commands on the phone to change the permissions as root (use `chmod` for the permissions) can save you boatloads of trouble getting things to work, or editing files.
Mac OSX might or might not be the same, but seeing as I haven't picked up an Apple computer since maybe 5 years ago, let alone attempted filesystem management, I just don't know.
Hello friends! I'm a year long follower of the LinuxOnAndroid project. I have always wanted to install ubuntu on my sdcard instead of using image files. I waited a long time for an instruction to crop up somewhere on the internet about how to do this, and in the meantime, learnt a lot of things. Then I decided to experiment with the idea a few days ago and also managed to get satisfying results. There was a significant performance boost compared to using a linux image.
While writing this tutorial, I have assumed that you are already quite familiar with the LOA project and that you have already managed to run a linux distro on your android device.
Please note that while this tutorial aims to be applicable for all distros released under the LOA project, I have only run Ubuntu 12.04 small, Ubuntu 13.10 small and Debian small images. I have never had any experience with the other distros. But I'm pretty confident that the instructions can be applied to other distros without any problem. If you encounter any problem while applying the instructions for your device and distro, I'm willing to help you as much as I can.
Warning: I've never bricked my android devices while rooting, modding or hacking them and I hope you will be as lucky. But please remember that I will not be held responsible for any damage or losses suffered by you or your devices while following the instructions given in this tutorial. You will do so at your own risk.
Let's begin.
First of all, Things You'll Need:
Root access on your android device
Busybox
An sdcard of optimum storage capacity. You decide what's optimum for your case. I have a 16GB card with a 4GB partition for ubuntu small image.
Init.d script support for auto-mounting second sdcard partition on boot. You can skip this if you want to mount the second partition only when booting up linux.
Attached zip containing bootscript.sh and 03ubuntu files.
Step 1: Partitioning the sdcard
WARNING: This will erase all data on your sdcard!
Use MiniTool Partition Wizard for windows, gParted for linux or aParted for Android to create the two partitions on your sdcard. I reccomend that you do the partitioning on your PC. Note that you cannot partition your sdcard by connecting your device to your PC my USB. You need to use a card reader. If you have a USB modem with built in card reader, you can use that too.
The first partition will be used by your android device for mass storage. Make it FAT32 or exFAT or vFAT. Note that if you make the first partition exFAT, custom recoveries like CWM will not mount it. This can cause problems, for example, when you are trying to restore a nandroid backup from your sdcard.
As for the format for the second partition (let's call it the linux partition), it depends on what linux filesystems your device supports. You can't use (ex/v)FAT(32). You can only use linux filesystem for installing a linux OS.
If you are using aParted to partition the sdcard, not every format will work. My tablet supports mkfs.ext2 and make_ext4fs but
Code:
mke2fs -t ext3/4
doesn't work. So I used aParted to format the second partition as ext2 and ran
Code:
make_ext4fs /dev/block/mmcblk0p2
in terminal emulator. So my linux partition is ext4. You need to unmount your sdcard to use aParted.
NOTE: Before creating your second partition, make sure your device is able to mount the format that you want to use. Run the
Code:
cat /proc/filesystems
or
mount
command in terminal emulator to check for supported filesystems.
STEP 2: Mounting the sdcard partitions
WARNING: If you are using the Link2SD app or any other app2sd app, you might be prompted to create mount scripts for the second partition. DO NOT CREATE THE MOUNT SCRIPTS. Our linux partition is not meant for app2sd.
In this tutorial, we will be mounting the linux partition automatically on startup. For this, you'll need init.d script support on your device. You can use Uni-Init to check/enable init.d easily. If your device does not support init.d and you've failed to enabled it, you could go for more advanced methods like unpacking your boot image and editing init.rc to mount the linux partition. You could also try the Script Manager app. You can also choose to mount the linux partition only when you boot up linux. Let me know if you'd like instructions for this.
Assuming that you already have init.d support, let us proceed.
Download the attached 03ubuntu script and using a root explorer copy it to /system/etc/init.d/here. I use ES File Explorer. Set file permissions to rwx-rwx-rwx or 777(? I'm not very familiar with numerical permissions). rwx-r-xr-x might also work. You can also use terminal to copy, set file permissions, etc. It's up to you.
EDIT: WARNING! Depending on your device, your MicroSD card might me mmcblk1. You can check using the mount command or from the aParted app. It is mmcblk1 on one of my friends' phone. If this is the case you must edit the 03ubuntu script to replace mmcblk0p2 by mmcblk1p2
The 03ubuntu script mounts the linux partition as ext4 at /mnt/ubuntu. The mount options in the script are meant for the maximum performance but may reduce reliability. I haven't had any problems yet. If your linux partition is not ext4, edit the script accordingly. Some of the mount options used in the script are meant for ext4 filesystems only. Google "best/optimum ext(whatever your linux partition is) mount options" to learn more. My linux partition is mounted with noatime option but becomes relatime sometimes after shutting down linux. Somebody please tell me why this happens.
{
"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"
}
After placing the script in the init.d directory, reboot your phone.
After rebooting, open the /mnt folder. If you see a folder named ubuntu, congratulations, the init.d script worked. But is the linux partition mounted? You can check by opening the /mnt/ubuntu folder. If you see a lost+found or LOST.DIR folder, the partition is very likely to be mounted. Confirm it by running
Code:
mount
in the terminal. Look for the line
Code:
/dev/block/mmcblk0p2 /mnt/ubuntu ext4 rw,noatime,user_xattr,barrier=0,data=writeback 0 0
If you see that line, we're ready to move to the next step.
STEP 3: Copying the files from linux image to linux partition
Now, we install your linux distro on the sdcard. Place the image (a fresh one or the one that you've been using) in your sdcard and run the following commands. Note: You might need to make changes to the commands according to your image location and format.
Code:
su
mkdir /data/local/mnt
mknod /dev/block/loop255 b 7 255
losetup /dev/block/loop255 /mnt/sdcard/ubuntu.img
mount -t ext2 /dev/block/loop255 /data/local/mnt
cp -dpR /data/local/mnt/* /mnt/ubuntu
## wait till copy is complete ##
umount /data/local/mnt
exit
So that was it. You have your favorite linux distro installed on your sdcard now.
But before you go ahead and press that BOOT LINUX button, we still have some things left to do to make it possible to boot from sdcard.
STEP 4: Editing the bootscript.sh and init.sh files
Actually, I did the bootscript editing part for you. I made all (and only) the changes that are required to boot from the sdcard. The modified bootscript is based on the latest (v8) version. Things like sdcard and external sdcard mounts and binds are unchanged. I added comments in the script with my name to mark places where I made the changes. You can look through it if you like.
So now copy the modified bootscript.sh file inside /data/data/com.zpwebsites.linuxonandroid/files/here and set file permissions to rw-------.
After that, comes init.sh. Although the bootscript is common for all distros, it may not be the case for init.sh. You'll find it in /mnt/ubuntu/root/init.sh.
Copy it to your sdcard and keep a copy somewhere safe. Open the script in a text editor (I use Jota+ text editor) and find the following lines and remove them.
Code:
if [ $# -ne 0 ]; then
cfgfile=/root/cfg/$1.config
if [ -f $cfgfile ]; then
echo "Using config file $cfgfile"
else
echo "Config file not found, using defaults!($cfgfile)"
fi
fi
The original permissions for the init.sh file are rwx-rwx-rx
After that, place the modified init.sh file back inside /mnt/ubuntu/root/here and don't forget to set correct file permissions.
STEP 5: Final steps and booting linux
Everything is in place and now you can boot up your linux, or can you? Nope. The Complete Linux Installer app won't let you boot if it does not find an image file.
For this, create an empty file inside /mnt/ubuntu/here and name it ubuntu.img.
In the app, enter the location of linux image as /mnt/ubuntu/ubuntu.img and tap on the awesome boot button.
Voila! You've now successfully installed linux to your sdcard and managed to boot it up too! Well done, my son.
Aaaand...Just a reminder: Don't Update Script if you want to continue booting from thee linux partition.
If you have been successful in achieving the goal of this tut, please leave a feedback with your device name and any modifications that you had to make, if any, to the whole process. That will be of great help to others.
EDIT: RISK OF DOUBLE BOOTING!
In case of booting from linux image, when you (accidentally) tap on the boot widget or the boot button while linux is already running, the app would display a confirmation dialog to chroot into the mounted image. This may not happen when you are booting from the second sdcard partition.
To prevent errors when you accidentally tap on the boot widget/button, add the following code into the bootscript right after the error_exit() function at the beginning of the script.
Code:
echo "Boot up Linux? Make sure it is safe to boot before proceeding!"
read answer
if [ $answer != muchfunny ]; then
error_exit "Aborted"
fi
Replace "muchfunny" with y or yes or any word of your choice.
When you try to boot, you'll have to enter this word to proceed. If you type in the wrong word, it won't boot. This way, you will have a chance to prevent errors when you accidentally tap on the boot widget while linux is already running.
Any user of LOA, not just those who are booting from linux partition, can benefit from this. You could replace "muchfunny" with a secret code to prevent anyone from messing with your linux installation. So it's like implementing password protection.
I'm using this on my tablet.
hello david,
Looks nice and clear, haven't had the chance to try yet but will post my results when i do.
Just wanted to say big thanks for the write up.
Sent from my Nexus 7 using Tapatalk 2
joesnose said:
Looks nice and clear, haven't had the chance to try yet but will post my results when i do.
Click to expand...
Click to collapse
When you do a factory reset in CWM (probably also in other recoveries), the second sdcard partition is wiped.
So it's best to store the backups in the internal sd and remove the sdcard before performing a reset.
If you don't already know, and if you have not run "apt-get clean", you can back up any packages that you downloaded on ubuntu (if you're using it) by keeping a copy of the contents of the archives folder in /var/cache/apt/. In case your linux installation gets corrupted or the partition gets wiped, you can restore the backed-up packages later. So you won't have to download them again.
I have used this thread to install Archlinux using LinuxonAndroid on a Samsung Epic 4G's SD card. I have some issues to sort out with using VNC to access the Archlinux installation but the commandline environment on the Epic 4G works fine.
If you're trying to use this with Ubuntu, there are several issues. First, the image hosted by the LoA project for Ubuntu 13.10 doesn't work for this application: you'll get errors when you try to mount the image for installation to the SD partition. Second, you might try the 13.04 image: it will mount and install but the repositories are all gone because 13.04 is no longer supported.
If you're trying to install this in order to use a specific program (in my case, I'm wanting to use this device as a Prosody server), it's probably best to see which available distro hosted by LoA has up-to-date packages for that program and use that to guide your decision. Based on this logic, I chose Archlinux.
If you aren't using Ubuntu, the bootscript.sh file included with this post becomes problematic as it is littered with Ubuntu-specific calls. It isn't overly difficult to edit: open it in Notepad+ (or similar) and read through it, changing $mnt and $ubuntu to whatever you've named your partition mount folder as. In my case, my mount folder is /archlinux/ and the fake image file (used to spoof the LoA app as detailed in OP's post) is /archlinux/archlinux.img, so this meant simply replacing $mnt and $ubuntu with $archlinux. There are a few instances of $ubuntu that I didn't mess with--in the comments, David has mentioned that they refer to the "usermounts feature" and that he left these alone because he didn't understand it. Are these the usermounts that are defined in the LoA app? I don't know and I haven't tried defining a mount yet (such as partition 1 on the SD card). In short, bootscript.sh will need to be edited to account for a non-Ubuntu installation.
(If you're using Archlinux, LoA hosts a modified bootscript.sh that contains a Archlinux-specific change to mounting /dev/pts, whatever that is. I used this as a base script to work with, then added and deleted the areas that David has edited in his bootscript.sh.)
Accounting for the differences, Archlinux works at the terminal on the device. However, if you try to connect to the automatically configured VNC server, things start to get weird for a Linux noob (which I am). For starters, there isn't a desktop environment defined so when you first connect, you're gonna see a blank gray screen and a cursor. Right-clicking brings up a menu. Almost none of the apps on the menu work, because they aren't installed. I think what you're looking at is the openbox window environment. What you need is a terminal to install something that works better but here's the catch: the terminal isn't installed/working, either (in VNC, not at the device). What I did here might have been a mistake compounding an error: I used the terminal on the device (which is logged in as root) to install a desktop environment using Archlinux's package manager, pacman. Then, I edited the (hidden by default) /home/$yourinstallhere/.vnc/xstartup.sh to boot the installed desktop environment; add a line with the command appropriate to your chosen DE: e.g. gnome-session; startxfce4; startlxde. You can comment out most anything else as those lines are loading the openbox environment and a terminal session. Alternatively, leave those in place as a backup environment and place your DE load command after those, so if your DE doesn't load, you still have the nearly useless gray screen to look at.
Okay, so that got a DE going (after the xstartup script was executed again and possibly the Linux install rebooted). Now what? Well, as mentioned before, terminal still doesn't work. It will open but there isn't a prompt and no keyboard input is shown. Without terminal, Linux is crippled, DE or no DE. This is where I am currently. I can still manage the Archlinux installation from the device's terminal as root but access from VNC is effectively unusable. I don't know why: is it because the DE packages (including a terminal emulator) were installed by root and therefore the VNC user doesn't have the permissions to access them?
In any event, I would like to thank David for posting this thread. The LoA project has little to no documentation or discussion so this has been very helpful to me. Please let me know if you have any ideas regarding VNC access of the installation.
Edit: Additional installation-specific information:
My Epic 4G is running the Cyanogenmod 10.1 stable release. The init.d mount script for the second partition will not automatically run at boot, despite CM supporting init.d and having installed the Universal init.d app. However, the script can be manually executed from within the Universal app and that will mount the partition. I tried adding a 50-second sleep to the script to see if it was just bogging down but that had no effect so I gave that idea up. The test script that the Universal app uses to test if the device has init.d support also doesn't work, which indicates that the Epic 4G CM port may be at fault here.
Using Archlinux's systemctl to manage services from the root terminal on the device is not working as expected. For instance, if I try to restart the vncserver service (systemctl restart vncserver) the terminal returns, "Running in chroot, ignoring request."
Edit #2:
Installed xterm from the device terminal and now I can access xterm from VNC /facepalm (why does the xstartup script call something that isn't installed by default?).
When my device's screen powers off, the VNC session drops because the server apparently kills itself. I have Android set to keep wifi on during sleep. How do I keep VNC active while the device's screen is off?
I seem to have succeeded with having my Epic 4G run an XMPP server (Prosody) within Archlinux on Android. I don't want to take this thread too far off-topic but there were some aspects to my project that would be useful to know for someone installing LoA.
http://sourceforge.net/p/linuxonand...do-users-and-groups-work-under-linuxonandroid
https://android.googlesource.com/pl...r/include/private/android_filesystem_config.h
This is pretty key knowledge to know if you're going to install anything that's going to need to gain control over the Android hardware (e.g., opening sockets). Root at the terminal is probably in all of these groups but the default user (ubuntu or whatever you named your installation) might not be; if your software installs its own user, it definitely won't have these group memberships so you'll have to add them. In my case, Prosody creates its own user and group and refuses to run as root, so I had to give the Prosody user membership in the 3003 group so it could open listening ports (I also had to modify all of the files that should have belonged to Prosody with chown because root took ownership by default). I figured this was something to keep in mind, if you're a fellow Linux noob.
http://forum.xda-developers.com/showthread.php?t=1585009&page=24
Speaking of the "everything as root" problem, I came across this that purports to make the default ubuntu user more typical of what you'd encounter in a Linux distro. I haven't tried it yet but I may need to in the future, if I expand the services offered by my Epic 4G. I still haven't figured out why the VNC server drops when the screen is turned off, though; I probably need to switch servers. The default is xVNC and I have been using Win7 x64 TightVNC Viewer to access it.
Hello there! Thanks for your posts! After encountering problems while trying to get LAMP to run on Ubuntu 12.04 and 13.10, I had given up LoA, until today. I've been using Linux Deploy instead for the past few months. Everything works fine on it. Have you tried it?
Anyway, I've decided to install LoA Debian as image from now. I think dedicating a 4 GB partition to a Linux installation is costly when you have just 14.7 GB of available storage.
Hello David,
I gave up on Linux on Android because I couldn't get it to stay connected to wifi with the screen off. I went back to using an XMPP server on my OpenWRT router instead.
Thank you for the suggestion regarding Linux Deploy. If I have some time, I will try it.
Does your LAMP stack manage to stay constantly connected with the screen off?
hammmy said:
Hello David,
I gave up on Linux on Android because I couldn't get it to stay connected to wifi with the screen off. I went back to using an XMPP server on my OpenWRT router instead.
Thank you for the suggestion regarding Linux Deploy. If I have some time, I will try it.
Does your LAMP stack manage to stay constantly connected with the screen off?
Click to expand...
Click to collapse
Linux Deploy has options to keep screen on and to keep wifi on while the app is running. I'm not sure if this will help with accessing LAMP when the screen is off. BTW, I found other problems with LoA Debian. So I'm back to Linux Deploy Debian. I'll test LAMP with screen off and let you know how it goes.
Instead of running the web servers through a linux installation, I suggest you try the various web server apps available for Android, if you haven't already, that is. I use Palapa Web Server which is free and has a nice interface.
Unfortunately I was unable to get Apache to work. Anyways, like I said, the Android web server apps might best serve your needs.
davidheis said:
Instead of running the web servers through a linux installation, I suggest you try the various web server apps available for Android, if you haven't already, that is. I use Palapa Web Server which is free and has a nice interface.
Click to expand...
Click to collapse
This is a good suggestion but unfortunately the XMPP server apps that I've tried didn't work out. I don't recall exactly why as it's been awhile since I tested them. They are bare-bones and lack configuration options.
hammmy said:
This is a good suggestion but unfortunately the XMPP server apps that I've tried didn't work out. I don't recall exactly why as it's been awhile since I tested them. They are bare-bones and lack configuration options.
Click to expand...
Click to collapse
Oh, okay. I highly recommend Linux Deploy as the distros are downloaded directly from the official sources. Installing to a second partition is very easy too. And it also allows running of custom scripts during startup of your distro. So if you manage to have XMPP working, you won't have to open a terminal to start the service (which is necessary for apache - have to run "service apache2 start").
Let me know if you have any success with Linux Deploy. I may be working with XMPP in the near future, so having a 'take anywhere' server might prove very useful.
Hello David can you make a brief guide on how to install Kali on sdcards second partition. I'm stuck I don't know how to install the linux.IMG on the ext2 partition, I partitioned my SD card using minitool the problem is when I hit install on Linux deploy the IMG will be installed on the SD card but on the fat32 partition not the ext2, which is the path to ext2 ? I can't find it using file explorer maybe you can help me
EDIT: i need to mount the new ext2 partition right? which is the easiest way to do it?
hi... can you provide me a method to access the filesystem (eg. var, etc....) because in the old ubuntu version is no longer supported. i got 404 not found when try to get update(apt-get update). only one solution is modify etc/resource.list file....but ubuntu cant access the filesystem via termimal
Cifs mount on start? I've added it to fstab and mount -a works fine, but it seems that fstab is not being run on start-up? I tried adding the same line I used in fstab to the custom mount points but it does not like it "skip"' it's probably simple syntax, the mount cmd seems to change dep. on where you run it, anyone know the right way to get a cifs mount on start in ld? thanks..
this is what works in fstab/mount -a
//192.168.1.65/media/Cifs /Public/Video cifs username=user,password=pw,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm 0 0
Well hello everyone.
I am going to try this now cause Linux deploy failed for me and it also messed up my external sd card (cause my xperia e3 doesn't have that Much internal).
Then i tried complete linux installer normal installation method but that also didn't worked so now i am going to try this.
I know this thread is very old but that's my only chance left for installing Ubuntu in phone
If anyone can provide any advice or any guidance i will be grateful to him
Thanks In Advance