Jump to content

Nested Virtualization?


Recommended Posts

Scenario: Android developer using a Windows VM needing an android VM (ie: Genymotion) for testing. Genymotion uses VirtualBox as it's underlying virtualization platform, in fact it's a prerequisite prior to installing. Genymotion interacts with VB behind the scenes.

 

Pretty fringe use-case so while interesting, probably not anywhere soon on the roadmap for us.

Link to comment
  • 2 months later...

Sorry if I'm a bit late to the party, but I'm also interested in nested virtualization on unRAID. As a developer, you are pretty often faced with using VMs. Not just as mentioned above using Android but for web development as well (vagrant is pretty popular out there and makes lives much easier, but requires Virtual Box).

 

In theory, nested virtualization is not that hard. Here's a pretty straight forward guide to how to enable this: https://fedoraproject.org/wiki/How_to_enable_nested_virtualization_in_KVM

 

The company I work for also uses this on a daily basis and it's working smooth (besides some edge-cases when using nested-nested virtualization; you won't go there).

 

I'll try to enable this manually on my unRAID setup, but I'd love to see this feature in an upcoming version. Would make it almost perfect for me.

 

Thanks

 

LiPolymer

Link to comment
  • 3 weeks later...

So just thought I'd revive this topic since I actually tested this yesterday and boy was it easy to enable.  In fact, everyone should be able to do this right now if they want.  Here's how to do it in pretty much two steps from command line (SSH or telnet):

 

NOTE:  I only tested this with Intel, but it should work with AMD as well.  Please make sure you have all VMs stopped (as well as VM manager) before doing this.

 

First, from command line, type the following:

 

modprobe -r kvm_intel

 

Then type this:

 

modprobe kvm_intel nested=1

 

DONE!  Now go install another hypervisor as a VM on unRAID!

 

If you have an AMD-based CPU and want to try this, just replace the word "intel" with "amd" in the commands above and it should work.

Link to comment

Hey Jon,

 

That's great news. I'm trying to give it a go (using AMD), issued both commands and installed Virtualbox and Genymotion. The Android VM (in windows 7 64bit) seems unable to boot with the following message:

 

tsc: Fast TSC calibration failed

Odd, counter constraints enabled but no core perfctrs detected!

Failed to access perfctr msr (MSR c0010004 is 0)

 

Link to comment

Hey Jon,

 

That's great news. I'm trying to give it a go (using AMD), issued both commands and installed Virtualbox and Genymotion. The Android VM (in windows 7 64bit) seems unable to boot with the following message:

 

tsc: Fast TSC calibration failed

Odd, counter constraints enabled but no core perfctrs detected!

Failed to access perfctr msr (MSR c0010004 is 0)

 

Hmm, not sure about that error.  Probably needs some googling to point to the cause.  Can you create other VMs using either of those?

Link to comment
  • 2 months later...

Thanks! This works great. This let's me use vagrant now from within my VM.

 

To make this a permanent setting (survive reboot), go to your main page of the unraid console, click on your Flash drive, and edit the syslinux configuration.

 

From here you can add the correct kernel boot parameter: kvm_intel.nested=1

 

Mine looks like:

 

 

label unRAID OS

  menu default

  kernel /bzimage

  append initrd=/bzroot kvm_intel.nested=1

 

Hopefully new versions of UnRAID will include this setting out of the box.

Link to comment

Thanks! This works great. This let's me use vagrant now from within my VM.

 

To make this a permanent setting (survive reboot), go to your main page of the unraid console, click on your Flash drive, and edit the syslinux configuration.

 

From here you can add the correct kernel boot parameter: kvm_intel.nested=1

 

Mine looks like:

 

 

label unRAID OS

  menu default

  kernel /bzimage

  append initrd=/bzroot kvm_intel.nested=1

 

Hopefully new versions of UnRAID will include this setting out of the box.

Yes, 6.2 will.

Link to comment
  • 2 weeks later...
  • 3 years later...
On 3/11/2016 at 5:19 PM, jonp said:

 

This was implemented with the 6.2 public beta.

Sorry to necro this thread, but I haven't found anything else anywhere that helps.

I'm trying to do exactly this on 6.7.2 with a Proxmox VM. When I try to fire up a VM on this Proxmox VM, I receive an error saying that virtualization is configured but not enabled in the BIOS.

When I append kvm_intel.nested=1 to the unraid os label, Libvirt fails to start when I tell the VM manager to start back up.

Link to comment
10 minutes ago, joshbgosh10592 said:

Sorry to necro this thread, but I haven't found anything else anywhere that helps.

I'm trying to do exactly this on 6.7.2 with a Proxmox VM. When I try to fire up a VM on this Proxmox VM, I receive an error saying that virtualization is configured but not enabled in the BIOS.

When I append kvm_intel.nested=1 to the unraid os label, Libvirt fails to start when I tell the VM manager to start back up.

Hmm, that's weird.  Can you try another platform like Ubuntu or Arch and see if it works there?  If it doesn't, please create a Bug Report and we'll get it addressed.

Link to comment

 

1 hour ago, jonp said:

Hmm, that's weird.  Can you try another platform like Ubuntu or Arch and see if it works there?  If it doesn't, please create a Bug Report and we'll get it addressed.

1 hour ago, joshbgosh10592 said:

I'm sorry, you mean to create a new VM running Ubuntu inside unRAID and attempting to build a nested VM inside that, right?

If by that you did mean try Ubuntu, that fails with saying "Your CPU does NOT support KVM"

Should the BIOS type matter? I'm concerned because all the Proxmox VMs use SeaBIOS, and I'm not see unRAID's Proxmox VM shows OVMF.

I'd change it as a test, but it seems that you can't change it once the VM is created, and the Proxmox VM is the witness in a cluster (which means it's a PITA to reconfigure)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...