How Can We Help?
< All Topics
You are here:
Print

P2V: Convert Physical Linux Machine to Hyper-V VM (Case: Berger’s Tablepads SalesTools Server)

  1. Using VMware vCenter Converter Standalone Client v6.2.0 build-8466193 I converted Salestools Debian Linux server to temporary VMware ESXi server. (5 hours and 54 minutes to complete)
  2. Enabled SSH on vCenter server and, using WinSCP, copied the 2 vmdk files to the Hyper-V server. (~4 hours)
  3. Using PowerShell and the MvmcCmdlet.psd1 module (https://www.nakivo.com/blog/how-to-convert-vmware-vm-to-hyper-v/) I converted the 2 vmdk files to Microsoft vhdx files. (~2 hours)

    ***NOTE: Microsoft Virtual Machine Converter 3.1 will not work as a bug prevents it from connecting to the VMware ESX server.
ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath "E:\salestools-vmdk\salestools.vmdk" -DestinationLiteralPath E:\salestools\ -VhdType DynamicHardDisk -VhdFormat vhdx
ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath "E:\salestools-vmdk\salestools_1.vmdk" -DestinationLiteralPath E:\salestools\ -VhdType DynamicHardDisk -VhdFormat Vhdx
  • The physical machine was configured to use LVM storage. The VMware P2V conversion converts these LVM partitions to standard partitions. Once the migration is complete the new VM must be reconfigured.
    • In Hyper-V create a new VM
      • If the physical machine used UEFI create the VM as Generation 2, otherwise use Generation 1.
      • Do not create a new hard drive, instead add the newly created vhdx files. You may need to add a SCSI or IDE interface first. I’m not certain that the order of adding these drives matters but I would add them in the order they were originally presented to the physical server.
      • I had to add a Legacy network card for Salestools to work properly.
      • Begin booting the VM.
    • Initially the VM would not boot. I used Rescatux Rescue Boot ISO to be able to access the GRUB boot menu to change the location of the boot partition by changing the lines as follows. Alternatively you can change the boot menu by pressing ‘e’ at the boot menu. If done this way make sure to run the command ‘update-grub’ once fully booted.
    set root='(hd0,msdos1)'
    set root='(hd0,1)'
    linux   /vmlinuz-2.6.32-5-686 root=/dev/mapper/salestools-root ro  quiet net.ifnames=0 biosdevname=0
  • Edit /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc            defaults                0       0
/dev/mapper/salestools-root             /               ext3            errors=remount-ro               0       1
# /boot was on /dev/sda1 during installation
/dev/sda1               /boot           ext2            defaults                0       2
/dev/mapper/salestools-home             /home           ext3            defaults                0       2
/dev/mapper/salestools-tmp              /tmp            ext3            defaults                0       2
/dev/mapper/salestools-usr              /usr            ext3            defaults                0       2
/dev/mapper/salestools-var              /var            ext3            defaults                0       2
/dev/mapper/salestools-swap_1           swap            swap            sw              0       0
/dev/scd0               /media/cdrom0           udf,iso9660             user,noauto             0       0
/dev/sdd1               /mnt/sdb1               ext3            defaults                0       0
  • This enabled the VM to boot properly. Once fully booted verify that all services are up and running.
  • Edit /etc/network/interfaces –> add the following
auto eth0
Table of Contents