Chroot Ubuntu Build On Android x86 - Issues

1,532 views
Skip to first unread message

Fragile Avatar

unread,
Feb 5, 2012, 11:31:41 AM2/5/12
to Android-x86
I understand that this probably isn't fully supported but I've
followed some guides and have created a Ubuntu chroot on Android-x86.

However, I am having trouble getting chroot to actually set the new
root point.

In terminal on my android x86 device I used these commands:

su
chroot /system/ubuntu/
chroot: can't execute '/system/bin/sh' No such file or directory

I've checked with Ghost Commander and the sh file is there...any ideas
why it's having this error?

I built the chroot environment by mounting my Android-x86 disk on my
Ubuntu system and creating /system/ubuntu/ folder and installed chroot
inside there so it could be accessed inside Android.

Fragile Avatar

unread,
Feb 5, 2012, 11:57:28 AM2/5/12
to Android-x86
Ok after some investigation I managed to get further.

When I user su to get root access I type:

/system/bin/sh
chroot /system/ubuntu
chroot: can't change root directory to /system/ubuntu: Operation not
permitted

Chih-Wei Huang

unread,
Feb 5, 2012, 12:50:32 PM2/5/12
to andro...@googlegroups.com
I didn't understand what you did exactly.

Did you mount a ubuntu filesystem to a running android-x86 system,
or conversely?

If the former, you should issue

chroot /system/ubuntu /bin/sh


2012/2/6 Fragile Avatar <fragile...@gmail.com>:


--
Chih-Wei
Android-x86 project
http://www.android-x86.org

Fragile Avatar

unread,
Feb 5, 2012, 10:53:48 PM2/5/12
to Android-x86
Sorry I didn't explain properly. Here is what I did.

Mount my Tablet's HDD in Ubuntu so I can access Android-x86's files
and folders. As root, I create a folder inside /system/ for ubuntu,
namely /system/ubuntu/.

I use debootstrap to download and install a basic ubuntu installation
inside the /system/ubuntu folder.

I copy /etc/resolv.conf to my new ubuntu install so I can perform
updates and bind /proc as well.

Then, I shut down my main Ubuntu system and take the hard disk out of
my Ubuntu system and back in my tablet and boot it up. I then download
BusyBox from Android Market.

In terminal, I try and execute the commands above in my first post to
start a new chroot but it keeps saying operation not permitted or
denied.

Perhaps the Android-x86 kernel is missing something that chroot needs?

On Feb 5, 9:50 am, Chih-Wei Huang <cwhu...@android-x86.org> wrote:
> I didn't understand what you did exactly.
>
> Did you mount a ubuntu filesystem to a running android-x86 system,
> or conversely?
>
> If the former, you should issue
>
> chroot /system/ubuntu /bin/sh
>
> 2012/2/6 Fragile Avatar <fragile.ava...@gmail.com>:

Chih-Wei Huang

unread,
Feb 5, 2012, 11:10:33 PM2/5/12
to andro...@googlegroups.com
2012/2/6 Fragile Avatar <fragile...@gmail.com>:

> Sorry I didn't explain properly. Here is what I did.
>
> Mount my Tablet's HDD in Ubuntu so I can access Android-x86's files
> and folders. As root, I create a folder inside /system/ for ubuntu,
> namely /system/ubuntu/.
>
> I use debootstrap to download and install a basic ubuntu installation
> inside the /system/ubuntu folder.
>
> I copy /etc/resolv.conf to my new ubuntu install so I can perform
> updates and bind /proc as well.
>
> Then, I shut down my main Ubuntu system and take the hard disk out of
> my Ubuntu system and back in my tablet and boot it up. I then download
> BusyBox from Android Market.

Why do you do that?
We already have busybox.

I believe the busybox downloaded from Market
is an arm binary, surely does not work on android-x86.

> In terminal, I try and execute the commands above in my first post to
> start a new chroot but it keeps saying operation not permitted or
> denied.


> Perhaps the Android-x86 kernel is missing something that chroot needs?

No, that's definitely your problem.

Have you tried my command?

rinaldo....@gmail.com

unread,
Feb 6, 2012, 4:41:14 AM2/6/12
to andro...@googlegroups.com
If you want to chroot ubuntu from android... You can do it...
I have done it with linux mint, and think if I can compile driver from it, but many people say it can't, so I given up...
Here is what I did...
For example :
sda1 = ubuntu
sda2 = android...
I just do it as simple as I can...
Forget about busybox installer, it is useless for android-x86, and maybe will crash it.
First, just mount ubuntu as data partition on android, just set DATA=sda1 on grub ...
Then, go to androlinux.com. Download files needed to install ubuntu on another phone, but forget ubuntu.img inside ubuntu.zip. If you have a slow internet, you can move to windows box, download free download manager from freedownloadmanager.org, and download the zip from androlinux.com and when it ask to open the zip, just open it, but don't download ubuntu.img...
Then open bootubuntu with gedit. You must change something...
1. Delete every part that tell to mount ubuntu.img
2. Replace everything called /data/local/ubuntu to /data
Then run ubuntu.sh. It will copy bootubuntu to... I forget it, but if I don't wrong it will copy bootubuntu to /system/bin. Just do it once
then type bootubuntu, it must go to ubuntu...
Then follow the instructions at androlinux.com about the GUI.
But remember, the ubuntu must be x86 version, because we run it in x86 architecture.
Sorry for my english...
If you found any mistake in my guide or my english, please tell me, thanks :D
Sent from my BlackBerry®
powered by Sinyal Kuat INDOSAT
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-x86...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-x86?hl=en.

Chih-Wei Huang

unread,
Feb 6, 2012, 5:09:32 AM2/6/12
to andro...@googlegroups.com
Well, please do not complicate things.
It's pretty easy to do that in the steps:

* install ubuntu to sda1
* install android-x86 to sda2
* boot to android-x86
* open a terminal, type
mkdir /data/ubuntu
busybox mount /dev/block/sda1 /data/ubuntu
chroot /data/ubuntu /bin/sh

That's all.

What Fragile missed is he didn't specify the shell
to be used in chroot, so /system/bin/sh is called.
This doesn't exists in an ubuntu filesystem, of course.

To be honest, I didn't try ubuntu.
I tried fedora (14).
Actually I can even run X window inside android-x86,
and switch between android ui and X window by vt.
But only one can be accelerated.


2012/2/6 <rinaldo....@gmail.com>:


> If you want to chroot ubuntu from android... You can do it...
> I have done it with linux mint, and think if I can compile driver from it, but many people say it can't, so I given up...
> Here is what I did...
> For example :
> sda1 = ubuntu
> sda2 = android...
> I just do it as simple as I can...
> Forget about busybox installer, it is useless for android-x86, and maybe will crash it.
> First, just mount ubuntu as data partition on android, just set DATA=sda1 on grub ...
> Then, go to androlinux.com. Download files needed to install ubuntu on another phone, but forget ubuntu.img inside ubuntu.zip. If you have a slow internet, you can move to windows box, download free download manager from freedownloadmanager.org, and download the zip from androlinux.com and when it ask to open the zip, just open it, but don't download ubuntu.img...
> Then open bootubuntu with gedit. You must change something...
> 1. Delete every part that tell to mount ubuntu.img
> 2. Replace everything called /data/local/ubuntu to /data
> Then run ubuntu.sh. It will copy bootubuntu to... I forget it, but if I don't wrong it will copy bootubuntu to /system/bin. Just do it once
> then type bootubuntu,  it must go to ubuntu...
> Then follow the instructions at androlinux.com about the GUI.
> But remember, the ubuntu must be x86 version, because we run it in x86 architecture.

rinaldo....@gmail.com

unread,
Feb 6, 2012, 5:16:39 AM2/6/12
to andro...@googlegroups.com
I have downloaded fedora...
If I installed it, can I compile android-x86 driver on fedora?
And what is vt?


Sent from my BlackBerry®
powered by Sinyal Kuat INDOSAT

-----Original Message-----
From: Chih-Wei Huang <cwh...@android-x86.org>
Sender: andro...@googlegroups.com
Date: Mon, 6 Feb 2012 18:09:32
To: <andro...@googlegroups.com>
Reply-To: andro...@googlegroups.com
Subject: Re: Chroot Ubuntu Build On Android x86 - Issues

Fragile Avatar

unread,
Feb 6, 2012, 10:23:39 AM2/6/12
to Android-x86
Well I got it to work (sort of)

I install Linux to dev/sda1 and Android to /dev/sda2.

I use chroot to set the new root and I specify /bin/sh.

However when I do that, I get a "precmd error: not found".

But if I do this:

chroot /data/ubuntu /bin/bash

I get a root prompt with no errors, only I can't seem to enter basic
commands like ls, cd etc. But I'm making progress!
> 2012/2/6  <rinaldo.jonat...@gmail.com>:
> > If you want to chroot ubuntu from android... You can do it...
> > I have done it with linux mint, and think if I can compile driver from it, but many people say it can't, so I given up...
> > Here is what I did...
> > For example :
> > sda1 = ubuntu
> > sda2 = android...
> > I just do it as simple as I can...
> > Forget about busybox installer, it is useless for android-x86, and maybe will crash it.
> > First, just mount ubuntu as data partition on android, just set DATA=sda1 on grub ...
> > Then, go to androlinux.com. Download files needed to install ubuntu on another phone, but forget ubuntu.img inside ubuntu.zip. If you have a slow internet, you can move to windows box, download free download manager from freedownloadmanager.org, and download the zip from androlinux.com and when it ask to open the zip, just open it, but don't download ubuntu.img...
> > Then open bootubuntu with gedit. You must change something...
> > 1. Delete every part that tell to mount ubuntu.img
> > 2. Replace everything called /data/local/ubuntu to /data
> > Then run ubuntu.sh. It will copy bootubuntu to... I forget it, but if I don't wrong it will copy bootubuntu to /system/bin. Just do it once
> > then type bootubuntu,  it must go to ubuntu...
> > Then follow the instructions at androlinux.com about the GUI.
> > But remember, the ubuntu must be x86 version, because we run it in x86 architecture.
>
> --
> Chih-Wei
> Android-x86 projecthttp://www.android-x86.org

Chih-Wei Huang

unread,
Feb 6, 2012, 12:18:57 PM2/6/12
to andro...@googlegroups.com
2012/2/6 Fragile Avatar <fragile...@gmail.com>:

> Well I got it to work (sort of)
> I install Linux to dev/sda1 and Android to /dev/sda2.
> I use chroot to set the new root and I specify /bin/sh.
> However when I do that, I get a "precmd error: not found".
>
> But if I do this:
>
> chroot /data/ubuntu /bin/bash
>
> I get a root prompt with no errors, only I can't seem to enter basic
> commands like ls, cd etc. But I'm making progress!

You need to set PATH variable.
The PATH inherited from android is not
the same as a traditional linux.

rinaldo....@gmail.com

unread,
Feb 6, 2012, 6:44:14 PM2/6/12
to andro...@googlegroups.com
Because I don't want to make any mistake...
I always using androlinux configuration file...
But the mint is running! I can connect to wifi with eeepc iso (because only that iso supports my wifi!) then install tight vnc server, and see how beautiful my mint is inside vnc...
But I have some question...
1. Can I automate this process? So everytime android booted, it chroot mint and I only need to open vnc?
2. What is vt?
Hehee...
Thanks for the answer... Maybe I should not ask?
If I should not ask, sorry :)

Sent from my BlackBerry®
powered by Sinyal Kuat INDOSAT

-----Original Message-----
From: Chih-Wei Huang <cwh...@android-x86.org>
Sender: andro...@googlegroups.com
Date: Tue, 7 Feb 2012 01:18:57
To: <andro...@googlegroups.com>
Reply-To: andro...@googlegroups.com
Subject: Re: Chroot Ubuntu Build On Android x86 - Issues

Chih-Wei Huang

unread,
Feb 6, 2012, 9:54:21 PM2/6/12
to andro...@googlegroups.com
2012/2/7 <rinaldo....@gmail.com>:

> Because I don't want to make any mistake...
> I always using androlinux configuration file...
> But the mint is running! I can connect to wifi with eeepc iso (because only that iso supports my wifi!) then install tight vnc server, and see how beautiful my mint is inside vnc...
> But I have some question...
> 1. Can I automate this process? So everytime android booted, it chroot mint and I only need to open vnc?

Sure. You can put scripts to scripts subdir in
the dir android-x86 installed,
or let init.rc to run your script.

> 2. What is vt?

virtual terminal, i.e., switch console by Alt-F1, F2, ...

Rinaldo Jonathan

unread,
Feb 7, 2012, 3:34:08 AM2/7/12
to andro...@googlegroups.com
hmmm...
i have some question again...
can i make something... like...
Alt+F1 = android terminal
Alt+F2 = ubuntu terminal
Alt+F7 = android GUI
Alt+F8 = ubuntu GUI
can i make something like that?
if yes, how can i do that?


2012/2/6, Chih-Wei Huang <cwh...@android-x86.org>:

Rinaldo Jonathan

unread,
Feb 10, 2012, 4:08:13 AM2/10/12
to Android-x86
no answer? :(

On Feb 7, 3:34 am, Rinaldo Jonathan <rinaldo.jonat...@gmail.com>
wrote:
> hmmm...
> i have some question again...
> can i make something... like...
> Alt+F1 = android terminal
> Alt+F2 = ubuntu terminal
> Alt+F7 = android GUI
> Alt+F8 = ubuntu GUI
> can i make something like that?
> if yes, how can i do that?
>
> 2012/2/6, Chih-Wei Huang <cwhu...@android-x86.org>:
>
>
>
>
>
>
>
> > 2012/2/7  <rinaldo.jonat...@gmail.com>:

Thisara Kasun

unread,
Jun 12, 2016, 10:08:18 AM6/12/16
to Android-x86
Hi,i'm just curious. Can we do the 'Vise-versa' of this? I mean chroot into Android-x86 from linx..and run android apps under X? Is it even possible?
Message has been deleted

Rinaldo Jonathan

unread,
Jun 12, 2016, 10:13:30 AM6/12/16
to android-x86

Chroot into android, MAYBE possible. Never tried though.

Running android apps with X, NO.

Pada tanggal 12 Jun 2016 21.08, "Thisara Kasun" <thisara...@gmail.com> menulis:
Hi,i'm just curious. Can we do the 'Vise-versa' of this? I mean chroot into Android-x86 from linx..and run android apps under X? Is it even possible?

--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.

To post to this group, send email to andro...@googlegroups.com.

Hypo Turtle

unread,
Jun 12, 2016, 10:20:44 AM6/12/16
to Android-x86
via VNC perhaps...
chroot into android; setup vnc server
login to vnc session from linux

Rinaldo Jonathan

unread,
Jun 12, 2016, 10:25:03 AM6/12/16
to android-x86

Well, this is almost a great idea. Until android need to access hardware directly ._.
Unfortunately this is not under my knowledge anymore. I left it here.

Sorry.

--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.

Povilas Staniulis

unread,
Jun 12, 2016, 10:59:35 AM6/12/16
to andro...@googlegroups.com
Android is very different from your average Linux distro.
You can run e.g. Ubuntu in chroot from Android, but Android itself
cannot be run from a chroot (well, you can run shell apps, but not the UI).

Using VNC is theoretically possible (that is, you could in theory,
modify the system to work with VNC), but I think it would be too slow to
be usable.

On 2016.06.12 17:24, Rinaldo Jonathan wrote:
>
> Well, this is almost a great idea. Until android need to access
> hardware directly ._.
> Unfortunately this is not under my knowledge anymore. I left it here.
>
> Sorry.
>
> Pada tanggal 12 Jun 2016 21.20, "Hypo Turtle" <hypot...@gmail.com
> <mailto:hypot...@gmail.com>> menulis:
>
> via VNC perhaps...
> chroot into android; setup vnc server
> login to vnc session from linux
>
> On Sunday, 12 June 2016 15:08:18 UTC+1, Thisara Kasun wrote:
>
> Hi,i'm just curious. Can we do the 'Vise-versa' of this? I
> mean chroot into Android-x86 from linx..and run android apps
> under X? Is it even possible?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android-x86" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to android-x86...@googlegroups.com
> <mailto:android-x86...@googlegroups.com>.
> To post to this group, send email to andro...@googlegroups.com
> <mailto:andro...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/android-x86.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android-x86" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to android-x86...@googlegroups.com
> <mailto:android-x86...@googlegroups.com>.
> To post to this group, send email to andro...@googlegroups.com
> <mailto:andro...@googlegroups.com>.
Message has been deleted

Hypo Turtle

unread,
Jun 12, 2016, 11:28:35 AM6/12/16
to Android-x86
adb over wifi and Vysor chrome app ??

If/once vysor works with Ax86

Povilas Staniulis

unread,
Jun 12, 2016, 2:11:29 PM6/12/16
to andro...@googlegroups.com
Not possible.
Chrome needs UI subsystem to work.

On 2016.06.12 18:28, Hypo Turtle wrote:
> *adb over wifi* and *Vysor* chrome app ??
>
> If/once vysor works with Ax86

Hypo Turtle

unread,
Jun 12, 2016, 2:25:54 PM6/12/16
to Android-x86
You know I mean Chrome on Linux right?


On Sunday, 12 June 2016 19:11:29 UTC+1, Povilas Staniulis wrote:
Not possible.
Chrome needs UI subsystem to work.

On 2016.06.12 18:28, Hypo Turtle wrote:
> *adb over wifi* and *Vysor* chrome app ??
>
> If/once vysor works with Ax86
> --
> You received this message because you are subscribed to the Google
> Groups "Android-x86" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to android-x86...@googlegroups.com

Povilas Staniulis

unread,
Jun 12, 2016, 2:35:00 PM6/12/16
to andro...@googlegroups.com
I do believe Vysor app requires Android to already be running on a
physical device. It can't be used to 'host' Android's UI.

On 2016.06.12 21:25, Hypo Turtle wrote:
> You know I mean Chrome on Linux right?
>
> On Sunday, 12 June 2016 19:11:29 UTC+1, Povilas Staniulis wrote:
>
> Not possible.
> Chrome needs UI subsystem to work.
>
> On 2016.06.12 18:28, Hypo Turtle wrote:
> > *adb over wifi* and *Vysor* chrome app ??
> >
> > If/once vysor works with Ax86
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android-x86" group.
> > To unsubscribe from this group and stop receiving emails from
> it, send
> > an email to android-x86...@googlegroups.com <javascript:>
> > <mailto:android-x86...@googlegroups.com <javascript:>>.
> > To post to this group, send email to andro...@googlegroups.com
> <javascript:>
> > <mailto:andro...@googlegroups.com <javascript:>>.
> <https://groups.google.com/group/android-x86>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android-x86" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to android-x86...@googlegroups.com
> <mailto:android-x86...@googlegroups.com>.

Hypo Turtle

unread,
Jun 12, 2016, 3:32:01 PM6/12/16
to Android-x86
from what I recall:
Adb connection found. Vizor apk pushed and pm install'ed; vizor connection made.

Only issue I can think would be needing to validate a secure adb / grant linux side adb access. I guess for that you'd need to run the build properly first then use the system/data to chroot.

Povilas Staniulis

unread,
Jun 12, 2016, 3:35:08 PM6/12/16
to andro...@googlegroups.com
I repeat again: an app cannot host Android UI. You can use it to control
Android already running on a device, that's all.

Chih-Wei Huang

unread,
Jun 13, 2016, 6:19:58 AM6/13/16
to Android-x86
2016-06-12 22:59 GMT+08:00 Povilas Staniulis <wdmo...@gmail.com>:
> Android is very different from your average Linux distro.
> You can run e.g. Ubuntu in chroot from Android, but Android itself cannot be
> run from a chroot (well, you can run shell apps, but not the UI).

Well, you should know Android-x86 DEBUG mode is running
inside a chroot shell.

Both chroot Linux inside Android(-x86) or
chroot Android(-x86) inside Linux are possible.
However, it won't make everything work magically.
The most critical issue is the resource conflicts.
Both processes may access the same hardware
simultaneously. (e.g., X and Androud surfaceflinger
will access the GPU directly)
How to handle that is far beyond the chroot technology.
So far there is no solution available to the open source
community yet I think.

Povilas Staniulis

unread,
Jun 13, 2016, 7:21:06 AM6/13/16
to andro...@googlegroups.com
I do know that chroot with graphics is possible if you do it from shell.
(That's how I got Ubuntu ARM with X acceleration to work on my old Tegra
3 based Asus TF300T).
But running both X and Android at the same time isn't possible yet.
Well you can run X using Xtightvnc but that's software emulation.

TheKit

unread,
Jun 17, 2016, 1:01:08 AM6/17/16
to Android-x86


понедельник, 13 июня 2016 г., 18:19:58 UTC+8 пользователь Chih-Wei Huang написал:
Both chroot Linux inside Android(-x86) or
chroot Android(-x86) inside Linux are possible.
However, it won't make everything work magically.
The most critical issue is the resource conflicts.
Both processes may access the same hardware
simultaneously. (e.g., X and Androud surfaceflinger
will access the GPU directly)
How to handle that is far beyond the chroot technology.
So far there is no solution available to the open source
community yet I think.

There is https://wiki.merproject.org/wiki/Adaptations/libhybris/sfdroid project which runs Android in a window on Sailfish OS. I had some success building it with Android-x86 Lollipop and running on Intel graphics. It makes Android render to virtual framebuffer module and then renders Android screen via SDL app. Android and X can access the same GPU due to DRM access patch in Android-x86, but X must be started before Android's surfaceflinger. I couldn't get it usable though, since the rendering is pretty slow for some reason.
Reply all
Reply to author
Forward
0 new messages