P2V a Linux box into VMWare
19/05/16 17:11 Filed in: vmware | Systems Administation
This really should be obvious and easy … after all everyone does it … but my Google Fu kept leading me to solutions that relied on having access to old versions of VMWare Converter.
But it really is easy by combining:
But it really is easy by combining:
- netcat; and,
- qemu
Step 1: Clone the hard disk from the physical machine over the network:
Set up to receive the data on a convenient destination_host:
nc -l 10000 > sda.dd
Send the data from the machine you want to P2V
dd conv=noerror if=/dev/sda | nc destination_host 10000
Step 2: Convert our disk image into a VMDK
qemu-img convert -pO vmdk sda.dd p2v.vmdk
Step 3: Import into VMWare (in my case VMWare Fusion)
And we have cloned a running physical system with almost no changes into a VMWare virtual machine. Of course you may have issues with open files and file systems being modified … but if this is an actual issue you can always boot a live distribution and transfer the quiescent disk.
Set up to receive the data on a convenient destination_host:
nc -l 10000 > sda.dd
Send the data from the machine you want to P2V
dd conv=noerror if=/dev/sda | nc destination_host 10000
Step 2: Convert our disk image into a VMDK
qemu-img convert -pO vmdk sda.dd p2v.vmdk
Step 3: Import into VMWare (in my case VMWare Fusion)
- Create a new custom Virtual Machine
- Select Use an existing virtual disk
- Select your newly created VMDK (I use the copy into the new vm option)
And we have cloned a running physical system with almost no changes into a VMWare virtual machine. Of course you may have issues with open files and file systems being modified … but if this is an actual issue you can always boot a live distribution and transfer the quiescent disk.