Solved can USB devices be directly assigned to a jail?

tOsYZYny

Active Member

Reaction score: 9
Messages: 204

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?
 

ekvz

Well-Known Member

Reaction score: 278
Messages: 431

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.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,300
Messages: 38,823

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.
 
OP
T

tOsYZYny

Active Member

Reaction score: 9
Messages: 204

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.
 

olli@

Daemon
Developer

Reaction score: 1,252
Messages: 1,140

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.
 
Top