Your cart is currently empty!
Boot From a USB Drive in VirtualBox in Linux
Running virtual machines is easy with VirtualBox, but if you want to boot a VM directly from a USB drive—maybe to test a live USB or run a portable OS—it gets a bit tricky, especially on Linux. VirtualBox doesn’t offer a “Boot from USB” option in its UI by default. But it’s still possible, and here’s exactly how you do it.
Why Boot From USB in VirtualBox?
- Test live Linux distros without rebooting your PC
- Check or recover data from bootable USB drives
- Try out portable operating systems
Prerequisites
- VirtualBox installed on your Linux machine
(Need help? Here’s a Beginner’s Tutorial to Install VirtualBox on Ubuntu) - A bootable USB drive plugged in
(If you want to make one, check this Step-by-Step Guide to Create a Live USB with Ventoy on Linux) - A basic terminal
Step 1: Find Your USB Drive
First, identify your USB drive device path. Open a terminal and run:
lsblk
Look for your USB drive, for example, /dev/sdb
(do not use a partition like /dev/sdb1
—you want the whole device).
Step 2: Create a VirtualBox VMDK Pointing to the USB
VirtualBox can’t directly use a USB as a boot device, but it can boot from a virtual hard disk file that points to your USB drive.
- Close VirtualBox completely.
- In your terminal, run (replace
/dev/sdb
with your actual USB device):
VBoxManage internalcommands createrawvmdk -filename ~/usb.vmdk -rawdisk /dev/sdb
- This command creates a file called
usb.vmdk
in your home directory, which acts as a pointer to your USB stick.
Step 3: Change Permissions
You’ll need permission to access the USB drive directly.
- The safest way: run VirtualBox as root (not generally recommended).
- Better: add your user to the
disk
group (may require logout/login):
sudo usermod -aG disk $USER
- Or, temporarily change permissions on the USB drive (less secure):
sudo chmod 666 /dev/sdb
Step 4: Attach the VMDK to Your VM
- Open VirtualBox.
- Create a new VM (or use an existing one).
- Go to Settings → Storage.
- Remove any existing virtual hard disk.
- Add a new hard disk, and select “Use an existing virtual hard disk file.”
- Choose the
usb.vmdk
file you created.
Step 5: Boot the VM
- Start the VM.
- If everything is set up, the VM should boot from your USB drive.
Troubleshooting:
- If the VM doesn’t boot, check your boot order in the VM’s settings—make sure the hard disk is first.
- If you get permission errors, double-check your user’s permissions for the USB device and the VMDK file.
- Running out of space in your VM?
Here’s how to enlarge a virtual machine’s disk in VirtualBox or VMware.
Notes and Warnings
- Be careful: When a VM uses a raw disk (like your USB), it has full access and can erase or damage data.
- Only connect one VM to the USB at a time.
- You may need to repeat the permission step if you unplug/replug the USB drive.
Conclusion
Booting from a USB drive in VirtualBox on Linux isn’t a click-and-go feature, but with a few terminal commands, you can do it reliably. This trick is handy for testing live USBs, running portable OSes, or experimenting with bootable tools—no need to reboot your actual machine.
Have questions or got stuck? Drop a comment below and I’ll help you out!
Tech enthusiast and content creator passionate about making technology simple for everyone. I share practical tips, guides, and reviews on the latest in computers, software, and gadgets. Let’s explore the digital world together!