QEMU/Linux guest

This article describes the setup of a Gentoo Linux guest using QEMU.

Host
To create a disk image for the virtual machine, run:

Download a minimal Gentoo LiveCD from here.

Since QEMU requires a lot of options, it would be a good idea to put them into a shell script, e.g.:

Change the path to your disk image in the script. You can additional options when calling the script. To boot the disk image, run:

Install the guest per the Gentoo Handbook. See the guest section for optimum support. After the installation start the script without the additional options.

Hard drive
The VirtIO hard drive is mapped to. Where the handbook refers to, always use when configuring the guest.

Kernel
If you use genkernel do not build the VirtIO drivers as modules, compile them into the kernel.

As an alternative, use these commands after emerging the kernel sources:

GRUB
To install GRUB change your :

Also specify the when setup GRUB to the MBR:

Optional post install guest IPv6 setup
For IPv6 networking see the IPv6 subarticle.

Boot hangs at syslog-ng
If the guest boots slow or hangs on, this is likely due to the lack of entropy. A way to fix this is to enable the "VirtIO Random Number Generator support" (HW_RANDOM_VIRTIO [=y]) in the guest kernel and boot with the QEMU virtio-rng-pci parameter.