How do I use an actual drive (like a USB stick) in VirtualBox?
How do I use an actual drive (like a USB stick) in VirtualBox?
Let's say I want to install Ubuntu on an USB stick using VirtualBox. How can I make a VM that instead of writing to a virtual drive, writes to an USB stick?
-
- Site Moderator
- Posts: 19855
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Windows, Linux
Re: How do I use an actual drive (like a USB stick) in VirtualBox?
There is a process called Raw Disk Access that can give Virtualbox direct access to a physical disk, see the manual, https://www.virtualbox.org/manual/ch09.html#rawdisk
It is an experts-only feature and with wrong use can hose your PC. We don't show folks how to do it on the forum.
A USB-3-or-faster-connected SSD drive will be OK, though. Don't unplug the drive while the VM is running.
It is an experts-only feature and with wrong use can hose your PC. We don't show folks how to do it on the forum.
You'll find that USB sticks will die an early death if you install a modern OS on it. USB sticks are not designed for the constant writes a modern OS does.Maks7584 wrote:writes to an USB stick?
A USB-3-or-faster-connected SSD drive will be OK, though. Don't unplug the drive while the VM is running.
-
- Site Moderator
- Posts: 38846
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Mostly XP
Re: How do I use an actual drive (like a USB stick) in VirtualBox?
A VM can't use anything other than virtual drives - being a virtual machine. The only question is whether it accesses the drive using high level fast cached file I/O, or slow low level uncached sector I/O - the latter of which will require fighting Windows for admin rights. So I hope you weren't assuming that raw access would be faster.Maks7584 wrote:How can I make a VM that instead of writing to a virtual drive, writes to an USB stick?
A better option IMO would be to locate the entire VM on the external drive, which incidentally should be an SSD or mechanical drive, not a USB flash drive (see Scott's comments).
That said... I assume you have good reason for wanting to use an external drive, but note that it carries several risks, the principle one being the unreliability of the USB connection which can lead to the drive being corrupted and data lost. Not a problem if you make backups and/or don't store anything important in there.