Tuesday, July 3, 2012

HowTo - Porting Android-x86 onto Qemu-KVM

Before you start, you need to install a lot of packages.  Please refer to


Generating a new virtual machine:

1. Create a file for storing Android-x86 disk image.

$ qemu-img create android-4.0.img 4G

2. Install the system from the cd image (the iso file).
$ kvm -m 2047 -cdrom your_iso_file.iso -hda android-4.0.img -boot d

Install the os to the disk as usual.

After creating a faked SD, do not reboot. Shut down the window.

4. Start the virtual machine.
$ sudo kvm -m 2047 -hda android-4.0.img -net nic,model=pcnet -net tap

For the file size, the numbers matter, so don't be stingy. 

Notice the net model should be pcnet and the second net should be tap. Tap requires root privilege. 

If you don't have a public bridge yet, you need to set up one first. Please refer to 

Briefly, if you are using Ubuntu, the network configuration can be done by doing the follows: (on the host)

# vi /etc/network/interfaces

# Replace old eth0 config with br0
auto eth0 br0
# Use old eth0 config for br0, plus bridge stuff
iface br0 inet dhcp
    bridge_ports    eth0
    bridge_stp      off
    bridge_maxwait  0
    bridge_fd       0
# /etc/init.d/networking restart

On the guest because you are actually using a virtual eth0 device, you need to modify your /etc/network/interfaces file to configure eth0. 

No comments:

Post a Comment