Running nested VMs / VT-x is not available

This is for discussing general topics about how to use VirtualBox.

Running nested VMs / VT-x is not available

Postby rousseauhk » 11. May 2013, 16:50

I have a couple of test machines which are running the bare-metal hypervisor version of VMWare, simply for the easy multi-boot & snapshotting capability. I then run Windows under VMWare, and now want to run a Linux VirtualBox under Windows (so VMWare -> Win 7 -> VirtualBox -> Ubuntu).

When I launch my Ubuntu box, I get the "VT-x is not available (VERR_VMX_NO_VMX)" error.

So a few questions:
a) is there anyway I can get this nested setup to work (or is it just not supported)?
b) is there any way to detect VT-x not being available before you launch the VM?
c) is there any way to launch the VM without the VT-x extensions enabled?

thanks
Steve
rousseauhk
 
Posts: 45
Joined: 8. Apr 2013, 09:16
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Ubuntu Server

Re: Running nested VMs / VT-x is not available

Postby Perryg » 11. May 2013, 17:07

First nested virtualization is not supported. But to your problem. Only one thing at a time can use the hardware virtualization feature. This means that while you can get nested to work you will not be able to use 64-bit OSes in the nest. Also keep in mind that this is going to be slow and error prone.
Perryg
Site Moderator
 
Posts: 34374
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Running nested VMs / VT-x is not available

Postby rousseauhk » 11. May 2013, 18:24

Is there any way to launch the VM without the VT-x extensions enabled? At the moment, it just dies because VT-x isnt available.

Is this simply disabling this in the settings e.g. vmSettings.SetHWVirtExProperty(HWVirtExPropertyType.HWVirtExPropertyType_Null) ?

I appreciate this isnt the best solution, but it's only for testing, and I just want to get something working while I figure out a better way to handle this case.

thx
Steve
rousseauhk
 
Posts: 45
Joined: 8. Apr 2013, 09:16
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Ubuntu Server

Re: Running nested VMs / VT-x is not available

Postby Perryg » 11. May 2013, 18:37

Even though the setting is enabled it is not being used. Can't be, so there is a check in the code that switches to no VMX. If you are seeing anything about missing VMX then you need to make sure that you do not enable IO APIC in the guest settings as this will try to force VMX in the guest. One other thing you probably should know is that this is going to require nested paging. If the processor does not support that you will actually never get anywhere with this.
Perryg
Site Moderator
 
Posts: 34374
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Running nested VMs / VT-x is not available

Postby michaln » 12. May 2013, 00:37

Perryg wrote:make sure that you do not enable IO APIC in the guest settings as this will try to force VMX in the guest.

It won't. Configuring more than 1 VCPU (which will automatically turn on the I/O APIC) will though. And so will 64-bit guest support (which again normally turns on the I/O APIC).
michaln
Oracle Corporation
 
Posts: 2944
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Any and all

Re: Running nested VMs / VT-x is not available

Postby Perryg » 12. May 2013, 00:41

Isn't that just saying the same thing a different way? AFAICT the only thing that is really different in selecting 64-bit support IS the IO APIC.

Edit: and selecting more than 1 VPC only brings up a non-optimal setting if you select it without enabling IO APIC.
Perryg
Site Moderator
 
Posts: 34374
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Running nested VMs / VT-x is not available

Postby rousseauhk » 12. May 2013, 04:35

OK. I'll try again with just a single virtual core on the guest. Sounds like I might be better off trying to use something like Acronis to do the snapshots rather than having a root hypervisor tho.

Also, going back to my previous question, is there any way to detect whether or not VT-x is available in the API?

thx
Steve
rousseauhk
 
Posts: 45
Joined: 8. Apr 2013, 09:16
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Ubuntu Server

Re: Running nested VMs / VT-x is not available

Postby noteirak » 12. May 2013, 10:44

Hyperbox - Virtual Infrastructure Manager - https://kamax.io/hbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
 
Posts: 5192
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7

Re: Running nested VMs / VT-x is not available

Postby rousseauhk » 13. May 2013, 04:38

Thanks for all the help. The following code enables the app to work (albeit in a limited way on 32-bit.. not tested with 64-bit host/guest):

(C#)
Code: Select all   Expand viewCollapse view
VirtualBox.VirtualBox box = new VirtualBox.VirtualBox();
IMachine machine = box.CreateMachine(null, uniqueName, null, null, "forceOverwrite=1");
box.RegisterMachine(machine);
machine.LockMachine(session, LockType.LockType_Write);
IMachine machsettings = session.Machine;
...
int vtx = box.Host.GetProcessorFeature(ProcessorFeature.ProcessorFeature_HWVirtEx);
if (vtx == 1)
    machsettings.BIOSSettings.IOAPICEnabled = 1;
else
{
    //vtx not available - max cores = 1 & disable IOAPIC
    Logger.Error("VT-x not available. Setting max #cores to 1");
    machsettings.CPUCount = 1;
    machsettings.BIOSSettings.IOAPICEnabled = 0;
}
...
machsettings.SaveSettings();
session.UnlockMachine();
rousseauhk
 
Posts: 45
Joined: 8. Apr 2013, 09:16
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Ubuntu Server


Return to Using VirtualBox

Who is online

Users browsing this forum: Google [Bot] and 13 guests