Can I boot up a virtual machine natively?

7

2

My question is:

Is is possible to run a virtual machine natively on your hardware if you have installed the proper drivers etc? In other words, can I use a VHD as a regular hard drive to boot from?

The reason I want to do this is that I do both graphics-intensive and audio-intensive work, but my computer is not powerful enough to handle both at the same time and many times I install a bunch of audio programs that I don't want affecting the stability of my graphics programs. Basically I wanted to have sandboxing between the two sets of applications. So I tried running the graphics-intensive programs in a VirtualBox VM and the audio-intensive work natively (simply because it's a pain to route ASIO audio devices in/out of VirtualBox). This kind-of works - the graphics-intensive stuff is tolerable, but still relatively slow, because it's running inside a VM.

So my next idea was to just dual-boot and install the graphics and audio programs in separate partitions but I frequently use them in tandem, so it wouldn't be practical to reboot my machine every time I need to use the other set of programs.

But I could live with this scenario: If I need to do more audio-intensive stuff, I'll just boot up to the audio partition and run the graphics programs in a VM, and then when I'm working heavily on the graphics part, I'll just boot the graphics partition as a regular OS directly on the hardware.

Is this possible? For example by booting up a VHD as a regular hard drive? Or by setting up dual-boot, and every time the audio partition is shut down, synchronize the graphics VM VHD with the native graphics partition? Is it practical, given the above scenario?

And if it's not possible, barring buying another computer, can anyone suggest a best-of-all-worlds setup (the two worlds being performance, sandboxing, and running in parallel) for the above scenario? Thanks in advance.

Anshul

Posted 2013-10-22T13:50:11.030

Reputation: 223

Have you tried assigning the audio and video cards to the virtual machine? – Cristian Ciupitu – 2013-10-22T14:24:28.017

What do you mean by assigning? In my audio settings, none of my ASIO drivers show up, only the Intel HD Audio and another generic WDM audio driver shows up. As for the graphics, I'm not sure of how to assign my native graphics card to VirtualBox. Is there a way to do that? – Anshul – 2013-10-22T14:48:30.930

1

Maybe Oracle VM VirtualBox » How to Use PCI Passthrough can help you even if the Intel vt-d/AMD IOMMU support "bug" is still open.

– Cristian Ciupitu – 2013-10-22T15:02:29.980

That is a great link. It's crazy that that bug is still open after 4 years and VB has not addressed it. – Anshul – 2013-10-22T15:33:23.513

Why not partition your drive in 3, dual-boot two copies of the same OS but keep all your documents on the third partition? – Colin 't Hart – 2013-10-23T09:23:30.723

Because just dual-booting does not solve the issue of needing to concurrently use the two machines. That's why I wanted to dual-boot + VM the secondary machine. – Anshul – 2013-10-23T13:29:01.707

Answers

3

This is possible with Windows 7 and up, if you are using MS VHDs. It may be limited to Pro & Enterprise versions, but it might not.

Here is an article explaining how to do it in Win 7 and Server 2008. And here is an article for Win 8 and Server 2012.

Keltari

Posted 2013-10-22T13:50:11.030

Reputation: 57 019

That option looks promising. But when you boot up Windows 8 from a VHD, do you know if it actually runs natively or does it run on Hyper-V? Also do you know if there are any driver issues? That would be my biggest concern. Thanks. – Anshul – 2013-10-22T14:05:59.493

Ive actually never done this, just know that its possible... it cant hurt to try. – Keltari – 2013-10-22T14:09:00.013

1@Anshul - Drivers issues would be unique to each use case. Hyper-V supports Intel's VT-D technology which basically means you wouldn't be able to tell it was a virtual machine instead of a bare metal installation. – Ramhound – 2013-10-22T14:17:54.470

Windows 7 supports boot to VHD, you should be able to get the boot loader to prompt and you would pick from local disk or vhd – MDT Guy – 2013-10-22T14:38:27.533

I would assume since its running from a file instead of a real disk, the IO would be a little slower – Keltari – 2013-10-22T14:44:39.993

@Ramhound From what I read, VT-d is an IOMMU implementation, does that mean that the VM will be able to see the devices transparently through the host OS? – Anshul – 2013-10-22T15:06:55.433

@Anshul - The behavior is entirely dependent on what extensions are supported. Some of the newer Intel hardware supports even deeper integration for virtual machines like Hyper-V – Ramhound – 2013-10-22T15:10:45.560

@Ramhound So assuming that all my required devices work with VT-d (hopefully), if I mount a VHD that has Windows 8 that points to the physical address of the drivers inside the guest OS, theoretically I should not have to make any modifications to the drivers since on the host system they are the same memory addresses, correct? Thanks. – Anshul – 2013-10-22T15:22:49.747

@Ramhound Another question I had was that if I use Hyper-V as my virtualization environment, and then mount that VHD to run on bare metal, would that still run on top of Hyper-V or would it actually run on the bare metal? (since Windows Server 2012 and Windows 8 with Hyper-V enabled actually runs on top of Hyper-V with some special permissions in Hyper-V) – Anshul – 2013-10-22T15:53:53.513

@Anshul - Technically you would be booting to a virtual machine but it entirely depends on the hardware if hardware virtualization is utilized. – Ramhound – 2013-10-22T16:08:16.900

@Ramhound Yes, I do have VT-x enabled on my system. I have run Windows 8 with Hyper-V enabled and the overhead is negligible, so I'm hoping that's the case with loading up Windows 8 from a VHD as well. – Anshul – 2013-10-22T16:12:49.007

@Anshul - There would even be less overhead. The only overhead if any would be connected to the I/O and honestly it shouldn't be significant to even notice. The best way to find out is to test it yourself honestly. A good way to determine if this well meat your requirements is to convert the physical machine to a virtual machine and simply boot to it. – Ramhound – 2013-10-22T16:19:10.147

@Ramhound Yeah, I will be trying that later tonight. I'll report back with the results as an answer to this question. Thanks for all the tips. – Anshul – 2013-10-22T16:49:59.850

2

I have successfully done the opposite with VirtualBox - Boot a native harddrive partition (WinXP) inside of the virtual machine. It required updating a few registry things by following the migration process to make sure that all of the core disk drivers were available, and making the virtual machine match the host system's disks as closely as possible.

The end result was the same however, in that I could choose to boot the partition at startup from the boot loader, or boot into the main system and then boot the second partition through VirtualBox.

You can even mount the partition as a standard drive in Windows Explorer when it's not loaded inside the VM for ease of access to copy files back and forth quickly.


This was set up for my mother when I moved her from her old Windows XP system to a nice new Windows 8 machine. I didn't have time to sit and show her how to do everything that had changed, and this made a very convenient solution. All I had to do was show her how to launch the virtual machine, and copy files back and forth, and get her core day-to-day things set up in Windows 8. This allows her to get familiar with Windows 8 at her own pace, and still fall back to the system she's familiar with when she's in a rush.

Darth Android

Posted 2013-10-22T13:50:11.030

Reputation: 35 133

Was the device driver migration process a tricky one in your case? Or did it go pretty smoothly? My concern is that I have a lot of non-standard devices (audio interface, MIDI controllers etc.) but they are all mostly USB and a few PCI.

Also, have you tried USB passthrough and/or PCI passthrough with VirtualBox? Thanks. – Anshul – 2013-10-22T15:42:51.887

@Anshul - Finding drivers that support both Windows XP and Windows 8 has its own problems. Depending on the supported hardware virtualization driver support should be seamless. – Ramhound – 2013-10-22T16:17:27.467

@Anshul There are no device driver problems with the migration. I did not try setting up USB passthrough with the virtual machine, but all the drivers for the native hardware simply aren't loaded inside the VM (because the hardware isn't detected), and vice-versa for the virtual hardware drivers when it's running natively. Running in a VM wouldn't mess anything up, it would at minimum simply appear as if the special devices weren't plugged in. – Darth Android – 2013-10-22T17:02:37.310