VMware P2V Conversion of Debian Squeeze

The P2V conversion of Debian OS is not as straight forward as CentOS where you just need to click Next, Next,...Finished!!!...The conversion process is same for both, but the Debian conversion may fail during the final stages of conversion.

Issue

While doing P2V on a Debian/Ubuntu OS, the process fails at 99%.

Under log highlights, you could see the error "Error: Unable to reconfigure the destination virtual machine".

Under the conversion status, you will find the error:


FAILED: An error occurred during the conversion: 'GrubInstaller::InstallGrub: /usr/lib/vmware-converter/installGrub.sh failed with return code: 127, and message: Installing GRUB1 on (hd0)... /vmware-updateGrub.sh: 59: grub:
not found Error installing GRUB Error running vmware-updateGrub.sh through chroot into /mnt/p2v-src-root '

        If VMware conversion has failed at 99%, that doesn't mean the conversion has failed completely. The copy of the physical machine will already be in the destination when the process completes 95%. During the remaining 5%, the destination VM will be reconfigured. So, when the VM fails at 99% the possible point of failure will the reconfiguration of the destination VM.

         Coming to the cause of the failure, it is the incorrect version of grub installed in the destination VM. Debian flavors use grub version 2 while the converter installs grub version 1 in the VM. Since the process failed during the grub installation, the VMware converter fails to update /etc/fstab entry with the new UUID of the hard disk. If you try to turn on the VM, you will be greeted by the message "error loading operating system"  in a beautiful black screen.

Resolution

For resolving this issue you would need the Debian ISO. Download the latest stable version of Debian ISO and follow the below steps:
  • Check the root file system from the source (physical machine) using the command fdisk -l and note the device. (eg: /dev/sda1)
  • Power On the destination VM 
  • Boot from the Debian iso
  • Select 'Rescue Mode' option from the menu
  • Choose the option "Reinstall grub bootloader"
  • Give the device which holds the root file system (eg: /dev/sda1)
  • Choose the option "Initiate shell on /dev/sda1"
  • Update the new UUID in /etc/fstab using the below steps as the hard disk device of the machine would be different after the conversion:
    • Get the new disk UUID using the command blkid
    • Open /etc/fstab and replace the UUID of the old disks with their new UUID
    • Remove the swap file system by commenting swap file system entries in the file and save the file.
  • Update the file /boot/grub/grub.cfg with the correct UUID's for boot disk and save the file.
  • Disconnect the ISO and reboot the system.

Comments

  1. "Reinstall grub bootloader" is not an option in any Debian ISO I've ever seen. No such thing as a "linux distro ISO" at all. Sounds like a generic ISO to me....

    ReplyDelete
  2. Linux distro ISO? What is a Linux distro ISO? Are you referring to the Debian ISO? If so, where is the option "Reinstall grub bootloader" on the Debian ISO? I've never seen one. Why not call it a Debian ISO if that is what you are talking about. Provide a link at least to this Linux distro ISO.

    ReplyDelete
  3. hi,
    thanks for the post. I tried the steps mentioned above, but after it reboots it hangs at the GRUB screen. It shows no error or anything, just the black screen with the word GRUB.

    any ideas?

    thanks

    ReplyDelete
  4. @Shawn Thanks for the correction. I've changed 'linux distro ISO' to 'Debian ISO'. The reason why you are not seeing the "Reinstall grub bootloader" option may be because of a wrong/old ISO used.

    ReplyDelete
  5. @Erjol If you have done all the above steps and the machine got hang after reboot, then it may be due to a wrong UUID provided in the config files. Please verify the UUID value.

    ReplyDelete

Post a Comment

Popular posts from this blog

VMware and Windows Interview Questions: Part 2

VMware and Windows Interview Questions: Part 3

VMware vMotion error at 14%