Enable usb serial in hassio on virtualbox

Hi all, i have a Hassos running in a virtual box on a windows 10 machine. i have RS232 serial connected to a usb port on the windows machine. i would like to access that in hassos but cant figureout how. anyone know how to setup usb in virtual box.

Thanks

I’ve done this. In windows device manager, find out what port it is using. For instance, COM7 or something. Then, in VB go to “Serial Ports” in the machine setttings (while the machine is turned off).

“Enable Serial Port” --> Checked
“Port Number” here doesn’t really matter, that’s the port that it will be inside the VM.
“Port Mode” --> “Host”
"Connect using existing pipe/socket --> Checked
“Path Address” --> The windows port (COM7) or whatever.

Click okay and boot it up, it should appear under supervisor–>system–>hardware\

image

thanks @NK553 how do i know which one is my port?

image

Um… I’m not sure why you have so…many. I have 4:

/dev/ttyS1 is usually the first one populated, try that.

Why not just USB passthrough? Although it can be finicky at the times.

In regard to your comment “why not just use USB passthrough?”. Can you help me to do this. I have VirtualBox 6.1 and found a tutorial (of sorts) on how to do it with VB 5, but I stall at the instruction “Now, head to Devices → USB, and click on ‘USB device to share’”. The closest my installation of VB has is Settings - User interface - dropdown for Devices then check boxes, one of which is USB which is already checked. I have my USB device working but I want it to be accessible by Hassio upon a restart of the VB (ie power loss and restore)
Edit: I forgot to say I have VB set up on Windows 10. I just perused the manual (just references to USB - maybe a thousand) since it’s 400 plus pages long. No joy.

It sounds like you’re using the settings from the VM Manager, you need to go to the running VM and choose Devices > USB - image

1 Like

Not sure what you were trying to say - it cut off everything with picture. I have found others with the same problem and the solution given in most cases either works or doesn’t for them too. I thought I was onto something the other day and tried again to no avail. There was a checkbox at the bottom for “any” someone said to check and it seemed to work - it didn’t and I can’t find the instructions in History. I am on a different computer now so can’t look at VB. To reiterate how far I get: the USB is seen by Virtual Box if I restart the VB, but only if I get it to see it once after the Windows machine starts. If for some reason the Windows machine powers down/restarts, VB does NOT see the USB. It’s in the list of filters. I have VB starting as a service if that has anything to do with it. I know it adds another layer to troubleshooting when I inevitably don’t see my Zwave or Zigbee devices in Home Assistant; I have to stop the service and open a new instance of VB and of course don’t see the USB. And again, disengaging and reengaging the USB lets VB “see” the USB. I think I tried last month without the service and I’m now pretty sure that I will have to keep my “solution” - just thought there should be an easier way. There probably is but for some reason things that work for other people don’t work for me.

I’m only getting started with HA so certainly no expert… although lots of experience with errors :slight_smile:
Re the picture, if you go to the running VM and click Devices > USB, you would see a tick if the device is recognised. You can select it manually as well.
I found an article that stated that the USB is not really ‘shared’, if you mount it for the guest OS then the host OS can’t see it, that could be why you’re seeing it on and off.
Have you installed the extension pack for USB 2.0 and 3.0 support?

I installed it, changed the VM Manager USB settings to 2.0 and then I could see device details in Home Assistant > Supervisor > System, options under Host to see Hardware. I could see references to the serial device so figured out the ‘/dev/ttyusb0’ reference. Although I see more info in the Host output than your screenshot. Maybe a before and after screenshot will help show when it appears.
I hope some of this helps.

Thanks for the attempt. I went back to make sure, but I tried this way - and many others. Guess I’m lucky to have found a solution even though it’s WAY more complicated than it should have to be. I took a screen shot that hopefully illustrates my settings; pretty sure they are what you describe. If I stop the machine (VB) and start again, of course the USB shows up. It’s when I shutdown the host (Windows) PC and the VB starts as a service via VBoxVMService (per instructional video by the Hookup) that the USB drive is not accessed.

After the restart, is anything showing in the Supervisor > System > Hardware? I’ve seen comments about the drive reference changing. If it’s not accessible at all in the guest OS, is it accessible in Windows? This is without trying to change anything, just straight after restart.