Single Linux – QEMU


The below tutorial outlines how to run single instance of virtualized Linux on quad core Cortex-A9 ARM Versatile Express platform simulated by Qemu, using the pre-built binaries.

Demonstration details

  • The following demo is for Versatile Express platform simulated by Qemu.
  • We will run single instance of virtualized Linux kernel over the Codezero hypervisor.
  • Linux will boot using the NFS filesystem over Core0 of the platform.

Downloading the pre-built binaries

Download binaries from here. It contains the following files

  • linux-rootfs.tar.gz – Linux filesystem tarball
  • final.elf – ELF file containing Codezero, and Linux kernels
  • qemu.tar.bz2 – Tarball containing Qemu, with ARM Versatile Express platform support

Setting up the demo

Extract the Linux filesystem on host

$ mkdir -p /opt/projects/fs
$ sudo tar -xvf linux-rootfs.tar.gz

Export NFS -check Setting up NFS section for details.

Extract the Qemu tarball at some convenient location.

Issue the following command to run Codezero and virtualized Linux in Qemu

$ ./qemu/bin/qemu-system-arm -kernel final.elf -M realview-vx-a9 \
                  -cpu cortex-a9 -serial stdio -m 900 -smp 1

Setting up NFS

Install NFS server modules on host

$ sudo apt-get install nfs-kernel-server

Export NFS by appending the following entry in /etc/exports

/opt/projects/fs/rootfs *(rw,nohide,insecure,no_subtree_check,async,no_root_squash,fsid=12345)

Restart the NFS server

$ sudo /etc/init.d/nfs-kernel-server restart

Known issues

  • The boot may be slow. We are using the platform simulation and that too of quad core platform. As Qemu runs all cores serially, hence the slow speed.

Building from sources

Check the Building from Source for Versatile Express page for instructions on building Codezero and Android kernels from the sources.


Comments are closed.