I'm struggling with getting VirtualBox to start a virtual machine using an external USB disk, instead of a virtual hard disk.
When I try to start the VM, it does not start and I see the error:
Failed to open a session for the virtual machine Test2.
The virtual machine 'Test2' has terminated unexpectedly during startup with exit code 1 (0x1).
Result Code: NS_ERROR_FAILURE (0x80004005)
Component: MachineWrap
Interface: IMachine {85632c68-b5bb-4316-a900-5eb28d3413df}
The VM logs are empty.
The USB disk already boots correctly if I choose it as boot device from BIOS. (It has 2 partitions, an MBR bootloader, working grub2 config and an OS in each partition.)
To setup the VM environment, I:
- Installed VirtualBox on Ubuntu 20.04 desktop using the "Ubuntu Software" GUI
- Configured my user account's groups with:
sudo usermod -a -G disk $USER
andsudo usermod -a -G vboxusers $USER
- Created a virtual hard drive file pointing to target physical drive with:
VBoxManage internalcommands createrawvmdk -filename /home/james/VirtualBox-targets/OS-on-dev-sdb.vmdk -rawdisk /dev/sdb
chmod a+rw
on the target drive & its partitions/dev/sdb*
- Opened VirtualBox > File > Virtual Media Manager. Checked virtual HDD is visible. Changed its Type to "Writethrough".
- Created a new VM, opened its Storage section and added the virtual HDD
OS-on-dev-sdb.vmdk
as a new Hard Drive under Controller:IDE
I try starting the new VM, using Virtual Box > [VM] > Normal Start. The error appears consistently every time.
So far, I've tried:
- Rebooting a few times
- Uninstalling VirtualBox, removing the VMDK files, removing the VM folders, downloading & re-installing Oracle's .deb, reconfiguring the same raw disks and VMs as above. See same error message.
- Configuring the VM storage as IDE then as SATA (I am pretty sure the physical USB drive is IDE)
- Creating the raw disks with
-rawdisk /dev/sdb
and with-rawdisk /dev/disk/by-id/wwn-...
- Checking the USB disk still boots okay if chosen from BIOS boot devices.
Update: @FedKad's pointer helped. The extension pack meant the VM got a step further.
The VM now loads the grub bootloader & the bootloader's menu options are presented. An option can be selected.
However, each option raises a similar error:
Waiting 10 seconds for device /dev/disk/by-uuid/e95e5… <etc>
ERROR: device 'UUID=e95e5… not found. Skipping fsck
…
You are now being dropped into an emergency shell
It looks like the linux kernel is not being properly connected with its partition.
Tried a few permutation of VM virtual HDD and USB device settings.
With VM started and no USB device selected, see grub menu in VM. On selecting an OS, see same error:
ERROR: device 'UUID=e95e5… not found. Skipping fsck
With VM started and when grub menu appears select USB device, see new error:
Error: no such device: e95e5…
With USB device filter setup for external drive before VM starts & then VM restarted:
FATAL: Could not read from the boot medium! System halted.
Tried UUID VM instead. With USB filter setup:
FATAL: Could not read from the boot medium! System halted.
Tried some reboots and repeats. See same problem.
.vdi
that VirtualBox uses on the external disk as it is – matigo Mar 19 '22 at 00:21