FreeNAS 11 - bhyve VM USB passthrough

strker11

Cadet
Joined
Apr 9, 2017
Messages
4
I understand that currently there is no official support of USB passthrough to VM. However, reading this thread (https://forums.freenas.org/index.php?threads/vm-usb-passthrough.47134/), I see that it is possible to passthrough USB, but this requires disabling xhci therefore preventing booting from USB.

However, since I boot from an SD drive, so does this mean I can disable xhci and enable USB passthrough without any adverse effect? Is there any expected timeframe for official support of USB passthrough? If it is impending, then I could just be patient....
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,462
since I boot from an SD drive
That's really not recommended; the reliability and durability of SD cards as boot devices is even worse than that of USB sticks. But in any case, the SD card reader is probably attached internally as a USB device. So, if disabling xhci means that you can't boot from USB, I'd expect you couldn't boot from your SD card either.
 

strker11

Cadet
Joined
Apr 9, 2017
Messages
4
it is a dual SD module which is mirrored so I think that provides some protection against the flaws of SD cards, although I am open to being corrected on this point. It looks like the SD module is recognized as a PCI device so maybe I'll give it a shot and see what happens. Famous last words.
 

strker11

Cadet
Joined
Apr 9, 2017
Messages
4
well I should have actually looked further into what enabling passthrough/disabling xchi entailed before posting. Apparently a recompiled kernel is needed which is beyond the complexity I'm willing to pursue. So I guess I'll wait for official support.
 

Jakob Tewes

Cadet
Joined
Oct 8, 2016
Messages
5
....hmm. I´m having some trouble with "home assistant" in a Jail on FreeNAS. So I'm thinking about a bhyve vm. Thatfor I´d need USB passtrough support. Anyone got a "way to go" - I´d need that for USB Bluetooth and some Serial Interfaces...
 

PascalSav

Cadet
Joined
Jul 23, 2017
Messages
6
Hi,

I'm in the nearly same situation, running Domoticz in a jail, I'd like to use a vm as it's much more easy to manage, maintain, update etc...

The issue comes from the ZWave usb stick I'm using.

Any ideas ?

Thanks.
 

Allan Wilmath

Explorer
Joined
Nov 26, 2015
Messages
99
Virtualize FreeNAS using a type 1 hypervisor like ESXi and then you can run anything you want. FreeNAS is a alpha virtualization platform and jails are not a substitute for containers or VMs. By using a hypervisor you can then use the right OS for the task, and yet still use one box.

ESXi supports USB passthrough, it also supports passthrough of an entire USB controller, which has some real benefits. USB passwthrough on Type 2 hypervisors in my experience is very hit or miss, not something I would do if you need it to be reliable. This has to do with the device being initialized by the host OS, and the being reinitialized by the guest OS.

The cost of an LSI controller and a motherboard and CPU the supports PCI-passthrough can really add to the cost of building a FreeNAS box, but it was well worth it. Interestingly the recommend hardware for FreeNAS with ECC, intel Xeon, and LSI controller are the same parts you need to virtualize FreeNAS. Subtle hint by the developers?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,462
FreeNAS is a alpha virtualization platform and jails are not a substitute for containers or VMs.
Well, jails are containers, so I'm not quite sure what you're trying to say there, but it's true that they aren't the same as VMs; they each have pros and cons.
 

asroman

Cadet
Joined
Jan 10, 2017
Messages
5
Hi,

I'm in the nearly same situation, running Domoticz in a jail, I'd like to use a vm as it's much more easy to manage, maintain, update etc...

The issue comes from the ZWave usb stick I'm using.

Any ideas ?

Thanks.

Hi, if the issue is still open: I was looking for a solution as well, running openHAB2 in a Win10 VM, trying to start a zigbee connection. Finally I managed to 'passthrough' the zigbee controller dongle by attaching the USB dongle to my router (AVM Fritzbox 7580). The router offers USB remote-access. So far it works well, tested with one zigbee device (Osram lightify surface light). Maybe it is an alternative for you too.

cheers
 

wmn79

Explorer
Joined
Apr 23, 2015
Messages
59
That sounds interesting, I'm looking into passing through my conbee zigbee stick. Don't have a fritzbox though but running Merlin AsusWRT on a Netgear R7000. My Home assistant install with my z-wave stick runs in a jail without issues. Now I need to get this running on my FreeNAS system to be able to use it in Home Assistant. Any suggestions on how to get to your setup? Or any other suggestions on how to get it running? Unfortunately there are no sources available to compile it and run it in a jail.
 

asroman

Cadet
Joined
Jan 10, 2017
Messages
5
Any suggestions on how to get to your setup? Or any other suggestions on how to get it running? Unfortunately there are no sources available to compile it and run it in a jail.
I moved away from the Fritzbox solution to a dedicated USB device server, since I also wanted to attach a zwave controller and it was not supported by Fritzbox. I bought one of these
https://www.amazon.com/Silex-DS-510-Device-Server-Ports/dp/B00U9UDSH8
it‘s around 90USD. Not cheap, but I didn’t see another option, and it works fine so far.
 

nanopete

Dabbler
Joined
Nov 20, 2014
Messages
47
I moved away from the Fritzbox solution to a dedicated USB device server, since I also wanted to attach a zwave controller and it was not supported by Fritzbox. I bought one of these
https://www.amazon.com/Silex-DS-510-Device-Server-Ports/dp/B00U9UDSH8
it‘s around 90USD. Not cheap, but I didn’t see another option, and it works fine so far.
A USB-device-server was a great idea asroman. It let me to find I can probably use an old Raspberry Pi as a USB/IP server for my HomeAutomation VM to use.
That is especially useful in this case because the USB device is a zigbee/zwave interface that should be out and about, close to my household things and then its connected over network to my freenas server hidden away in a closet somewhere.
 

vinistois

Dabbler
Joined
Sep 12, 2018
Messages
11
how are you guys connecting from your docker host to the silex DS-510? I've used those alot but never w/ linux.

So is this working? plug your usb zigbee and z-wave sticks into Silex box and attach them to your hass docker?
 

Lee Spangler

Dabbler
Joined
Sep 30, 2014
Messages
26
I moved away from the Fritzbox solution to a dedicated USB device server, since I also wanted to attach a zwave controller and it was not supported by Fritzbox. I bought one of these
https://www.amazon.com/Silex-DS-510-Device-Server-Ports/dp/B00U9UDSH8
it‘s around 90USD. Not cheap, but I didn’t see another option, and it works fine so far.

Fascinating. I note you have a W10 setup. Were there drivers for the device. I have a Hassio VM that I would really like to directly connect a zwave stick to.

if anyone has an idea of how to do use this device in Hassio - I’d love to hear it.
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
291
I'm looking into this as well... Looks like we'll need to add a docker container for the new zwavedaemon changes coming to Home Assistant.
 

Lee Spangler

Dabbler
Joined
Sep 30, 2014
Messages
26
Well, I’m running full hassio (home assistant) in a VM with an MQTT server in a jail. I hope that will work.

But that brings me back to the USB server - does anyone know if that can somehow work in my setup. I’d like to use a z wave usb stick with that device and let my VM access it. I’m fairly savvy, but no where near an expert on such matters.
 

Lee Spangler

Dabbler
Joined
Sep 30, 2014
Messages
26
For those interested here is the VM setup:

 

tprelog

Patron
Joined
Mar 2, 2016
Messages
291
I'm using the FreeNAS plugin for HA but I've followed that VM guide myself just to give the full Home Assistant Supervised experience a try. I think that is the best guide to follow if you choose that approach

Really you can mix and match anything... Hass add-ons are basically docker containers that have been tweaked for configuration and management through the HA UI. Given a users know how, any software provided by HA addons, can be installed and configured completely independent of Home Assistant.

I’m running full hassio (home assistant) in a VM with an MQTT server in a jail. I hope that will work.
So to answer this question -- Yes it works perfectly fine.

But that brings me back to the USB server - does anyone know if that can somehow work in my setup. I’d like to use a z wave usb stick with that device and let my VM access it.

For the changes coming with zwavedaemon, we will both now both face the same issue. I have looked at creating a FreeNAS plugin for zwavedaemon but I do not feel it is something I'll be able to easily maintain

I looked at the USB server approach ... but I have no desire to host a VM ( for using docker or otherwise ) on my FreeNAS. I have instead set up a pi with raspbian-lite and docker, then installed zwavedaemon container to the pi as well. Basically I just made the pi my new dedicated "Z-Wave hub". I think solution would work for both the FreeNAS plugin and ppl using the VM approach. This method would not give access of the USB to the VM but would still effectively provide the desired end result... Using Z-Wave in Home Assistant
 
Last edited:

Lee Spangler

Dabbler
Joined
Sep 30, 2014
Messages
26
That is something I didn't know about. Right now I access my Zwave devices through my Vera hub. The hub doesn't handle the Schlage lock's latest firmware very well. So, I was looking to use a zwave usb stick, but couldn't figure out how to get that done. I REALLY like running HA in a VM. I thought this dongle server would be helpful.

Still any information I can get on the USB device, it'd be appreciated. I'll keep watching for the implementation of OpenZwave.
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
291
I REALLY like running HA in a VM
I understand and there should be no reason you need to change :)


I thought this dongle server would be helpful.
I think the dongle server is a viable solution but it will be uncommon and maybe not so easy to find help.


Still any information I can get on the USB device, it'd be appreciated.
It is my opinion, that best approach will be to connect the USB dongle to a raspberry pi with docker installed.

I have found and followed these simple guides to setup my RPI 4
1. Install raspbian-lite
2. Installing docker
3. Install portainer ( this is optional )

Finally to use you Z-Wave dongle with Home Assistant there are two options ( both options will bring your Z-Wave devices into HA using MQTT ) Help deciding between these options is a good discussion for the HA forums.

This is probably the recommended option and what is suggested in the post you have linked above
-- On the Raspberry PI -- Install Zwave2Mqtt ( Install this the docker way )

The second option is still in development -- this will eventually replace the existing Z-Wave integration that HA is currently using.
There are two parts. Both are required
-- On the Raspberry PI -- Install qt-zwave ( aka zwave daemon )
-- In Home Assistant -- Install home-assistant-z-wave-over-mqtt-integration-pre-release
 
Top