[Resolved] Grub issue with imported .ovf and .vmdk from VMware

Discussions about using Linux guests in VirtualBox.
Post Reply
vbox_lover
Posts: 6
Joined: 18. Sep 2019, 13:42
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Centos 7

[Resolved] Grub issue with imported .ovf and .vmdk from VMware

Post by vbox_lover »

I got strange issue, when I imported disk images from VMware, basically what I did is, I exported

Code: Select all

.ovf
and

Code: Select all

.vmdk
from VMware, and using import appliances program from Virtualbox, I imported, everything went well, unfortunately on default boot ( which is 1st item in grub menu), system entering in emergency mode, but it seems to work in grub-rescue mode, what could be the reason ? , how to fix this issue ?

I have attached 3 screenshots of the same.
Attachments
Login screen - when grub-rescue menu was used
Login screen - when grub-rescue menu was used
VirtualBox_login-screen.png (1.99 KiB) Viewed 3244 times
Grub-rescue menu - working fine
Grub-rescue menu - working fine
VirtualBox_working-with-grub-rescue.png (3.68 KiB) Viewed 3244 times
emergency mode, when booted from 1st menu in grub
emergency mode, when booted from 1st menu in grub
VirtualBox_grub_18_09_2019_17_16_45.png (12.17 KiB) Viewed 3244 times
Last edited by socratis on 18. Sep 2019, 20:07, edited 1 time in total.
Reason: Marked as [Resolved].
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Grub issue with imported .ovf and .vmdk from VMware

Post by mpack »

The usual reason is that that the grub boot script is looking for a particular boot drive by UUID instead of a boot location. You would need to modify the grub script, ideally removing the UUID dependency.

Possibility 2: the source VM use EFI (GPT partitions), the target VM does not enable EFI. Since EFI partitions use a different style of boot mechanism the drive would not be seen as containing any bootable partitions by a legacy MBR BIOS.
vbox_lover
Posts: 6
Joined: 18. Sep 2019, 13:42
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Centos 7

Re: Grub issue with imported .ovf and .vmdk from VMware

Post by vbox_lover »

Hi, thanks for the hint, I could fix it,

Here is a way to do that, if anyone in future finds difficulty after migrating:
  • Boot from grub-rescue mode
  • Login as root user
  • and then execute following

    Code: Select all

    # dracut -f -v
    # reboot
    
From dracut man page

Code: Select all

-f, --force
    overwrite existing initramfs file. 
-v, --verbose
    verbose output during the build process 
please note dracut takes little time to rebuild the image, for me it took around 1 min.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Grub issue with imported .ovf and .vmdk from VMware

Post by socratis »

Glad you got it going. Marking as [Resolved].
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
kremeznoy
Posts: 1
Joined: 1. Jun 2020, 23:09

Re: [Resolved] Grub issue with imported .ovf and .vmdk from VMware

Post by kremeznoy »

Do You know how to fix this in automated way? I mean maybe there is an option to update grub before You do vmdk export and then import it in Virtual Box and run VM successfully from 1st attempt without any restoration by dracut?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: [Resolved] Grub issue with imported .ovf and .vmdk from VMware

Post by mpack »

Obviously, if you remove the UUID dependency in grub before cloning then it can't cause a problem after cloning. And yes, I consider it better to apply the solution at source if you intend to clone/export this VM a lot.
Post Reply