How to Boot from a USB Drive in VirtualBox
Virtual machines are a powerful tool for testing and experimenting with different operating systems without making changes to your main computer setup. One of the convenient ways to boot in VirtualBox is to use a bootable USB drive. However, this requires some preliminary setup, as VirtualBox doesn’t support direct USB booting by default. Let’s go over how to do this step-by-step.
Step 1: Prepare the Bootable USB Drive
Before configuring VirtualBox, ensure that the USB drive is correctly set up:
- The USB drive should be formatted as FAT32 or NTFS (depending on the OS you plan to boot).
- Ensure that a bootable OS image is on the USB drive (you can use software like Rufus or Balena Etcher for this).
Step 2: Configure VirtualBox for USB Boot
To boot from USB in VirtualBox, follow these steps:
- Launch VirtualBox with administrator rights. This is necessary because access to USB devices requires elevated permissions.
- Create a virtual hard disk that points to the USB drive: use
VBoxManage
—a command included with VirtualBox. Open the command prompt and run:
VBoxManage internalcommands createrawvmdk -filename "C:\path\to\usb.vmdk" -rawdisk \\.\PhysicalDriveX
Here:
"C:\path\to\usb.vmdk"
is the location where the VMDK file will be saved (choose a convenient location).PhysicalDriveX
is the device number for the USB drive. To find this, open “Disk Management” in Windows and note the disk number.
Step 3: Attach the Created VMDK to the Virtual Machine
- Open VirtualBox and select the virtual machine where you want to boot from the USB drive.
- Go to Settings > Storage and add a new hard disk, selecting the VMDK file created in the previous step.
Step 4: Set the Boot Order
To ensure the virtual machine boots from the USB drive, set the boot priority:
- Go to Settings > System > Boot Order.
- Move the hard disk (the one pointing to the USB drive) to the top of the boot list.
Step 5: Start the Virtual Machine
You’re now ready to start the virtual machine and boot from the USB drive. Click “Start” and watch your OS load.
Common Issues and Solutions
If VirtualBox doesn’t recognize the USB drive or shows an error:
- Make sure VirtualBox is running with administrator rights.
- Verify that the USB drive is formatted correctly and boot-ready.
- Try using a different USB port if needed.