Stampa
Categoria: Linux
Visite: 7022
Stella inattivaStella inattivaStella inattivaStella inattivaStella inattiva
 

vmware vcenter convert standalone 5.5.3 (oct. 2014) still fails when converting ubuntu server 14.04.

  

This not a tutorial, just a couple of notes taken when I solved the case.

 

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: line 52: grub: 
 command not found Error installing GRUB Command: 
 grub --no-floppy --batch --device-map="/vmware-device.map" root (hd0,0) setup (hd0) 
 Error running vmware-updateGrub.sh through chroot into /mnt/p2v-src-root /usr/lib/vmware-converter/installGrub.sh: 
 line 143: /mnt/p2v-src-root:
Is a directory

 

SCENARIO

The virtual machine was converted, the only issue regarding the boot: converter cannot manage grub properly.

/DEV on Phisical Machine

/dev/sda1 => grub
/dev/sda2 => ext4
/dev/sda3 => swap

/DEV on Virtual Machine

/dev/sda1 => ext4
/dev/sda2 => swap

As you can see grub partition was not created and now sda1 is the data partition and sda2 the swap partition.

The /etc/fstab and /boot/grub/grub.cfg contain the original configuration.

 

STEPS

In order to fix the server (virtual machine) we have to make some simple operations

 

BOOT

Edit your virtual machine and connect the device cd/dvd to the ubuntu 14.04 iso image

Power on the virtual machine, choice recovery / rescue mode, follow the steps until you can get a terminal prompt on /dev/sda1 

 

PARTITION 

# parted /dev/sda

(parted) unit MB
(parted) p free
Number  Start       End     Size     File system     Name                   Flags
        0.02MB   0.07MB   0.05MB     Free Space
 2      0.07MB   7516MB   7516MB     ext4            Linux Filesystem Data
 3      7516MB   8052MB    536MB     linux-swap(v1)  Linux Swap
        8052MB  11273MB   3221MB     Free Space



(parted) mkpart primary xx yy
(parted) p
(parted) set x bios_grub on
(parted) p free

Partition Table: gpt
Number  Start     End       Size    File system      Name                         Flags
 3      0.02MB    0.07MB   0.05MB                    primary                      bios_grub
 1      0.07MB    7516MB   7516MB   ext4             Linux Filesystem Data
 2      7516MB    8052MB    536MB   linux-swap(v1)   Linux Swap
        8052MB   11273MB   3221MB   Free Space

(parted) q

 

SUGGEST - GDISK

if you have installed the gdisk tool, you could sort the part number.
So FSTAB and GRUB.CFG edit would be not necessary.
I suggest to install gdisk on phisical server before launch the convert: apt-get install gdisk
# gdisk /dev/sda
Command (? for help): s
Command (? for help): w

 

FSTAB

fstab file still contains the phisical machine information

/dev/sda2 / ext4 errors=remount-ro,relatime,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0 0 1
/dev/sda3 swap swap defaults 0 0

 We have to change sda2 with sda1 and sda3 with sda2

 # nano /etc/fstab

 

GRUB.CFG

Before edit the /boot/grub/grub.cfg we need to know the UUID of the Phisical Machine and the new UUID of the Virtual Machine.
# blkid on phisical machine
# blkid on virtual machine

Suggest
blkid >> /boot/grub/grub.cfg

We have to replace sda2 with sda1 and the old UUID with the new one

# nano /boot/grub/grub.cfg

Nano command to replace a string is Ctrl + \

After saving the grub.cfg we have to install the grub, from the prompt # type exit, will appear the ubuntu menu from installation cd.

 

GRUB INSTALL

Now we have a new partition set as bootable and we already change the fstab and grub.cfg. we are ready to install the grub.

From the installation CD we can choice "Install grub on /deb/sda"

 

LAST STEP

reboot

 

[OT] Let me write some useful commands here

HOW TO CHANGE IP, GATEWAY AND DNS

# nano /etc/network/interfaces

auto eth0
iface eth0 inet static
address 192.168.0.150
netmask 255.255.255.0
gateway 192.168.0.1
network 192.168.0.0
broadcast 192.168.0.255
dns-nameservers 8.8.8.8  8.8.4.4

 

RECONFIGURE THE KEYBOARD

# sudo dpkg-reconfigure keyboard-configuration

 

 REFERENCES

 - have fun -