User:Renich/Funtoo on KVM/Qemu and Virtio

From Funtoo
< User:Renich
Revision as of 08:55, June 6, 2014 by Renich (talk | contribs) (article updated to use update-env and enable virtio during boot.)
Jump to navigation Jump to search
   Warning
This article is still in development

Funtoo is KVM/ Qemu ready.

In order for it to work, you need to make sure that you've enabled Virtio support on the kernel.

Pre-Requisites

Procedure

Carry on until you reach the Configuring and installing the linux kernel section.

Step 1: Install Genkernel

emerge sys-kernel/genkernel

Step 2: Install the vanilla sources

emerge sys-kernel/vanilla-sources

Step 3: Start configuring and building the kernel

genkernel --all-ramdisk-modules --menuconfig all

Step 4: Search and enable the essential Virtio drivers

To be able to search for all Virtio options, just type / on the TUI (Terminal User Interface) and, then, type 'virtio'. Please, consult: KVM's website in order to get a list of options available in the Kernel's config.

   Note
The console will let you know what is available. Pay special attention to the location section.

Step 5: Continue with Funtoo Linux Installation Guide

=== Step 6: boot.conf After installing boot-update, edit /etc/boot.conf and make it look something like:

...
"Funtoo Linux genkernel" {
        kernel kernel[-v]
        initrd initramfs[-v]
        params += real_root=auto
        params += real_rootfstype=btrfs
        params += real_rootflags=subvol=root
        params += doload=virtio_pci,virtio_blk,virtio_net
}

Basically, we added some parameters so we ensure our virtual machine boots.

real_rootfstype
This flag helps GRUB determine the fs type.
real_rootflags
This flag adds the BtrFS flags we need in case we used a sub volume for the root fs.
doload
Will take of loading the virtio drivers needed for your image to be functional.

Please, remember to run Boot-Update once you're done.

Testing

Boot the Guest

You should be able to boot the guest without problems. If you're using virt-manager, then just hit "play" on the Guest. If you're a commandline dude, please, issue the following command:

qemu-kvm -boot c -drive file=/var/lib/libvirt/images/funtoo.img,if=virtio -m 512

Troubleshooting

Reference