[Samba] Sharing USB devices?
hal at hal.dance
Wed Feb 9 18:13:01 UTC 2022
I doubt this is possible, but it’s worth asking.
I know that many drives today connect to a computer through a USB device and that I can include the path to that device as a Samba share. I just want to clarify this is NOT what I’m talking about.
I have several devices that are controlled through USB connections on one side of my workshop and the workstation on the other side - behind a curtain where it’s protected from sawdust in the air. The distance is too long for a USB cable. I’ve tried USB-over-Ethernet, but that doesn’t work. (The two locations are joined by fiber running over the ceiling, since we’ve had equipment damage in the past from lightning blowing out whatever is connected to the ethernet cables!)
Also note that I know there is a project, USB/IP, that lets you share a USB port over a network, but it works for Linux and Windows. Within the next year my Linux workstation in the workshop will be replaced with a Mac, and there’s no support for a Mac with USB/IP. There seems to be a few developers who have created new versions of this and are selling it. I’m still trying to get a few answers from one that supports Mac. That may work, but I won’t know it for a while.
I’m wondering if I can put a Raspberry Pi, running Linux, near the devices, in a screened box (to protect it from sawdust), connect my USB devices (including things like a CNC system and a 3D printer, but also other items), and then share the device node file in /dev over Samba.
While I have done a lot of programming, I’ve never had to handle that kind of IO on Linux. My understanding (which could be seriously wrong!) is that IO with many devices is handled by reading and writing to the device node in /dev. If so, I would think sharing that node through Samba would allow me to mount it on another system and read and write to it from that other remote system.
Has anything like this been done with Samba or is it possible to make this work?
More information about the samba