Guest operating systems running on virtualised systems needs to cooperate with the underlying hypervisors when using virtualised resources. Virtio is a set of standard for disk and network virtualisation that is required to be installed on instances that runs on Openstack. The default Androidx86 kernel does not come with these modules installed. Also, you have to edit the source code of Androidx86 OS to detect the virtualised block devices. Otherwise you will see a screen with "Detecting Android-x86... (continuous dots :s)".
This is what you will see in androidx86 debug mode:
If you do not want to compile the source and set it up yourself. I have already created the image for you. Download it from
here.
1. First, to compile the OS you have to initialise the build environment. Follow instructions
here.
2. Download and install the repo client using instructions
here.
3. Download Androidx86 source from
here.
4. Alter the kernel defconfig files in "kernel/arch/x86/configs/android-x86_defconfig"
and "kernel/arch/x86/configs/android-x86_64_defconfig" by adding following lines.
CONFIG_VIRT_DRIVERS=Y
CONFIG_VIRTIO=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_MMIO=m
CONFIG_VIRTIO_BALLOON=m
CONFIG_VIRTIO_BLK=y
CONFIG_VIRTIO_NET=m
CONFIG_VIRTIO_RING=m
CONFIG_VIRTIO_CONSOLE=m
CONFIG_HW_RANDOM_VIRTIO=m
5. To be able to detect virtual block devices, alter the "bootable/newinstaller/initrd/init" file.
In line 124, Change
for device in ${ROOT:-/dev/sr* /dev/[hs]d[a-z]* /dev/mmcblk*}; do
to
for device in ${ROOT:-/dev/sr* /dev/[hsv]d[a-z]* /dev/mmcblk*}; do
6. Insert following lines to device/generic/x86/init.sh
#Force dhcp on eth0 interface.
netcfg eth0 dhcp
#Start SSH daemon at startup.
start-ssh
7. Add follwing packages to PRODUCT_PACKAGES in device/generic/x86/packages.mk.
ssh-keygen
sshd_config
start-ssh
8. Then compile.
9. Install androidx86 OS onto a disk storage (dvi, vmdk, qcow2) .
10. To fetch the nova keypair, create
fetchsshkeys script with following lines in /data/local/.
#!/system/bin/sh
# Fetch public key using HTTP
cd /data
wget http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key
cat /data/openssh-key > /data/ssh/authorized_keys
chmod 0600 /data/ssh/authorized_keys
restorecon /data/ssh/authorized_keys
rm /data/openssh-key
11. Make the script executable.
chmod 755 /data/local/fetchsshkeys
12. Call the script in /etc/init.sh file.
#Fetch ssh keys from openstack metadata service.
/data/local/fetchsshkeys
13. Upload the disk to Glance.
It should now detect /dev/vda1.
14. Create a virtual machine using the uploaded image. Your VM should get a private ip. (Make sure to specify a keypair)
15. You should be able to ssh into the androidx86 VM now.
16. To get get GUI, add "nomodeset" to grub.
Thanks to everyone helped me on this issue from Androidx86 mailing list.