VirtualBox and Hyper-V can stop fighting

I work a lot with sensor networks and TinyOS. Since the configuration of the development environment can sometimes be tricky, I like working in a ready-to-use Virtual Machine. The VM I use is a 64-bit version of Ubuntu, executed in Oracle VirtualBox.

I also do a lot of work in Visual Studio, including apps for Windows Phone, and for the emulator, Microsoft Hyper-V is required.

I found out soon (and painfully) that you can’t have two hypervisors active at the same time. In fact, I kept trying and trying, and this was literally driving me crazy: my TinyOS virtual machine in VirtualBox would not start, saying that “VT-x is not available“. Of course, in reality VT-x was available, and activated in the BIOS, so at first I really couldn’t understand what the problem could be.

So, the issue is that VirtualBox will not be able to work properly if Hyper-V is active, and vice versa.

The solution for many is uninstall Hyper-V, and reinstall it when you need it again, but this seemed crazy to me. I then ran into this great post by Scott Hanselman (love that man!), and it totally saved my day. His solution is to create a new boot option for a configuration of Windows 8 with Hyper-V disabled. You are then able to boot into one or the other configuration, depending if you need to work with VirtualBox or Hyper-V.

The steps on his blog post are very easy, I’ll quickly recap here:

  1. Make a copy of the current boot configuration:
    C:\>bcdedit /copy {current} /d "No Hyper-V" 
    The entry was successfully copied to {ff-23-113-824e-5c5144ea}.
  2. Disable Hyper-V for this new configuration (be careful to use the same GUID from the output of the previous command):
    C:\>bcdedit /set {ff-23-113-824e-5c5144ea} hypervisorlaunchtype off
    The operation completed successfully.
  3. Go to the Power menu in the system, as if to shut down the computer, but instead click on Restart *while holding the SHIFT key down*. This will lead to a menu that lets you choose which boot configuration to launch after the reboot.
  4. Click “Use another operating system”
  5. Select “No Hyper-V”

Now Windows 8 will boot with Hyper-V disabled and VirtualBox will be able to work perfectly, even with 64-bit guest OSes.

Hope this will help! [And many thanks to Scott Hanselman (@hanselman) for being awesome 😉 ]

Leave a Reply

Your email address will not be published. Required fields are marked *