W10 from vmdk

Discussions about using Windows guests in VirtualBox.
Post Reply
vei7xuNe
Posts: 5
Joined: 30. Aug 2021, 00:28

W10 from vmdk

Post by vei7xuNe »

I have an HP laptop that came with Windows 10 on a 32GB internal drive (sda). I installed a SSD (sdb) in an empty CD bay and installed encrypted artixlinux on sdb2, grub on sdb1. After adjusting the uefi boot order, the machine boots, requests the luks passphrase and then displays a grub menu which includes Win10.

I want to run Win10 as VirtualBox vm in linux from the existing install on sda by attaching a vmdk file (virtualbox manual chapter 9: rawdisk). If the vmdk file is attached to the vm as SATA, then the vm displays "Welcome to GRUB! error: no such cryptodisk found" and goes into grub rescue. If it is atttached as IDE, then the vm goes to a UEFI shell with the EFI partition sda2 mounted as fs0, and W10 can be started by typing in the shell

Code: Select all

fs0:\efi\microsoft\boot\bootmgfw.efi
I'm happy with that after a lot of trial and error :) But since the shell has found and mounted the Windows EFI system partition, I don't understand why it doesn't boot without intervention. Thanks in advance for explanation of what is going on and any suggestions how to fix this.

Code: Select all

System:
  Host: Pluto Kernel: 5.13.12-artix1-1 x86_64 bits: 64 Desktop: Xfce 4.16.0 
  Distro: Artix Linux 
VirtualBox 6.1.26-1 
Machine:
  Type: Laptop System: HP product: HP Notebook v: Type1ProductConfigId 
  Mobo: HP model: 8305 v: KBC Version 73.16 serial: <superuser required> 
  UEFI: Insyde v: F.25 date: 01/19/2017 
Drives:
  ID-1: /dev/sda vendor: BHT model: WR202HH032G E70215F5 size: 29.12 GiB 
  ID-2: /dev/sdb vendor: Aireye model: S1 120GB SSD size: 111.79 GiB 
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: W10 from vmdk

Post by scottgus1 »

It appears that you have the Virtualbox 'hardware' working, kudos on that task!

If your VM is accessing the same Grub loader that the physical OS's run from (which it could be because the error discusses encryption and you used encryption on the Linux setup), it could be that the setup going physical is different than the setup going virtual. Trying to alter this so the command line isn't necessary could damage the physical boot process.

And altering Grub really isn't within the scope of this forum.

A suggestion, if I am anywhere close to understanding the issue so far, see if your raw-disk setup can point directly at the Windows partitions instead of the grub loader partition (if it isn't already, this setup is well beyond my level of expertise.)
vei7xuNe
Posts: 5
Joined: 30. Aug 2021, 00:28

Re: W10 from vmdk

Post by vei7xuNe »

Hi scottgus1,
Thanks for your interest. In this case, sda.vmdk points to sda, the Windows disk, while grub is on sdb, so I expected the vm to ignore grub and boot from the Windows disk. Apparently it does so if sda.vmdk is attached to an IDE storage controller.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: W10 from vmdk

Post by fth0 »

I'd suggest to attach sda.vmdk to the IDE controller, boot into the (U)EFI shell, then enter "exit" to get into the (U)EFI Boot Manager and check the configured boot order.

Alternatively, with sda.vmdk attached to the SATA controller, press the ESC key in rapid succession to get into the (U)EFI Boot Manager and check the configured boot order.
vei7xuNe
Posts: 5
Joined: 30. Aug 2021, 00:28

Re: W10 from vmdk )

Post by vei7xuNe »

fth0 wrote:I'd suggest to attach sda.vmdk to the IDE controller, boot into the (U)EFI shell, then enter "exit" to get into the (U)EFI Boot Manager and check the configured boot order.
Thanks for that suggestion, it was new territory for me. The existing boot manager options either boot to UEFI shell or to grub on sdb ("error: no such cryptodisk...") However, Boot Maintenance Manager/Boot Options/Add Boot Option allows me to select EFI/Microsoft/Boot/bootmgfw.efi. The change is remembered and the vm now boots into Windows 10 unassisted. Thank you!
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: W10 from vmdk

Post by fth0 »

You're welcome! And thanks for reporting back, it may help the next user with a similar problem.
Post Reply