Just moozing

Before you can check your notes, you must make them…

Nested KVM

leave a comment »

Yes, you can have virtual machines running in virtual machines running in virtual machines running in virtual machines running in virtual machines …

It is called nested KVM, and Linux has supported it for quite some time. In order to debug scripts involving setting up a virtualization environment, it is very useful. I found some good resources and it tuns out to be trivial.

This post is about intel chipsets. I suspect something similar is available for AMD.

 

Enable it on the host

Create /etc/modprobe.d/kvm.conf with


options kvm-intel nested=y

either reboot the machine or remove/install modules

rmmod kvm-intel
modprobe kvm-intel

Check that it worked

cat /sys/module/kvm_intel/parameters/nested

It should say “Y”

 

virt-manager processor configurationEnable it in virt-manager

In virt-manager, there a menu entry for “processor” -> configuration. It must be set to “Copy host CPU configuration”.

Check that it works by checking if the processor has the “vmx” (virtual machine extension) flag.

cat /proc/cpuinfo | grep vmx

 

Enable it in your Vagrantfile

The plugin has a nice switch for it

libvirt.nested = true

 

Nesting

I am planning on doing a puppet development environment in a virtual machine that spins up virtual machines.

Advertisements

Written by moozing

June 3, 2015 at 12:00

Posted in Tech

Tagged with , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: