Solved can USB devices be directly assigned to a jail?

Is it possible to directly access a USB device in a jail?

I came across this article:
https://forums.freebsd.org/threads/usb-passthrough-to-iocage-jail.73292/

It seems possible to do so from that article.

If it is possible, would it make sense to create a Linux jail that has raw access to a USB wifi adapter (in order to get more speed out of the wifi device when running an Access Point)? If that is the case, then, if I get a PCI card, I'd imagine I could do the same with that?

Would there be any conflict with BSD and Linux or as long as FreeBSD isn't loading the device drivers, I should be okay?
 
While i don't know anything about passing through USB (or really any device) to a jail i don't think what you are planning will work. While you should be able to run a jail with a Linux userland just fine it'll run on top of the hosts kernel (FreeBSD) so loading any Linux kernel modules (as in for examples wifi drivers) won't work even if there is a possibility for a passthrough. If you wan't to (at least in theory) be able to use Linux drivers you need to go for full virtualization like bhyve or virtualbox.
 
Would there be any conflict with BSD and Linux or as long as FreeBSD isn't loading the device drivers, I should be okay?
You can't load drivers from within a jail. A jail doesn't have a kernel, a jail runs on top of the host's kernel.
 
Okay, that makes sense - I read that in the docs too, but for some reason, I was still thinking that with Linux, perhaps it was different. I'll try bhyve.
 
As Emrion mentioned, you should be able to use a bhyve VM. You can pass PCI devices (including USB controllers) to bhyve guests, so a Linux guest should be able to access your USB wifi adapter.
 
Back
Top