VMFAQ.com - FAQing about virtualization since 2008
Search:     Advanced search
Browse by category:
Contact Us

How can I convert an existing computer into a virtual one? ..or a virtual machine into a physical one?

Add comment
Views: 5623
Votes: 1
Comments: 0
Posted: 17 Oct, 2008
by: Troen L.
Updated: 14 Oct, 2009
by: Troen L.

Converting a physical computer into a virtual one is also known as p2v (physical to virtual). Converting a virtual one to a physical one is also known as v2p (virtual to physical). Converting between different virtualizatoin vendors is known as v2v (virtual to virtual).

For doing v2p or p2p, please read the Manual alternative section below.

GUI methods
The most obvious solution is to use VMware Converter. VMware has a standalone version that is freely available. VMware Converter can do p2v and v2v.  To convert a physical server,  VMware Converter will by default do this while the system is running. Converting a live system is not completely risks free, and the state of the converted disk will be in a non-consistent state.
It is however possible to use VMware Converter from a LiveCD and then the success factor will be much higher and the converted disk will be in a consistent state.

For enterprise customers it's possible to download such a version of Converter directly from VMware (known as VMware vCenter Converter BootCD for vCenter Server) from the Virtual Center download page.

For those without enterprise licensing it's possible to build a CD that will work the same way by using the tools described here: http://sanbarrow.com/moa.html

Note that VMware Converter requires you to have at least 264MB ram in the source system, a requirement many old systems don't meet; so a manual method might still be required.

A manual alternative
An alternate method to do this is to do it the manual way. This method works fine as long as the physical disk controller is of similar type as the virtual target. For linux it's however also easy to go from a physical ide to a virtual scsi, but on windows you will have to inject the correct driver in this process (fixvmscsi), while on linux you will only have to reinitialize grub. If you can use the same disk controller type on both ends, that would be the easiest solution.

Doing it manually can in fact be quicker than doing it with the GUI tools, atleast if you're converting a disk with a high fill rate.

1. Download SystemRescueCD: http://sysresccd.org/
2. Create a new virtual machine with a disk of the same size as the physical source disk
3. Boot both the source system and the target virtual machine with the SystemRescueCD.
4. In the target virtual machine, run the command: nc -l -p 5000|lzop -d|dd of=/dev/sda
5. In the physical source system, run the command: dd if=/dev/sda|pv|lzop -1|nc 192.168.1.5 5000
6. You can see thestatus of the transfer in the source systems console.
7. If it's a linux guest and it doesn't boot properly after transferring, you might have to reinitialize grub: http://www.gnu.org/software/grub/manual/html_node/Installing-GRUB-natively.html

This manual alternative can also be used to convert a VM to a physical server or between physical servers.

Note that PCs having Windows OEM licenses (typically on preinstalled PCs) will complain about activation if you try to move them and you will not be able to login to the system before it has been activated. Since an OEM license is bound to the original hardware you will not be able to activate such a license on another system or in a virtual machine.
Commercial alternatives
There are also several commercial alternatives that can provide such functionality:
HP Server migration pack (only for HP servers)
Others in this Category
document vmx connection handshake failed for mks of vmfs
document "Invalid DSN" when trying to install 64 bit vCenter Server
document Upgrading from ESX 4.1 to ESXi 5 fails: The specified network interface card is not plugged in. Installation cannot continue as requested.
document Insufficient capacity on each physical CPU
document I keep ketting strange com.vmware.vcIntegrity reconfiguration messages
document Recommended performance tuning options for Linux guests
document What is CPU READY?
document Recommendations for template virtual machines
document Can I grow an existing virtual disk (.vmdk file)?
document After cloning a Debian/Ubuntu VM, the guest network is not working
» More articles



RSS