QemuKVMARM
This page outlines all the necessary step to setup a complete host+guest ARM environment.
If you have access to ARM hardware with hardware virtualization support (e.g. Calxeda ECX 2000, Samsung Exynos 5 or ARM Vexpress A15), skip this section and go straight to section 2.
1) how to setup an arm vexpress a15 host (for x86_64 systems)
Download a rootfs img and a kernel:
apt-get install qemu-user-static qemu-system-arm wget -c http://cloud-images.ubuntu.com/saucy/current/saucy-server-cloudimg-armhf.tar.gz tar zxvf saucy-server-cloudimg-armhf.tar.gz resize-part-image saucy-server-cloudimg-armhf.img 4G wget -c https://launchpad.net/ubuntu/+archive/primary/+files/linux-image-3.11.0-9-generic-lpae_3.11.0-9.16_armhf.deb dpkg -X linux-image-3.11.0-9-generic-lpae_3.11.0-9.16_armhf.deb . mkdir -p tmp mount -o loop -rw saucy-server-cloudimg-armhf.img tmp sudo cp linux-image-3.11.0-9-generic-lpae_3.11.0-9.16_armhf.deb tmp
Setup kernel and serial:
chroot tmp dpkg -i linux-image-3.11.0-9-generic-lpae_3.11.0-9.16_armhf.deb sed 's/tty1/ttyAMA0/g' /etc/init/tty1.conf > /etc/init/ttyAMA0.conf echo "deb http://ports.ubuntu.com saucy main restricted multiverse universe" > /etc/apt/sources.list apt-get update adduser ubuntu rm etc/init/cloud-* sudo passwd exit cp tmp/boot/initrd.img-3.11.0-9-generic-lpae boot umount tmp
Execute qemu:
qemu-system-arm -machine vexpress-a15 -cpu cortex-a15 -m 2048M -kernel boot/vmlinuz-3.11.0-9-generic-lpae -initrd boot/initrd.img-3.11.0-9-generic-lpae -append "console=ttyAMA0 earlyprintk=serial root=/dev/mmcblk0 ro rootfstype=ext4" -serial stdio -dtb lib/firmware/3.11.0-9-generic-lpae/device-tree/vexpress-v2p-ca15-tc1.dtb -drive if=sd,cache=writeback,file=saucy-server-cloudimg-armhf.img -net nic -net user,hostfwd=tcp::2223-:22 -display none
Be patient - on my quad Haswell box it takes about ~2 minutes to boot
Moreover, for the next section, i suggest to ssh into the qemu instance instead of using the serial console: long lines, cut&paste and serial console don't mix very well:
ssh -p 2223 ubuntu@localhost
2) how to setup an arm vexpress a15 guest
Prerequisites: from now we assume we are running inside a Cortex A15 capable host (Calxeda ECX 2000 or ARM Vexpress qemu)
Download a cloud img and qemu:
apt-get install qemu-user-static qemu-system-arm wget -c http://cloud-images.ubuntu.com/saucy/current/saucy-server-cloudimg-armhf.tar.gz tar zxvf saucy-server-cloudimg-armhf.tar.gz mkdir -p tmp mount -o loop -rw saucy-server-cloudimg-armhf.img tmp
Copy the modules and serial to the system:
cp -a /lib/modules/`uname -r`/ tmp/lib/modules/ cp /etc/init/ttyAMA0.conf tmp/etc/init/
Setup the environment:
chroot tmp adduser ubuntu rm etc/init/cloud-* exit umount tmp
Execute qemu:
qemu-system-arm -machine vexpress-a15 -cpu cortex-a15 -enable-kvm -m 512M -kernel /boot/vmlinuz-`uname -r` -append "console=ttyAMA0 earlyprintk=serial root=/dev/mmcblk0 ro rootfstype=ext4" -serial stdio -dtb fw2/vexpress-v2p-ca15-tc1.dtb -initrd boot/initrd.img-`uname -r` -drive if=sd,cache=writeback,file=saucy-server-cloudimg-armhf.img -net nic -net user,hostfwd=tcp::2223-:22 -display none
Kernel/Dev/QemuKVMARM (last edited 2013-09-30 11:28:12 by p-pisati)