Convert VirtualBox (vmi) to real disk?

It is often the case that I need to set up training machines, and sometimes I get VirtualBox images that I need to deploy to the machines. I tend to avoid virtualization on the training machines because of driver-related issues—especially with graphic cards and things like WPF (which powers Visual Studio). If you have a good graphics card and good drivers, you can get a decent performance improvement with WPF apps, but unfortunately, some virtualization drivers are too poor.

So how can I take a virtual hard disk created in VirtualBox and easily convert it to a physical disk so it can just run?

Process:

It is possible, but it is not easy to convert it to a real disk. Here’s how:

Slightly more work than you would expect, but that is a solution that always works.

Caveats:

I have not tried this with Hyper-V or VirtualPC disks (VHD) yet, but I suspect VirtualPC will work fine. Hyper-V has an additional hypervisor layer, and I suspect SysPrep will not remove that, causing the restoring process to fail.

Finally, you also want to be careful with SysPrep, as it can have some undesired effects with certain software—for example, SQL Server. There are specific steps to follow if you want to use SysPrep with SQL Server: Microsoft Docs.

So make the time to have the first few attempts fail and learn the nuances of the software you work with.