grub rescue screen when booting windows 10 guest

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Shmu26
Posts: 99
Joined: 21. Dec 2017, 15:32

grub rescue screen when booting windows 10 guest

Post by Shmu26 »

I did a P2V conversion of a Windows 10 x64 EFI, by using a Macrium reflect system image.
I restored the macrium image onto a VDI file.
I enabled EFI boot in the VM settings.
When booting the guest, I get grub rescue screen.
I ran the Macrium Reflect boot repair, and it identified the Windows partition, but it didn't succeed in fixing the boot.
I then tried booting the guest from boot-repair-disk-64bit.iso, and it says it fixed the boot, but I still get to grub rescue screen.
If I mash the delete key I can get to some BIOS options, but I was not successful in finding the right incantation or incarnation in those options...

Important fact: the Linux partition is not in the VDI at all, because I did not image it. I don't want grub, I want Windows boot manager.
I attached a screenshot and the log.
Screenshot.png
Screenshot.png (9.42 KiB) Viewed 5198 times
Attachments
Win10 VDI-2019-11-20-10-30-24.log.tar.gz
(29.82 KiB) Downloaded 18 times
Last edited by Shmu26 on 20. Nov 2019, 18:19, edited 1 time in total.
Shmu26
Posts: 99
Joined: 21. Dec 2017, 15:32

Raw Disk Access boots to UEFI Interactive Shell

Post by Shmu26 »

So I am trying to boot my Windows 10 x64 EUFI installation in a virtual machine, as a raw disk.
I created my VMDK file, and set permissions, but it boots to UEFI Interactive Shell.
screenshot and log attached.
Screenshot.png
Screenshot.png (26.72 KiB) Viewed 5202 times
Attachments
Win10Raw-2019-11-20-12-30-46.log.tar.gz
(20.97 KiB) Downloaded 16 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: grub rescue screen when booting windows 10 guest

Post by scottgus1 »

Shmu26 wrote:Important fact: the Linux partition is not in the VDI at all, because I did not image it. I don't want grub, I want Windows boot manager.
I think this is the important fact. As I have heard many times, one has to take the whole drive, not just the desired partitions.

A 'far out in left field' idea I would try: install a fresh Windows 10 in the guest, same Windows version as on the image, with EFI. Then just restore the actual Windows OS partition from the Macrium image over the Windows OS partition in the guest, not touching any of the other guest partitions.

No idea if this will work. There may be UUIDs to edit somewhere, etc. But it might work...
Shmu26
Posts: 99
Joined: 21. Dec 2017, 15:32

Re: grub rescue screen when booting windows 10 guest

Post by Shmu26 »

scottgus1 wrote:
Shmu26 wrote:Important fact: the Linux partition is not in the VDI at all, because I did not image it. I don't want grub, I want Windows boot manager.
I think this is the important fact. As I have heard many times, one has to take the whole drive, not just the desired partitions.
Makes sense, but last time I did P2V, I used the VMware converter, and when I did include the linux partition, I fell into the grub problem. When I tried again with the same converter, but without the linux partition, it worked. In fact, I am writing this message from that VM.
Shmu26
Posts: 99
Joined: 21. Dec 2017, 15:32

Re: Raw Disk Access boots to UEFI Interactive Shell

Post by Shmu26 »

I suspect that this and my other woes are related to EFI boot. So I tried to switch my Windows installation to legacy boot, but I can't get it to boot up that way. Neither Windows recovery nor Macrium Reflect recovery can put Humpty Dumpty back together again, on legacy boot. So, regretfully, I returned to UFI boot.
socratis
Site Moderator
Posts: 27330
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 rescue screen when booting windows 10 guest

Post by socratis »

Please don't open two threads for the same issue... I merged them.
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.
Shmu26
Posts: 99
Joined: 21. Dec 2017, 15:32

Re: grub rescue screen when booting windows 10 guest

Post by Shmu26 »

@socratis -- but it is two different issues. One is a P2V conversion, the other is a raw access to a physical partition, and the errors are not the same.
Shmu26
Posts: 99
Joined: 21. Dec 2017, 15:32

Re: grub rescue screen when booting windows 10 guest

Post by Shmu26 »

So the solution to the first issue -- that the virtual machine gets stuck at a grub screen after a P2V conversion -- is to clean the boot sector from all linux entries before performing the conversion.

Go into the BIOS settings of the physical machine and set everything -- all disks, storage devices etc -- to Compatibility mode/Legacy boot.
Reboot, and let it fail to load Windows, returning you to BIOS.
Now re-enable UEFI boot, restoring the settings you had before.
Voila, everything is erased from the boot sector except for Windows.
I used this method so I could do a Physical-to-Virtual (P2V) conversion of my hard disk, so I could use it in a virtual machine. If you don't clean the boot sector, the virtual machine might boot to grub, and it's hard to correct that.
The right way to do it is to convert a clean boot sector.
Post Reply