android-x86 and lxc-android

2,276 views
Skip to first unread message

Jose Luis s

unread,
Sep 30, 2016, 10:54:22 AM9/30/16
to Android-x86
Hi all.

Does anybody play with LXC-android?, I've came across recently with this info :

https://community.kde.org/Plasma/Mobile/CyanogenModBase

And thinking about it, I wonder if it's possible to have a android-x86 or CM13 rootfs, tho get it working in a lxc running in a prexisting Android (kernel) running. (an Android-ia kernel in a baytrail tablet, v3.10 if I recall it). Of course not sure if a so "old" kernel will it run CM13 or android-x86, and of course if it have all prerequisites.

How can I have a working rootfs of android-x86 and or CM13? probably is not only decompiling system.sfs.
Thanks

Hypo Turtle

unread,
Sep 30, 2016, 11:27:07 AM9/30/16
to Android-x86
That link is arm based; essentially a chroot into Plasma

There's an x86 version here: https://plasma-mobile.org/intel-based-devices/
No need for any Android stuff - it's essentially just a linux/Arch build

Jose Luis s

unread,
Sep 30, 2016, 12:38:04 PM9/30/16
to Android-x86
Understood, but my aim is to have a working android-ia kernel (in android 4.4.4) in a more updated Marshmalow android-x86 or CM13, via LXC, maybe a x86 LXC version does the magic. Actually is only a way to circumvent my issues with android-x86 kernels or Maurossi and my evil baytrail tablets. Not sure if to have LXC working is necessary to have a special kernel option active or not, I've not found nothing special.

Thanks

Jose Luis s

unread,
Sep 30, 2016, 12:40:19 PM9/30/16
to Android-x86
I forgot; AFAIK is not a Chroot is more a virtualization similar to VZ containers, at kernel level, not full virtualization like KVM, that's why I wonder if is it necessary some kernel options.....



El viernes, 30 de septiembre de 2016, 17:27:07 (UTC+2), Hypo Turtle escribió:

Hypo Turtle

unread,
Sep 30, 2016, 1:37:30 PM9/30/16
to Android-x86
From the link you posted with the CMBase - it's pretty clear what they are doing for the arm devices is a chroot; Ubuntu Touch did the same thing at least initially - not sure how they handled things before giving up.
Essentially take the device specific stuff {kernel modules] and then instead of loading an android system you load a Linux GNU img/sfs/partition. The caveat being; and most relevant in your case, that the stock kernel needs to be able to run the system.

The kernel the x86 Plasma is running is 4.1.6-1-ARCH btw.

You could try to either turn the Ax86 ramdisk/kernel into a A-IA boot.img with your kernel/modules or the reverse and turn your kernel/modules into the Ax86 structure; but doubt-full it'll work. Likely due to the kernel/device restiction and requirements added by Google/Alphabet/Android

Also just fyi the system 'should' boot with just the kernel - things requiring modules (keyboard,touchscreen,wifi etc.) won't but the display and system should boot up fine with out them

Jose Luis s

unread,
Sep 30, 2016, 3:48:14 PM9/30/16
to Android-x86
Hi Hypo.

Thanks for your comment and help.

Yes it's for ARM compilation, Nexus5, so LXC containers binaries will not work in a x86 hw.
I agree it seems like a chroot, but only seems, actually is a kind of virtualization:
lxc-start -n system -F, starts the container system and take it "at front", but you can also start a container and not to "attach" to it, its like a Vz container in some way, you can start your WM without doing any VNC as done with Ubuntu Touch at the beginning.

So if I'm not wrong, there is nothing to do with turning kernels from one Ax86 to A-IA or viceversa, I's more a reuse of a A-IA kernel with a rootfs containing Android-x86 or CM13.

But to be honest I'm not quite sure, this will work, that's why I ask for some previous experience.


Anyway

Hypo Turtle

unread,
Sep 30, 2016, 7:18:27 PM9/30/16
to Android-x86

Yea I'm probably using 'chroot' wrong. I see anything that needs mounts/ln's from one system for another to run as being a chroot - i.e. Android structure to Linux/GNU structure or vice versa.

Androidx86 itself is a chroot, with the chroot system being the ramdisk.img and system.img/sfs - and those are what would be your rootfs. With the first root system being the initrd.img

The point about the kernels is that the modules are loaded in a different way in IA-A than Ax86 I believe, so you'd need to adjust accordingly.

Chih-Wei Huang

unread,
Sep 30, 2016, 7:33:20 PM9/30/16
to Android-x86
2016-10-01 7:18 GMT+08:00 Hypo Turtle <hypot...@gmail.com>:
>
> Yea I'm probably using 'chroot' wrong. I see anything that needs mounts/ln's
> from one system for another to run as being a chroot - i.e. Android
> structure to Linux/GNU structure or vice versa.
>
> Androidx86 itself is a chroot, with the chroot system being the ramdisk.img
> and system.img/sfs - and those are what would be your rootfs. With the first
> root system being the initrd.img

Not exactly.

In debug mode we use chroot.
In non-debug mode, switchroot is used.
That means the original rootfs in initrd
is eliminated and android init is the real
init process (pid 1).

> The point about the kernels is that the modules are loaded in a different
> way in IA-A than Ax86 I believe, so you'd need to adjust accordingly.

Actually now we use the same method developed by android-ia,
(i.e., patched ueventd). Search "module loading" in the list for more details.

Jose Luis s

unread,
Oct 1, 2016, 7:07:20 AM10/1/16
to Android-x86
In this case, not sure about modules load; I mean:

I've looked into:

https://raw.githubusercontent.com/plasma-phone-packaging/CM/master/lxc-system-config

this is the lxc configuration file for active mobile, there is not mention about changing root and it's pretty simple.

Also looked into:

http://mobile.neon.pangea.pub:8080/job/img_phone_xenial_armhf/lastSuccessfulBuild/artifact/result/livecd..rootfs.tar.gz

The rootfs, and there is no modules at all (as it supposed to be).

So in this scenario I think there is no modules loading process, they are already loaded in the Host android, lxc there is only a mountin process of some filesystems (obviously rootfs among them).

I would like to dive into, but unluckily I've not found a lxc-android x86 compilation, and existing packages are for ubuntu (probably some dependencies not met), Does anybody how to compile a makefile src in Android, if it is possible?

Thanks

György Pejović

unread,
Oct 1, 2016, 12:12:59 PM10/1/16
to Android-x86

spin877

unread,
Oct 2, 2016, 11:31:47 AM10/2/16
to Android-x86

it would be more interesting, if it were reversed. From linux/ubuntu to start a copy of andorid-x86 or CM
would, BlueStacks much faster.

P.S.
We should solve many "problems" type CONFIG_NO_GPU_AUTHENTICATION etc.etc.

Jian Wu

unread,
Oct 3, 2016, 12:16:01 AM10/3/16
to Android-x86
Jose Luis s於 2016年10月1日星期六 UTC+8下午7時07分20秒寫道:
Hi Jose,

This thread attracts me. I'd try to answer your questions in short.
*is anyone trying to run android-x86 in lxc? Yes, me
*regarding to lxc-android, I guess you're talking about prebuild lxc.tar.gz mentioned in this post https://www.stgraber.org/2013/12/23/lxc-1-0-some-more-advanced-container-usage/. In this post there are two similiar-term but different technologies, android container and lxc on android. Android container is about how to encapsulate android(-x86) image into a lxc container. Lxc on android is about porting lxc(commmands, libs...) into aosp. I am not sure which one you are addressing, or maybe both?
*don't understand module (kernel module?) issue. Since I am late to the post, would you summarize your requirement in few lines? Appreciated.


Jose Luis s

unread,
Oct 3, 2016, 7:48:27 AM10/3/16
to Android-x86
Hello Jian.

You're right, Both.

First of all, my aim is to use a complete working Android.IA kernel in my Chuwi tablets (running android 4.4.4) to run Android-x86 or CM13 in a lxc container, so both. I'm not very skilled in this area, I guess lxc is similar to openvz, so I assume no issues with kernel modules.
I search this aproach to circunvent all issues with Android-x86 kernel with baytrail tablets, of course if I had a complete working kernel (i mean complete as a kernel with my minimum modules working; touchscreen, audio, sensors, gps, battery manager etc), I do not research this option.

I only found a lxc-android for arm and of course sources and PPA packages for debian-ubuntu derivatives. Also I wonder how to make a android-x86 or CM13 lxc container with system.sfs initrd.img etc.

Hope you get further than me....

T.C 吳天健

unread,
Oct 3, 2016, 9:40:53 AM10/3/16
to andro...@googlegroups.com
Jose, 
I am not familiar with openvz.  But if openvz is based on linux namespace, cgroup, then they are in the same domain of technology.
Regarding to lxc-android (lxc on android) , as Gyorgy said you may check 'maru os'.  I roughly read its external/lxc its integrated well.  Though it's only tested on Nexus 5 (arm device) in the beginning you may modify Android.mk to replace cross-compiler. 
The other topic is android container (run android in a lxc container).  I plan to modify kernel of ubuntu to include features such as ashmem to support android.  Before recompile kernel I copied android-x86 rootfs to create a lxc container like this:
>copy target/product/x86/rootfs /var/lib/lxc/android
>lxc-start -n android 
I also simplify init.rc 
>on init
>    start adbd
>    start dhcpcd_eth0
And I successfully login a android adb shell
>root@tall:/var/lib/lxc/minidroid/rootfs# lxc-ls -f
>NAME      STATE   AUTOSTART GROUPS IPV4       IPV6 
>minidroid RUNNING 0         -      10.0.3.150 -    
>root@tall:/var/lib/lxc/minidroid/rootfs# adb connect 10.0.3.150
>connected to 10.0.3.150:5555
>root@tall:/var/lib/lxc/minidroid/rootfs# adb shell 
>1|@android:/ # /system/bin/du -d              
>1400        ./sbin
>16        ./cache
>112        ./mnt
>1106896        ./system
>320        ./data
>8        ./config
>0        ./proc
>8        ./acct
>16        ./tmp
>56        ./storage
>256        ./dev
>0        ./sys
>1110352        .

My next step is to recompile host kernel and run full set of android-x86.  I would like to have more people joining this work and we may share thoughts.

--
You received this message because you are subscribed to a topic in the Google Groups "Android-x86" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-x86/7s4lVW4FEns/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-x86+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted
Message has been deleted

nfsnfs

unread,
Nov 10, 2016, 1:59:33 AM11/10/16
to Android-x86
Hi,

I think your servicemanager crashed because of binder.
A binder driver only allows one servicemanager to register as context manager.

Best regards,
nfsnfs

On Monday, October 31, 2016 at 11:30:32 PM UTC+8, Jia wrote:
Hi, 
I am trying to run android-x86 in a lxc container.
I compiled the android-x86 4.4.4-r2 and copy the android-x86 rootfs to /var/lib/lxc/android
when I start the android lxc container, some processes could start, like this:
> lxc-attach -n android /system/bin/ps
USER     PID   PPID  VSIZE  RSS     WCHAN    PC         NAME
root      1     0     820    608   ffffffff 08062e06 S /init
root      3     1     752    4     ffffffff 08062e06 S /sbin/ueventd
media_rw  24    1     4028   392   ffffffff f7758361 S /system/bin/sdcard
root      28    1     1700   4     ffffffff 0806dff0 S /sbin/adbd
root      30    1     5492   736   ffffffff 55618361 S /system/bin/vold
install   36    1     1572   480   ffffffff 555e8953 S /system/bin/installd
root      39    1     1548   220   ffffffff 5561b790 S /system/bin/sh
root      64    0     1892   528   00000000 f76ef166 R /system/bin/ps

But servicemanager couldn't start.
on terminal, the error message shows:
> init : untracked pid xxx exited.
> servicemanager exit 4 times in 4 minutes, rebooting into recovery mode.
>...
And I get the log by running adb logcat.

I search the Internet, but I couldn't found the solution.
Couldn't someone help me?
Any suggestion is ok.



在 2016年10月3日星期一 UTC+8下午9:40:53,Jian Wu写道:
To unsubscribe from this group and all its topics, send an email to android-x86...@googlegroups.com.

T.C 吳天健

unread,
Nov 11, 2016, 1:05:25 AM11/11/16
to andro...@googlegroups.com
Per android-x86 4.4 roofs files are in out/target/product/x86/root/ , out/target/product/x86/system ,out/target/product/x86/data/.  Since when lxc-start execute "/init" the kernel were prepared already, initrd.img is not needed.  

Another approach is using out/target/product/x86/android_x86.iso to install it on a vm disk.  And use adb/tar tools to pull the rootfs in vm.


2016-10-26 21:28 GMT+08:00 Jia <zjs...@gmail.com>:

Hello Jian.
I am trying to run android-x86 in a lxc container.
But I am not familiar with android-x86, I don't know how to get the android-x86 rootfs.
And I am trying to compile kernel for android-x86.
Could you help me?
Thanks a lot.


在 2016年10月3日星期一 UTC+8下午9:40:53,Jian Wu写道:
Jose, 
To unsubscribe from this group and all its topics, send an email to android-x86...@googlegroups.com.

To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.

T.C 吳天健

unread,
Nov 11, 2016, 1:08:26 AM11/11/16
to andro...@googlegroups.com
>And I am trying to compile kernel for android-x86.
btw, the regular build process will automatically trigger a lot of build including build asop, building kernel ,etc

If you want to specifically build the kernel you might check this page: http://www.android-x86.org/documents/customizekernel

2016-10-26 21:28 GMT+08:00 Jia <zjs...@gmail.com>:

Hello Jian.
I am trying to run android-x86 in a lxc container.
But I am not familiar with android-x86, I don't know how to get the android-x86 rootfs.
And I am trying to compile kernel for android-x86.
Could you help me?
Thanks a lot.


在 2016年10月3日星期一 UTC+8下午9:40:53,Jian Wu写道:
Jose, 
To unsubscribe from this group and all its topics, send an email to android-x86...@googlegroups.com.

To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages