edoceo

Migrating Windows Physical to Virtual on Linux KVM

For most Windows systems, since Windows 2000 the migration from physical to virtual is a snap. Simply import the mergeide registry hack and power off, use dd and other tools to dump the full-disk and you're done.

Install PCI-IDE Drivers

Download the file and then install it, then power off the Windows machine. Make sure the system doesn't have any pending updates or software installs or other reboot-pending changes.

Dump the Disk Image

For this P2V operation we make a direct copy of the physical hard-disk. Booting from a LiveUSB or DVD is helpful here, in situations with hardware raids or similar.

Dump from ServerA LiveDVD to ServerB running Ubunut 12.04.

~ # dd if=/dev/sda | nc -q1 -v ServerB 6500

And on ServerB we are listening and writing.

~ # nc -l -p 6500 > /opt/kvm/Windows_2003_Server.sda

Booting New Disk Image

Note we are using the rtl8139 adapter. It's just worked better for us vs the e1000.

~ # kvm \
    -cpu coreduo \
    -m 2048 \
    -name p2v \
    -boot d \
    -drive file=/opt/kvm/Windows_2003_Server.sda,if=ide,index=0 \
    -net nic,vlan=$vid,macaddr=$mac,model=rtl8139 \
    -net tap,vlan=$vid,ifname=$tap,script=no,downscript=no \
    -vga std \
    -vnc $vnc \
    -monitor $mon \
    -usb \
    -usbdevice tablet \
    -daemonize

Loading Comments from Disqus...