When you perform a P2V conversion of Debian Linux host using stand-alone version of VMware Converter host you may get a GrubInstaller error as “An error occurred during the conversion: ‘GrubInstaller::InstallGrub: /usr/lib….”.

You can right click the error message and export the logs for detailed error logs. The detailed log file contains the message as below.

msg = “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 –> ‘”.

This error occurs because VMware converter process installs grub V-1 and the Debian distribution uses grub V-2.

The first option to resolve this issue is to attempt the P2V using ColdClone boot CD if you happen to have one from older version of vSphere (version 4.1 and earlier). Since VMware has discontinued providing ColdClone CD after version 4.1, you may have to download older version of VMware and extract the ColdClone image. This may still fail if the new hardware has compatibility issues with drivers on the old software.

To resolve the error

1. Perform VMware conversion using VMware converter as you normally do.

2. After you get the GrubInstaller error, log on to vSphere console.

3. You will see the new virtual machine created with correct VM configuration, but you will not be able to boot it up.

4. Mount the original Linux distribution DVD on to the virtual machine and boot from DVD.

5. Select rescue option from boot menu.

6. Identify the disk containing root file system (e.g. /dev/sda1)

7. Select option to re-install grub bootloader.

8. Select option to initiate a shell.

9. Update the UUID in /etc/fstab using the following steps

  • Execute blkid command to identify new UUID for the boot disk. (If there are additional disk devices, make a note of those UUID’s as well).
  • Edit /etc/fstab using command nano /etc/fstab.
  • Replace UUID’s of boot disk with the correct UUID’s identified in Step “a” above.
  • Replace UUID’s for other devices mentioned in /etc/fstab as well.
  • Comment any entries for swap file system.
  • Save file and exit.

10. Update /boot/grub/grub.cfg with correct UUID’s for boot disk.

11. Disconnect DVD from Virtual machine and reboot.

12. The Debian OS will boot successfully.

13. Logon as root.

14. Create new swap partition using mkswap command and update /etc/fstab with UUID from MKSWAP command output.

15. Reboot and verify system configuration and network configuration.

16. The system is now ready for use.

Advertisements