Possible to run Android-x86 in a chroot from a Linux host?

225 views
Skip to first unread message

Ottavio Caruso

unread,
Jun 8, 2023, 11:22:33 AM6/8/23
to andro...@googlegroups.com
I know it's possible to run a working subset of Linux (at least the
console part without Xorg, for example Termux).

I wonder if the opposite is possible, without using emulators or other
tricks like Anbox.

--
Ottavio Caruso

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

Michael Goffioul

unread,
Jun 8, 2023, 12:28:32 PM6/8/23
to andro...@googlegroups.com
That's more or less what Waydroid is doing, AFAIK.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/android-x86/CAEJNuHxgHkY4h38nz7V8sqN49Dd68YrUQZRBefXtc_wvw2rxwA%40mail.gmail.com.

İlhan Atahan

unread,
Jun 9, 2023, 3:53:01 AM6/9/23
to Android-x86
Anbox is a container, not an emulator, AFAIK.

crw

unread,
Jun 9, 2023, 10:01:46 AM6/9/23
to Android-x86
The question is about chroots, Waydroid or Anbox doesn't use chroot but LXC specifically which are somewhat similar but not really the exact same as chroot.
I have tried this myself. It doesn't work at all on a regular GNU/Linux distro due to some differences in the kernel. After swapping the kernel to a custom one built with Android-x86 Linux kernel patches integrated, the Android-x86 init executable runs at least (with the proper bind mounts to the chroot) but the system seems to crash or hang flooding the console/TTY with errors. host was also affected, some programs on the host started to hang after android init executable runs in the chroot.
Although I couldn't get the Android GUI, I got access to the Android-x86 console, ran adbd in the chroot and was able to connect from the host. It was a very interesting experiment for sure. Just like in Android-x86, if I exit the console with Ctrl+D it re-appears after a while.
I didn't go more further but thought that when the host is using udev+systemd and when you try to start the android init system in a chroot, they conflict together. Could be since the devices nodes and kernel are shared (/dev, /proc, /sys) without restrictions. Waydroid and Anbox use lxc which creates different namespaces for that.
On a side note, I would like to mention that not only "the console part without Xorg" is possible on Android-x86. I have also run a Xorg server on KMS/DRM directly from chroot on Android-x86 using startx/xinit. In that case Xorg is running in a separate TTY with hardware GPU acceleration.

Ottavio Caruso

unread,
Jun 10, 2023, 6:35:35 AM6/10/23
to andro...@googlegroups.com
Am 09/06/2023 um 14:01 schrieb crw:
> On a side note, I would like to mention that not only "the console part
> without Xorg" is possible on Android-x86. I have also run a Xorg server on
> KMS/DRM directly from chroot on Android-x86 using startx/xinit. In that
> case Xorg is running in a separate TTY with hardware GPU acceleration.

Thanks.

Do you think running Android-x86 (as a host) and, say, Debian in a
chroot is stable enough? I need to run 2 o 3 Android apps (on the PC)
and some other production tools on Debian.


The other possibility is running these tools directly on Xorg on Android
(?).

crw

unread,
Jun 13, 2023, 10:56:11 AM6/13/23
to Android-x86

When using Xorg on Android, it won't have complete hardware acceleration. There will be a performance loss and some inconvenience with keyboard and mouse input. 
If you run Xorg server in the chroot it runs at the same performance and gives an experience almost like that of running a full-blown Linux distro, input,gpu and all are handled by x11.
Speaking of stability, it may depend on your workflow. The chroot is not quite simple to setup. There are some electron apps like vscode that require some fixes (change permissions of chrome-sandbox). Another app, Kate stopped working in the chroot since an update long ago giving some QSharedMemory error. All other apps I use run fine, including Android Studio. 

john s wolter

unread,
Nov 20, 2023, 2:43:17 AM11/20/23
to andro...@googlegroups.com
Okay that means to me the game is on with Google's restrictive license terms.  Google can't just can't take away developers.  Google is acting like a monopoly.  They had made declarations about Android being open source but now want to restrict the license of previously used and free;  standing up to Google may cause "Trouble"

Cheers, John S Wolter, Johnny 4-Shots, Johnny One Eye, Staying Safe, Hands Washed, Immune Challenged, Masked, 2-meters, Remote & Hybrid Team meetings.
--------------------

Reply all
Reply to author
Forward
0 new messages