Convert VirtualBox (vmi) to real disk?

It is often the case I need to setup training machines and a sometimes I get VirtualBox images which I need to deploy to the machines. I tend to avoid virtualisation 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 & good drivers then you can get a decent perf improvement with WPF apps, but unfortunately some virtualisation drivers are too poor.

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

Process:

It is possible but it is not easy to a real disk but it is not easy.

  • Step 1: You need to use a tool from Microsoft called SysPrep to unload the drivers. Basically this means that it strips all the driver info out, and puts the image in a clean state so that the next time it boots Windows searches for the hardware again. If you do not do that Windows will freak out because the hardware it expects does not exist.
  • Step 2: Then you use a tool designed for disk imaging to create an image. Tools like Norton Ghost (paid) or CloneZilla (free) are designed for this purpose and the image they create is portable unlike the vmi (VirtualBox hard drive) format which can't do this well.
  • Step 3: You then restore that image to the real disk using the same tool and you are done.

Slightly more work than you would expect, but that is a solution which 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 that SysPrep will not remove that and the restoring process will 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 go through if you want to use SysPrep & SQL Server: http://msdn.microsoft.com/en-us/library/ee210754.aspx

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

Damir Vadas's picture

Hi!

Sysprep is necessarily for Win images.
But if you have Linux Virtualbox image, is there anything to do as in Win proc?
Rg,
Damir Vadas
http://damir-vadas.blogspot.com/

Robert MacLean's picture
You'd need to ask a Linux person that. From my memory (5yrs+) there is nothing in Linux that needs a SysPrep like experience so that is why there is no tool like that.
Damir Vadas's picture

Thank you
Damir

Luciano Evaristo Guerche (Gorše)'s picture

Robert,

I'll give a try to "Paragon Virtualization Manager for VirtualBox Professional - Free download" http://www.paragon-software.com/home/vm-professional-vb/free-download.html

Have you ever used it?

Cheers.

Luciano Evaristo Guerche (Gorše)'s picture

Robert,

Nice post, but is it possible to you to elaborate a bit more on each step involved (give further information, screenshots, etc.)?

Cheers.

Simon Brennan's picture

Virtualbox has great support for hardware 2d and 3d acceleration inside the virtual guest.

Checkout this for 2D
http://www.virtualbox.org/manual/ch04.html#guestadd-2d

And this for 3D
http://www.virtualbox.org/manual/ch04.html#guestadd-3d

To convert virtualbox images to a real machine I use this
http://www.paragon-software.com/home/go-virtual/
Works like a charm. Supports Virtual PC, Virtualbox and Vmware.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Syntax highlight code surrounded by the <pre class="brush: lang">...</pre> tags, where lang is one of the following language brushes: as3, applescript, bash, csharp, coldfusion, cpp, css, delphi, diff, erlang, groovy, jscript, java, javafx, perl, php, plain, powershell, python, ruby, sass, scala, sql, vb, xml.

More information about formatting options