Monday, December 8, 2014

Converting a Physical Computer into a Virtual Machine

I was given the task today of taking a physical server and jamming it into a virtual machine that can be easily transported and backed up. Fortunately, this process is easier than the reverse.

VMWare Player
If you want to make a VMWare Player virtual machine, you'll need to use Norton Ghost, which comes on the free Win8.1SE boot disc. Burn that ISO to a DVD and use it to boot the machine, which may take up to 10 minutes. You'll need a huge flash drive, an extra hard drive, or a bunch of network storage to put the disk image in. Run Ghost from the Win8.1SE taskbar. Choose Local, then Disk, then To Image. Navigate to the storage place, choose VMDK from the file type dropdown, type the filename, and begin the imaging. If it asks you for a compression method, I recommend Fast.

Once Ghost shoves the disk into an image file, move the VMDK to the computer that will host the VM. Create a new VM with the following settings:

  • "I will install the operating system later"
  • Select your OS from the lists
  • Name your VM
  • "Split virtual disk into multiple files" and set the maximum disk size to 1GB
  • "Finish"
Once the wizard closes, select the blank VM from the list and open its settings. Delete the SCSI hard disk and add a new Hard Disk device. "Use an existing virtual disk" and select the VMDK file Ghost created. Try exposing the disk to the VM as whatever type of disk it was in the real machine, but if it fails to boot, use IDE - that always seems to work.

If the machine is a server of any sort, change the Network device from NAT to a bridge.

Start the virtual machine. You're done!

VirtualBox
I'd say VirtualBox is easier to deal with than VMWare because it can handle all manner of virtual disk formats, including the very convenient VHD. You could use Ghost like in the VMWare instructions and create a VMDK, or use Disk2Vhd, which uses Volume Shadow Copy and can perform the imaging while the system is online. Start Disk2Vhd in the running OS on the target computer. Make sure "Use VHDX" is not checked and "Use Volume Shadow Copy" is checked. Choose the storage place to save the large file, choose all the volumes on your drive, and click Create. Once the imaging is complete, move the VHD to the VM host system.

Launch VirtualBox and create a new VM. Choose your OS (this is really important in VirtualBox) and configure the computing power available to the VM. Use an existing virtual disk and select the VHD file you created with Disk2Vhd. If it's a server, make sure that the network adapter is a bridge, not NAT.

If there are any problems on boot, you may need to change the hard disk controller type. It should be the same as the physical disk, or IDE if that doesn't work.

Start the virtual machine. You're done!

No comments:

Post a Comment