LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices

Reply
 
Search this Thread
Old 02-09-2012, 02:57 PM   #1
marietto
Member
 
Registered: Aug 2010
Posts: 31

Rep: Reputation: 6
Run Ubuntu and Android simultaneosly on ARM using LXC.


Hello to everyone. Some time ago I bought the PandaBoard ES. This new board is very very nice. It's fast and powerful,even if a little bit limited with the only ubuntu arm operating system supported. When I work on the board I miss the X86 system. Since that I have understood that I can't have it,I wonder if I can virtualize Android while Ubuntu is running. I'm very interested to have these 2 os's run simultaneusly. After having studied the case,I'm sure there is a way : using the codezero hypervisor (http://www.l4dev.org). The problem is that I haven't found any tutorial that explain how to do...on the net there is only a video,on youtube..another way could be using LXC (Linux Containers). Since I'm almost a newbie,I have documented myself a little bit : I found this tutorial :

http://www.techrepublic.com/blog/ope...tag=rbxccnbtr1

it seems to be very well written. He says the easiest way to set up an LXC-based container is to use an existing base operating system, such as the templates provided by the OpenVZ project,listed here :

http://wiki.openvz.org/Download/template/precreated

but what about if I create a specific template for Android ?. If someone of you is experienced with this,could give me an advice ? I would know if my idea could works. Thanks.

Last edited by marietto; 02-09-2012 at 02:59 PM.
 
Old 02-09-2012, 08:55 PM   #2
jefro
Guru
 
Registered: Mar 2008
Posts: 11,526

Rep: Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404
Did you see this page? http://www.l4dev.org/getting_started
 
Old 02-10-2012, 03:12 AM   #3
marietto
Member
 
Registered: Aug 2010
Posts: 31

Original Poster
Rep: Reputation: 6
yes. but that's a basic tutorial.

I tried to run Android 2.3 simultaneously with Ubuntu 11.10 using LXC.
Here is what I did. you can see what's happened on the pictures attached :

$ cat >> /etc/network/interfaces << EOF

> auto br0
>
> iface br0 inet static
> address 192.168.99.1
> broadcast 0.0.0.0
> netmask 255.255.255.0
> bridge_ports none
> bridge_fd 0
> bridge_maxwait 0
> bridge_hello 0
> bridge_maxage 12
> bridge_stp off
> post-up ip route add 192.168.99.201 dev br0
> EOF

$ ifup br0

mkdir -p /cgroup /media/system /media/cache /media/userdata
tar -xzvf sdcard-android-lxc-rootfs.tar.gz
mkdir -p /srv/lxc/android23
cd sdcard-android-lxc-rootfs
cp -r * /srv/lxc/android23
cd /srv/lxc/android23
nano android23.conf

lxc.utsname = android23
lxc.tty = 4
lxc.rootfs = /srv/lxc/android23

# network
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.ipv4 = 192.168.99.202 0.0.0.0
lxc.network.name = eth0
lxc.network.veth.pair = vethvm2

lxc.cgroup.devices.deny = a # deny all first

# mount points
lxc.mount.entry=none /srv/lxc/android23/proc proc
defaults 0 0
lxc.mount.entry=none /srv/lxc/android23/sys sysfs
defaults 0 0
lxc.mount.entry=/lib /srv/lxc/android23/lib
none ro,bind 0 0
lxc.mount.entry=/usr/share/locale /srv/lxc/android23/usr/share/locale
none rw,bind 0 0

# /dev/null and zero
lxc.cgroup.devices.allow = c 1:3 rwm
lxc.cgroup.devices.allow = c 1:5 rwm

# consoles
lxc.cgroup.devices.allow = c 5:* rwm
lxc.cgroup.devices.allow = c 4:* rwm

# /dev/{,u}random
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 1:8 rwm

# /dev/pts/* - pts namespaces
lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 5:2 rwm

# rtc
lxc.cgroup.devices.allow = c 254:0 rwm

# cpu and memory
#lxc.cgroup.cpuset.cpus = 0
#lxc.cgroup.cpu.shares = 1024
#lxc.cgroup.memory.limit_in_bytes = 512M
#lxc.cgroup.memory.memsw.limit_in_bytes = 512M

# 10:* devices
lxc.cgroup.devices.allow = c 10:0 rwm # dev/pmem
lxc.cgroup.devices.allow = c 10:1 rwm # dev/pmem_adsp
lxc.cgroup.devices.allow = c 10:2 rwm # dev/pmem_camera
lxc.cgroup.devices.allow = c 10:223 rwm # dev/uinput

lxc.cgroup.devices.allow = c 10:30 rwm
lxc.cgroup.devices.allow = c 10:31 rwm
lxc.cgroup.devices.allow = c 10:32 rwm
lxc.cgroup.devices.allow = c 10:33 rwm
lxc.cgroup.devices.allow = c 10:34 rwm
lxc.cgroup.devices.allow = c 10:35 rwm
lxc.cgroup.devices.allow = c 10:36 rwm
lxc.cgroup.devices.allow = c 10:37 rwm
lxc.cgroup.devices.allow = c 10:39 rwm

lxc.cgroup.devices.allow = c 10:40 rwm # /dev/keychord
lxc.cgroup.devices.allow = c 10:41 rwm
lxc.cgroup.devices.allow = c 10:42 rwm
lxc.cgroup.devices.allow = c 10:43 rwm
lxc.cgroup.devices.allow = c 10:44 rwm
lxc.cgroup.devices.allow = c 10:45 rwm
lxc.cgroup.devices.allow = c 10:46 rwm
lxc.cgroup.devices.allow = c 10:47 rwm
lxc.cgroup.devices.allow = c 10:48 rwm
lxc.cgroup.devices.allow = c 10:49 rwm

lxc.cgroup.devices.allow = c 10:50 rwm
lxc.cgroup.devices.allow = c 10:51 rwm
lxc.cgroup.devices.allow = c 10:52 rwm
lxc.cgroup.devices.allow = c 10:53 rwm
lxc.cgroup.devices.allow = c 10:54 rwm
lxc.cgroup.devices.allow = c 10:55 rwm
lxc.cgroup.devices.allow = c 10:56 rwm
lxc.cgroup.devices.allow = c 10:57 rwm
lxc.cgroup.devices.allow = c 10:58 rwm
lxc.cgroup.devices.allow = c 10:59 rwm

lxc.cgroup.devices.allow = c 10:60 rwm
lxc.cgroup.devices.allow = c 10:61 rwm
lxc.cgroup.devices.allow = c 10:62 rwm
lxc.cgroup.devices.allow = c 10:63 rwm

# dev/input/*
lxc.cgroup.devices.allow = c 13:64 rwm # event0 -> lightsensor-level
lxc.cgroup.devices.allow = c 13:65 rwm # event1 -> h2w headset
lxc.cgroup.devices.allow = c 13:66 rwm # event2 -> compass
lxc.cgroup.devices.allow = c 13:67 rwm # event3 -> synaptics-rmi-touchscreen
lxc.cgroup.devices.allow = c 13:68 rwm # event4 -> proximity
lxc.cgroup.devices.allow = c 13:69 rwm # event5 -> mahimahi-keypad
lxc.cgroup.devices.allow = c 13:70 rwm # event6 -> mahimahi-nav

lxc.cgroup.devices.allow = c 29:0 rwm # dev/fb0
lxc.cgroup.devices.allow = c 31:* rwm # dev/block/mtdblock*
lxc.cgroup.devices.allow = c 90:* rwm # dev/mtd
lxc.cgroup.devices.allow = c 108:0 rwm # dev/ppp
lxc.cgroup.devices.allow = c 179:* rwm # dev/block/mmcblk0*
lxc.cgroup.devices.allow = c 248:* rwm # control0, config0, frame0
lxc.cgroup.devices.allow = c 251:0 rwm # dev/q6venc
lxc.cgroup.devices.allow = c 252:0 rwm # dev/vdec
lxc.cgroup.devices.allow = c 250:0 rwm # dev/ttyHS0
lxc.cgroup.devices.allow = c 253:* rwm


lxc-create -f /srv/lxc/android23/android23.conf -n android23
lxc-start android23

I think that it worked and that I need to continue configuring
init.rc, init, DalvikVM, system_server, busybox (route), dns, etc... ?
Attached Images
File Type: png Schermata del 2012-02-11 13_37_23.png (161.3 KB, 7 views)
File Type: png Schermata del 2012-02-11 13_30_11.png (123.0 KB, 7 views)

Last edited by marietto; 02-11-2012 at 08:20 AM.
 
Old 02-12-2012, 05:15 PM   #4
marietto
Member
 
Registered: Aug 2010
Posts: 31

Original Poster
Rep: Reputation: 6
I don't know.

Last edited by marietto; 02-12-2012 at 05:20 PM.
 
Old 06-02-2012, 09:04 AM   #5
specter007
LQ Newbie
 
Registered: Jun 2012
Posts: 1

Rep: Reputation: Disabled
Question

If I try your solution, Android doesn't show up

Do you know why the init process ended on signal 11?

LXC log:
Code:
...
      lxc-start 1338642976.769 NOTICE   lxc_conf - 'android23' is setup.

      lxc-start 1338642976.775 NOTICE   lxc_start - exec'ing '/sbin/init'

      lxc-start 1338642976.783 NOTICE   lxc_start - '/sbin/init' started with pid '1145'

      lxc-start 1338642976.791 DEBUG    lxc_utmp - Added '/srv/android23/rootfs/var/run' to inotifywatch

      lxc-start 1338642977.088 DEBUG    lxc_start - container init process exited

      lxc-start 1338642977.321 INFO     lxc_error - child <1145> ended on signal (11)

      lxc-start 1338642977.340 DEBUG    lxc_cgroup - using cgroup mounted at '/cgroup'

      lxc-start 1338642977.348 DEBUG    lxc_cgroup - '/cgroup/android23' unlinked
 
  


Reply

Tags
android, arm9, linux, ubuntu, virtualization


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: OLPC's XO 3 tablet uses 1GHz ARM SoC to run Sugar Linux or Android LXer Syndicated Linux News 0 01-10-2012 10:20 PM
LXer: ARM releases free Android development toolkit LXer Syndicated Linux News 0 11-29-2011 10:00 AM
LXer: Android-x86 - run Google Android on a netbook LXer Syndicated Linux News 0 12-06-2009 01:30 PM
LXer: Computex: Where Are ARM and Android-Based Netbooks? LXer Syndicated Linux News 0 06-06-2009 06:10 AM
LXer: Canonical developers aim to make Android apps run on Ubuntu LXer Syndicated Linux News 0 05-27-2009 12:20 PM


All times are GMT -5. The time now is 11:10 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration