Ubuntu – Is there a way to access the current windows installation within a VM environment

virtualizationwindows

I currently Dual Boot Windows 7 and Ubuntu 13.04. I would like to be able to use Ubuntu as my only OS but unfortunately there are programs for my job that only play with Windows. I know that Virtual Box will allow me to run Ubuntu and have Windows opened in a window as vmware. Unfortunately, it looks like I would be installing Windows from scratch within the VM. Is there a way to access my current windows installation within the VM environment?

Best Answer

Yes. You need to use the microsoft disk2vhd program to create a VHD copy of your hard drive. You'll likely need a backup drive to put the exported copy on. Before you copy your harddrive, delete all unecessary programs and files. Empty your recycle bin and temporary internet files as well as defrag the harddrive. If the computer is attached to a domain (even if it's a .local) disjoin it from the domain before capturing a copy.

Get disk2vhd here: http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx

Once you have an image of the HDD, you can create a VM with that drive as the "existing hard drive". I once created a knowledge document on how to p2v a workstation, here's its text...

Before beginning the P2V process you should:

  1. Defragment the Host to be virtualized.
  2. Remove any unnecessary programs.
  3. Delete temp files and anything else that isn't necessary.
  4. Unjoin the workstation from the Domain.

When ready to initiate the P2V process, create the VHD copy of the harddrive:

  1. Determine where the VHD copy will be stored. If you're exporting to the Hard Drive being copied, ensure the Drive has at least twice it's used space available as free space.
  2. Download the Disk2VHD application onto the workstation which will be virtualized. You can find that executable attached to this KB in the attachments section as well as the Disk2VHD help file.
  3. Launch the Disk2VHD.exe file and agree to the TOS.
  4. Determine where the .vhd file will be saved to, and deselect any unnecessary drives. By default, the tool will want to export all attached hard drives, inluding the external drive you're trying to export to (if present).
  5. Select the "create" button and allow the process to finish. The time to completion depends on the size of the VHD file.
  6. If necessary, move the finished VHD file to it's final storage place. The file is now ready to be used with VirtualBox.

Using the VHD with VirtualBox:

  1. If you're creating a new VM then select "New" from the menu bar and follow the prompts until you reach the Virtual Hard Disk page.
  2. Change the radio button on the Virtual Hard Disk page to "Use existing hard disk" and select the folder icon which will let you navigate to where the VHD file is stored. Select it, and click next.
  3. Continue with the prompts until the new VM is created.
  4. Depending on the system, special settings may be required in order to get the VM to boot. For most XP VM's, "Enable IO APIC" must be checked for the VM to run.