# Get Access on USBs inside a freeBSD VM from a freeNAS Host OS



## Eisigerbaer (Feb 27, 2019)

Hello guys,

I can't figure out how to access USBs which are plugged in my System via freeBSD VM.
My Hypervisior is BHYVE and my host OS is freeNAS.

I only need to get access to the USB-Sticks. To read a textfile which is located on one of these USB-Sticks.

The only Keyword I was able to fine was: PCI-Passthrough. 

I would be truly grateful if you guys have any solutions to my problem.

Kind Regards


----------



## SirDice (Feb 27, 2019)

PC-BSD, FreeNAS, XigmaNAS, and all other FreeBSD Derivatives

There is no USB pass-through on bhyve(8) and PCI pass-through has a few caveats: https://wiki.freebsd.org/bhyve/pci_passthru

Just copy the file in question using scp(1), if you're on Windows WinSCP works really well.


----------



## Eisigerbaer (Feb 28, 2019)

The Problem is: I need to get access to the Files on those USB-Sticks. 
Inside a VM or maybe a Jail?!

So I understand that there is no PCI-Passthrough on BHYVE now. But there must be a way to access this data.


----------



## SirDice (Feb 28, 2019)

Eisigerbaer said:


> The Problem is: I need to get access to the Files on those USB-Sticks.


Use a desktop and copy the file over the network.


----------



## Phishfry (Feb 28, 2019)

I like your earlier scp suggestion better. Make a transfer directory on FreeNAS. cp your USB files over to the transfer directory.
That's what I do. Make a transfer folder on the bhyve host (named /All in this instance) and copy it into the VM with scp.
`scp -r /All user@192.168.1.134:/dump`

I don't see why you couldn't use a USB mountpoint instead of copying to a transfer directory.
Mount your USB stick in FreeNAS and scp your files to your VM's IP address.



Eisigerbaer said:


> there is no PCI-Passthrough on BHYVE now


There is defiantly pass-thru for network cards.


----------



## Eisigerbaer (Feb 28, 2019)

Guys I managed to passthru the USB - Controller to the VM. I can now see the USB controller inside the freeBSD VM. 
Now i am trying this command: 

bhyve -s ppt0,passthru,0/20/0

instead of ppt0 i need the pci but i dont know how to find it out.


----------



## SirDice (Feb 28, 2019)

bhyve/pci_passthru - FreeBSD Wiki


----------

