XEN - Android as domU

Moderators: mdrjr, odroid

XEN - Android as domU

Unread postby suriyan » Wed Sep 03, 2014 7:32 am

Hello Android community experts! Greetings!!

Firstly thanks to codewalker, voodik, nanik tolaram and of course the hardkernel folks for this awesome android support on the XU!

OK, now what am I looking for?
- I am trying to get Android working as a domU in XEN. Linux (ubuntu) works fairly well as domU. Hence, I do have a good working mainline kernel (3.17) as the domU kernel. Also XEN FB is working and hence the FB comes up as I start the dom. So, in essence I get a nice window under X which is the FB for the domU. So far so good.
- What modifications do I need to do to the Android image to get it working as domU. For instance, I can have /dev/loop0 in dom0 mapped to /dev/xvda in the Android domU (which is /dev/mmcblk0p* when booted bare metal). I did see that there are entries in fstab.odroidxu which have /dev/mmcblk0p* mounted as /system, /data etc. So, that is one change. What are the other changes?

If someone, can give me a bare Android image which I can then play with to get things rolling that would be a good start. Also, comment on potential *.rc files that might need tweaking would be awesome!

I am trying to save time, else for me to dig into the Android world will take quite a bit of my time. Hence this post!

Thanks
- Suriyan
suriyan
 
Posts: 473
Joined: Wed Jun 26, 2013 2:41 pm
languages_spoken: english
ODROIDs: odroid-u2/xu-e/u3/x2/xu3/c1

Re: XEN - Android as domU

Unread postby suriyan » Sat Sep 06, 2014 10:34 am

This is XEN on the XU in action. Its running xen 4.5 as the hypervisor.
dom0 on 2 vCPUs with 512 MB memory -> Ubuntu
domL on 2 vCPUs with 512 MB memory -> Ubuntu
domA on 2 vCPUs with 512 MB memory -> Android jellybean.

This is just a POC. With more memory with future Hardkernel products this should be more interesting!
- Suriyan

OdroidXU-Xen.png
OdroidXU-Xen.png (927.64 KiB) Viewed 14473 times
suriyan
 
Posts: 473
Joined: Wed Jun 26, 2013 2:41 pm
languages_spoken: english
ODROIDs: odroid-u2/xu-e/u3/x2/xu3/c1

Re: XEN - Android as domU

Unread postby odroid » Sat Sep 06, 2014 10:42 am

Oh! 3 OSes can run in parallel. :o
User avatar
odroid
Site Admin
 
Posts: 25306
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: XEN - Android as domU

Unread postby suriyan » Sat Sep 06, 2014 12:18 pm

That is quite exciting, odroid!
Theoretically we can have numerous OSes running, but I am wondering if there is any use to that :-). I think without GUI and stuff, we could potentially get Linux running in about 128MB or less or so?
- Suriyan
suriyan
 
Posts: 473
Joined: Wed Jun 26, 2013 2:41 pm
languages_spoken: english
ODROIDs: odroid-u2/xu-e/u3/x2/xu3/c1

Re: XEN - Android as domU

Unread postby iprouteth0 » Fri Jan 30, 2015 1:04 pm

I've been searching around a bit and was hoping someone could point me to a how to our write up on using xen on the xu. Also between xen, kvm, qemu, and maybe something like openvz, what is the best or recommended virtualization hypervisor to use?
iprouteth0
 
Posts: 19
Joined: Tue Jun 17, 2014 3:09 am
languages_spoken: english
ODROIDs: Odroid-XU lite, odroid C1

Re: XEN - Android as domU

Unread postby suriyan » Sat Jan 31, 2015 3:01 am

Information on using xen on the XU is covered in the XEN wiki page: http://wiki.xenproject.org/wiki/Xen_ARM ... s/OdroidXU
suriyan
 
Posts: 473
Joined: Wed Jun 26, 2013 2:41 pm
languages_spoken: english
ODROIDs: odroid-u2/xu-e/u3/x2/xu3/c1

Re: XEN - Android as domU

Unread postby charlescho64 » Tue Sep 08, 2015 12:15 pm

Plz, Anybody help me to fix this problem....

I tried to port xen on xu with ubuntu14.04 and android. I passed /system, /userdate, and /cache to android with loop back.
In Dom0, I set disk with "disk = ['phy:/dev/loop0, xvda, w', 'phy:/dev/loop1, xvdb, w', 'phy:/dev/loop2, xvdc,w' ]" and "losetup /dev/loop0 /dev/mmcmmcblk1p3, losetup /dev/loop1 /dev/mmcmmcblk1p5, and losetup /dev/loop2 /dev/mmcmmcblk1p6"

And using xl comman, create android guest(xl create ***.cfg).

kernel is booting and found xvda, xvdb, and xvdc, but strange message is out like "xvda: unknown partition table" and setting capacity. Is it wrong or not, I don't know.
---------------------------------- kernel log ------------------
[ 0.420950] xvda: unknown partition table
[ 0.428511] blkfront: xvdb: flush diskcache: enabled; persistent grants: enabled; indirect descriptors: enabled;
[ 0.486950] xvdb: unknown partition table
[ 0.490493] blkfront: xvdc: flush diskcache: enabled; persistent grants: enabled; indirect descriptors: enabled;
[ 0.499035] xvdc: unknown partition table
[ 0.499798] Setting capacity to 1572864
[ 0.499828] xvda: detected capacity change from 0 to 805306368
[ 0.500271] Setting capacity to 524256
[ 0.500298] xvdb: detected capacity change from 0 to 268419072
[ 0.500800] Setting capacity to 1179616
[ 0.500826] xvdc: detected capacity change from 0 to 603963392
....................................................................................

finally, it can't mount /dev/xvda to /system
---------------------------------- kernel log ------------------
[ 21.015273] fs_mgr: Cannot mount filesystem on /dev/xvda at /system
[ 21.015332] init: fs_mgr_mount_all returned an error
--------------------------------------------------------------------

In fstab file in android, I changed xvda, xvdb, and xvdc node are mount to /system, /cache, /userdata.
--------------------------------------------------------------------
/dev/xvda /system ext4 rw wait
/dev/xvdb /cache ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait
/dev/xvdc /data ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait
--------------------------------------------------------------------

BR

Thanks
charlescho64
 
Posts: 8
Joined: Tue Sep 08, 2015 11:04 am
languages_spoken: english
ODROIDs: xu

Re: XEN - Android as domU

Unread postby suriyan » Wed Sep 09, 2015 1:08 pm

Hi charlescho64,
Couple of questions.
Q1) Is this on the XU? and not on the XU3/XU4?

Some comments (though not relevant to your issue), you could directly use:
"disk = ['phy:/dev/mmcblk1p3, xvda, w', 'phy:/dev/mmcblk1p5, xvdb, w', 'phy:/dev/mmcblk1p6, xvdc,w' ]"

"unknown partition table" can be ignored, as you are passing the partition (which does not have a partition table), so its OK.
You are using mmcmmcblk1p*, is that correct? I think it should be mmcblk1p* instead. I am assuming its some typo.
Do a fdisk -l /dev/mmcblk1 and check paritions 3, 5, 6 and compare with what the domU boot log is showing, possibly they are correct.
Check if you have ext4 FS is built in to the kernel domU build, as its not able to mount it.
Is there some way you can check the logs of fs_mgr_mount_all to know what the real error message is?
suriyan
 
Posts: 473
Joined: Wed Jun 26, 2013 2:41 pm
languages_spoken: english
ODROIDs: odroid-u2/xu-e/u3/x2/xu3/c1

Re: XEN - Android as domU

Unread postby charlescho64 » Fri Sep 18, 2015 12:06 pm

Hi, suriyan

Thank you for your kind reply.
It's just different in kernel version for DOM0. I used kernel 3.18.

So, I stop my way and try to get 3 guests on xu board like your result on your guide.

first of all, I try to get DOM0(ubuntu) following your guide(http://wiki.xenproject.org/wiki/Xen_ARM ... s/OdroidXU). when I used odroid ubuntu image without xen, ubuntu work(login screen appear thought mini HDMI) with id:odroid/pw:ubuntu. but with xen, login screen don't appear thought mini HDMI with below message and login message on hyper-terminal with any id/pw that I guess.
.......................................................................................................................
[ 139.134379] samsung-i2s 3830000.i2s: i2s_set_sysclk:542 Other DAI busy

Ubuntu 14.04 LTS odroid-desktop hvc0

odroid-desktop login:

.......................................................................................................................

I think I fully follow your guide. if it's different, maybe coss-compiler is.
I used cross-compiler (https://releases.linaro.org/15.02/compo ... ihf.tar.xz)

BR
Last edited by charlescho64 on Fri Sep 18, 2015 2:32 pm, edited 1 time in total.
charlescho64
 
Posts: 8
Joined: Tue Sep 08, 2015 11:04 am
languages_spoken: english
ODROIDs: xu

Re: XEN - Android as domU

Unread postby suriyan » Fri Sep 18, 2015 1:31 pm

As this is the XU forum, I shall assume that you are indeed using XU and not the XU3.
The xen wiki should be correct. One moew person (Tomas) did get it working following the wiki.
Nonetheless, I too shall follow the wiki and see if I too hit your issues.
What version of xen are you using?
Did you try disabling X/xdm on startup and see if it reaolves anything?
suriyan
 
Posts: 473
Joined: Wed Jun 26, 2013 2:41 pm
languages_spoken: english
ODROIDs: odroid-u2/xu-e/u3/x2/xu3/c1

Re: XEN - Android as domU

Unread postby charlescho64 » Fri Sep 18, 2015 2:39 pm

I really use odroid-XU board.

The xen version I used is Xen-4.5.

I hope you let me know how to disable X/xdm.

Thanks.
charlescho64
 
Posts: 8
Joined: Tue Sep 08, 2015 11:04 am
languages_spoken: english
ODROIDs: xu

Re: XEN - Android as domU

Unread postby charlescho64 » Fri Sep 18, 2015 3:31 pm

About the problem to login in hyper terminal, I have solved with workaround that remove password like below in /etc/passwd file
.............................................../etc/passwd @ rootfs directory ................................................
odroid:x:1000:1000:,,,:/home/odroid:/bin/bash ---> odroid::1000:1000:,,,:/home/odroid:/bin/bash
.................................................................................................................................................

But I still don't get the login screen through mini-HDMI.
charlescho64
 
Posts: 8
Joined: Tue Sep 08, 2015 11:04 am
languages_spoken: english
ODROIDs: xu

Re: XEN - Android as domU

Unread postby charlescho64 » Wed Sep 23, 2015 12:23 pm

Hello,
Anybody help me.

I try to operate three OSes on odroid XU with xen.

current, I follow the guide site of suriyan to boot ubuntu as dom0 on xen, but the screen of ubuntu login appear for few time(<1second) and then disappear on external screen. login line is on the hyper-terminal.

BR
charles
charlescho64
 
Posts: 8
Joined: Tue Sep 08, 2015 11:04 am
languages_spoken: english
ODROIDs: xu

Re: XEN - Android as domU

Unread postby charlescho64 » Wed Sep 23, 2015 5:55 pm

The issue the screen of login don't appear is clear and the way is simple to press "Ctrl+Alt+F1" keys, go to command window and then press "Ctrl+Alt+F7" to go login screen.
charlescho64
 
Posts: 8
Joined: Tue Sep 08, 2015 11:04 am
languages_spoken: english
ODROIDs: xu

Re: XEN - Android as domU

Unread postby charlescho64 » Thu Sep 24, 2015 6:23 pm

Hello, suriyan

May I have question about viewing guest on dom0 window?

1. how to configure "guest DomU" for vnc" ?
I tried to set "vnc parameter " like below.
................................guest.conf...........................................................
kernel = "/home/odroid/guests/zImage"
name = "ubuntu_domu"
memory = 128
vcpus = 2
cpus = ['2','3']
disk = [ 'phy:/dev/loop0,xvda,w' ]
vif = ['bridge=xenbr0']
extra = "earlyprintk=xenboot console=hvc0 rw rootwait root=/dev/xvda"
vnc = 1
vnclisten ="0.0.0.0"
vncpasswd =""
...........................................................................................

2. how to connect to guest domu with vncviewer or other?
I tried to connect guest DomU with "xl vncviewer ubuntu_domu", but it's not anything.

BR.
charlescho64
 
Posts: 8
Joined: Tue Sep 08, 2015 11:04 am
languages_spoken: english
ODROIDs: xu

Re: XEN - Android as domU

Unread postby charlescho64 » Wed Oct 07, 2015 10:55 am

Hello All

I have workaround about vnc. Maybe I think there are so many solution to get good result.
Now, I don't have good idea about this.

Any way, the way I used is below...

On Dom-U(ubuntu) I installed "vnc4server"(sudo apt-get install vnc4server) and then set the environment of vnc server (vncserver :1 -geometry 1200x675 -depth 24)
On Dom-0(ubuntu) I installed "Remmina remote desktop client" application on ubuntu software center and then executed this client program and filled some variables with vnc server infomation( ip(vnc server ip (dom-u)/port(port is 5901 -- 5900 plus number refered to vnc server port), id, and passwd)

In my case, I saw simple window with hyper-terminal, browser and simple interfaces unlike the result of "suriyan".

Anybody help me to get the same result of "suriyan"

BR
charlescho64
 
Posts: 8
Joined: Tue Sep 08, 2015 11:04 am
languages_spoken: english
ODROIDs: xu

Re: XEN - Android as domU

Unread postby exescript » Thu May 05, 2016 11:18 pm

Hello! Great work, suriyan! Do you plan to make some step-by-step tutorial about how to install Android system as DomU ? I instaled Xen and Ubuntu server really works great as dom0 and domU. But I can't really do the same with Android.
exescript
 
Posts: 2
Joined: Thu May 05, 2016 11:12 pm
languages_spoken: english, russian

Re: XEN - Android as domU

Unread postby exescript » Fri May 06, 2016 12:00 am

I forgot to clarify that I use XU4
exescript
 
Posts: 2
Joined: Thu May 05, 2016 11:12 pm
languages_spoken: english, russian

Re: XEN - Android as domU

Unread postby D_YES » Fri Sep 23, 2016 10:01 pm

Dear all,

Can you please give me a template of configuration file to run android as DomU ?
D_YES
 
Posts: 1
Joined: Fri Sep 23, 2016 12:33 am
languages_spoken: english
ODROIDs: odroid c2

Re: XEN - Android as domU

Unread postby dansope » Wed Feb 22, 2017 4:36 am

I am replying in this thread as a "bump" for a request of template, instructions or help file to run android as Dom-U.
dansope
 
Posts: 8
Joined: Wed Feb 22, 2017 3:44 am
languages_spoken: english
ODROIDs: xu-3

Re: XEN - Android as domU

Unread postby peng » Wed Feb 22, 2017 8:52 pm

I also encounter problem when I create android guest VM. The problem looks like the filesystem cannot be found.

I tried several ways but the error remains.

First of all, I follow this guide http://odroid.com/dokuwiki/doku.php?id=en:xu4_xen and successfully put ubuntu 14.04 as domU OS. Therefore, in theory, It means xen hypervisor is working normally.
Then I just directly try to put system.img, userdata.img as well as ramdisk.img into my odroid XU4 and use this .cfg.
kernel ="/root/android/zImage"
memory = 512
maxmem = 512
name = "dom_android"
vcpus = 2
cpus = ['2']
serial="pty"
vif = ['bridge=xenbr0']
disk = [ 'phy:/root/android/system.img,xvda,w','phy:/root/android/userdata.img,xvdb,w','phy:/root/android/ramdisk.img,xvdc,w' ]
extra = 'console=hvc0 xencons=tty root=/dev/xvda rw'

Of course, I meet problem. And the error likes the following:
0.540539] ALSA device list:
[ 0.540558] No soundcards found.
[ 0.541949] EXT3-fs (xvda): error: couldn't mount because of unsupported optional features (40)
[ 0.542777] EXT2-fs (xvda): error: couldn't mount because of unsupported optional features (40)
[ 0.543786] EXT4-fs (xvda): bad geometry: block count 458752 exceeds size of device (26352 blocks)
[ 0.547359] EXT3-fs (xvda): error: couldn't mount because of unsupported optional features (40)
[ 0.547955] EXT2-fs (xvda): error: couldn't mount because of unsupported optional features (40)
[ 0.548901] EXT4-fs (xvda): bad geometry: block count 458752 exceeds size of device (26352 blocks)
[ 0.552021] List of all partitions:
[ 0.552085] 0100 8192 ram0 (driver?)
[ 0.552131] 0101 8192 ram1 (driver?)
[ 0.552176] 0102 8192 ram2 (driver?)
[ 0.552248] 0103 8192 ram3 (driver?)
[ 0.552292] 0104 8192 ram4 (driver?)
[ 0.552362] 0105 8192 ram5 (driver?)
[ 0.552406] 0106 8192 ram6 (driver?)
[ 0.552470] 0107 8192 ram7 (driver?)
[ 0.552516] 0108 8192 ram8 (driver?)
[ 0.552583] 0109 8192 ram9 (driver?)
[ 0.552628] 010a 8192 ram10 (driver?)
[ 0.552672] 010b 8192 ram11 (driver?)
[ 0.552717] 010c 8192 ram12 (driver?)
[ 0.552760] 010d 8192 ram13 (driver?)
[ 0.552803] 010e 8192 ram14 (driver?)
[ 0.552847] 010f 8192 ram15 (driver?)
[ 0.552901] ca00 105408 xvda driver: vbd
[ 0.552945] ca10 563200 xvdb driver: vbd
[ 0.552990] ca20 1720 xvdc driver: vbd
[ 0.553029] No filesystem could mount root, tried: ext3 ext2 ext4 cramfs vfat msdos romfs

In total, I think filesystem is not good assigned correctly. Okay, here, I want to mention i also did this $ vi ./etc/fstab
/etc/fstab
/dev/xvda / ext4 errors=remount-ro 0 1
I think I put this content into fstab.ranchu as well as fstab.odroidxu.

Another try is like this: since userdata.img and system.img are both mounted by ramdisk.img during the runtime. And the system folder and data folder in the same directory with these image files are both sharing the same content with system.img and userdata.img. Therefore, I extract ramdisk.img and put content in system and data folder into the corresponding folders under ramdisk and then recreate ramdisk.img again. Lastly, I use this image file.
The way how to extract and modify and recreate ramdisk.img can be found with the following links:
1. https://hvera.wordpress.com/2010/10/19/ ... mdisk-img/
2. http://benno.id.au/blog/2007/11/18/andr ... rk-startup
3.
With this try I aslo did not get the expect result and the error is also like the filesystem cannot be found.

At last, I consider with the android as dom0 OS with this link viewtopic.php?f=60&t=4475&start=140
I found putting these three img files into big one is not a good idea. But I do not know how to handle the problem.

Can anyone tell me how to solve this filesystem mount problem?
peng
 
Posts: 2
Joined: Thu Oct 27, 2016 6:44 pm
languages_spoken: english
ODROIDs: odroid xu 4
odroid xu

Re: XEN - Android as domU

Unread postby dansope » Fri Apr 21, 2017 9:14 am

I am trying to deploy android as dom-U as well

Things I've done so far...

I noticed there were fstab files in both ramdisk.img and system.img (after unpacking)
So I modified each fstab as followed

/dev/block/xvda / system
/dev/block/xvdb / data
/dev/block/xvdc / cache

I also built xen enabled kernel by following dokuwiki steps but using odroidxu_defxonfig
Got a few errors, so decided to manually make a .config with xen settings enabled

Config file is the same as dokuwiki but added

ramdisk = "/root/ramdisk.img"
disk = ['phy:/root/system.img, xvda, w', 'phy:/root/userdata.img, xvdb, w', 'phy:/root/cache.img, xvdc, w'

when I run "xl create -c domA.img"

I get no console output...

However running an lsblk command shows loop1, loop2, and loop3 but with wrong file sizes

I am not sure what to do next
dansope
 
Posts: 8
Joined: Wed Feb 22, 2017 3:44 am
languages_spoken: english
ODROIDs: xu-3

Re: XEN - Android as domU

Unread postby amarnaththillai » Thu Jul 06, 2017 3:32 pm

hey guys,

I have a working Dom-0 installed on odroid-xu4 , I've the same issue,
my terminal stuck after I ran "xl create -c domU.img"
Anyone here successfully installed and ran Android as domU?

Thanks,
amarnaththillai
 
Posts: 2
Joined: Wed Jun 28, 2017 2:16 pm
languages_spoken: english, tamil
ODROIDs: xu4

Re: XEN - Android as domU

Unread postby jayadevk » Mon Dec 11, 2017 2:43 pm

Hello all,

I'm trying to set up an android guest on XU4 board. I'm stuck at mounting the file system for the guest. Do we need to manually mount/copy the contents of various images(system.img,userdata.img etc.) and create a file system image? Is there a way where we can specify the paths to these images in the configuration file so that it is parsed appropriately and the file system gets mounted ? Can someone share a working configuration file that can be used for an android guest. Any help is appreciated.I have been stuck here for quite a while !

Thanks and regards,
Jay
jayadevk
 
Posts: 1
Joined: Mon Dec 11, 2017 2:34 pm
languages_spoken: english
ODROIDs: XU4,XU


Return to Android

Who is online

Users browsing this forum: No registered users and 3 guests