Connecting LUKS-encrypted physical drive as a raw drive

Discussions related to using VirtualBox on Windows hosts.
Post Reply
switcher
Posts: 2
Joined: 13. Nov 2018, 18:51

Connecting LUKS-encrypted physical drive as a raw drive

Post by switcher »

Hello.

I'm trying to boot a linux native setup through VirtualBox, but it doesn't seem to work as expected.
I'm running Windows 10 host with VirtualBox 5.2.
I've created a new virtual machine without hard drive.
Hard drive was then created with foloowing command:

Code: Select all

C:\Program Files\Oracle\VirtualBox> .\VBoxManage.exe internalcommands createrawvmdk -filename "C:\Users\username\Virtual
Box VMs\vmname\disk.vmdk" -rawdisk \\.\PhysicalDrive0
PhysicalDrive0 is another SSD, which has native Debian Stretch install there and is mot mounted on the host.
If it matters, SSD has 3 partitions: /, /home and swap. First two are encrypted with a passphrase.

When I boot VM, after "VM Welcome screen" I only see black screen with blinking cursor. CPU load goes up to ~30% but nothing happens.
VM log at this moment says "00:00:04.552170 VMMDev: Guest Log: BIOS: Booting from Hard Disk...".
Nothing else happens, even hard drive usage icon is not blinking duren the black screen. I've waited for 20 minutes and had to terminate the VM.

Would appretiate any tip or advise on how to make it work.
switcher
Posts: 2
Joined: 13. Nov 2018, 18:51

Re: Connecting LUKS-encrypted physical drive as a raw drive

Post by switcher »

Just realised that I have NVMe SSD, so I created a new NVMe controller and used VMDK there.
Now I got Fatal:Coult not read from the Boot medium ! System halted. And No hard disks found in Boot menu.

Hopefully, I'm moving in the right direction.

Update:
Now it seems that original approach with SATA controller was correct.
However, another problem is that MBR is located on host's drive.
If I create another raw VMDK pointing to host's SSD and boot from it, I boot into my GRUB loader, that's failing and brings me to it's CLI.

Last update, made it work.
As mentioned before, setup with only one hard drive was failing due to MBR is not present on that drive.
Adding host's hard drive to VM in read-only mode solved this issue, though some actions were needed in EFI boot manager like changing the boot order.
SATA controller for both hard drives is used in the end.
Post Reply