How can I have Ubuntu in VirtualBox write to a usb drive?

So I needed Ubuntu to get a certain project done. So I researched how to do it and I installed VirtualBox and I got Ubuntu running. Everything was going great until I got to the point where I had to have it access the USB drive.

I eventually found that you can create a shared folder that is tied to the usb directory, so I was able to read it. But when it came time to write to the USB drive, it fails at 2% and say it can’t write to it.

So ChatGPT said you can’t write to a shared folder and you have to have Ubuntu recognize the actual USB device. CGPT had me try a bunch of stuff. Go up into devices and add the usb. Then I get an error saying it cannot add the device.

Anyone have any ideas? Super disappointing getting everything done just to fail at the end point of writing to the USB.

What is the host OS?
Do you need both the host and the guest to simultaneously have access to the USB drive?

You should be able to add a USB Device filter in the Virtual Machine settings here:

This should allow any USB device on the host machine to be used in the guest machine. That said, I haven’t been able to get it to work for a while.

1 Like

It’s a windows 11 pc. No I only need the Ubuntu vm to be able to write to the usb.

Thanks.

Yep ChatGPT had me try that.

I tried 1.0, 2.0 and 3.0 just to make sure.

None of them worked.

I’m shocked that this problem exists.

We have the ability to be running a virtual machine which is so cool and then have the ability to do all this other stuff, but I can’t write to a usb drive?

Thanks.

Try the official package from Oracle and see if that works better (uninstall the repo version first).

ChatGPT is notorious for being wrong. Use with caution. This is the correct support venue for items in the Ubuntu repos. Although I just pointed you to the official package from Oracle, that’s mostly as a troubleshooting step to see if it’s a bug in our package or an upstream bug.

There’s a small chance this is an apparmor issue too, but I want to eliminate a few things before we go further.

The link below explains it and is the process suggested above but you need to have the VBox Extension Pack installed. Explained at the link below.

https://www.linuxbabe.com/virtualbox/access-usb-from-virtualbox-guest-os

Technically, since this is not an Ubuntu issue, we should not be supporting this here as you are not using Virtualbox as an Ubuntu package. The first step is always in getting Virtualbox to communicate with the USB interface, but that has to be done on the Windows side.

Since this is a Virtualbox on Windows issue, not a Virtualbox on Ubuntu issue, support should stop here.

I agree with this.

I’ll leave one clue: you need the Extension Pack from VirtualBox.

With that, I’m closing this.