I have an ubuntu 13.04 server virtual machine on an ubuntu server 13.04 running libvirt 1.1.1. I want to migrate this to a hyper-v 2012 R2 server. I'm not terrible familiar with linux, and would appreciate some advice. So far, I've found https://unix.stackexchange.com/questions/8351/how-to-create-a-dupe-of-a-kvm-libvirt-virt-manager-vm which presents a way to clone the VM, which seems like a good start. Can i simply copy the VM's drive, and then create a new VM on the hyperv server with that copy? Any tips would be a great help!
2 Answers
First off, download this tool:
http://www.systola.com/blog/14.01.2015/VhdTool-Is-Dead-Long-Live-VhdxTool/#.V3vdh5MrLUI
make a directory for the virtual machine on the hyper-v 2012 vhost
mkdir C:\VIRTUALMACHINE
smb mount the KVM file system
net use \\kvm-server.mydomain.com\kvm-disk-share z:
change to the mounted file system
cd \\kvm-server.mydomain.com\kvm-disk-share
copy the KVM disk to the Hyper-V server
copy VIRTUALMACHINE.disk C:\VIRTUALMACHINE
unmount the smb mounted KVM file system
net use \\kvm-server.mydomain.com\kvm-disk-share /delete
append a vhd header to the raw disk file
PS C:\disks> .\VHDToolx.exe /convert .\VIRTUALMACHINE.disk=
rename the raw disk file as a .vhd file
PS C:\disks> ren .\VIRTUALMACHINE.disk .\rhel5.vhd
-
You will always get some weird errors doing this but this is the appropriate way. If you get any errors, post them here. Jul 5, 2016 at 16:31
-
One complicating factor- the server 2012 hyperv server is command-line only, as it's the community version or whatnot. Jul 5, 2016 at 16:46
Configure X server to run under Hyper-V
edit the /etc/X11/xorg.conf file
change Section "Device" Driver to "vesa"
change Section "Screen" DefaultDepth to 16
change SubSection "Display" Depth to 16
reboot to commit changes to disk
shutdown -r now
-
And then i can just move the drive to the VHD server and import virtual machine? Jul 5, 2016 at 16:51
-