I successfully shared a device from a USB port of my Raspberry Pi (running Raspbian) to a Ubuntu virtual machine on a local server, using usbip.
Here's a list of the commands I'm running:
On the server side (Raspberry Pi):
modprobe usb-core
modprobe usb-host
sudo usbipd -D
sudo usbip --debug bind -b 1-1.2
On the client side (Ubuntu server):
modprobe vici-hcd
sudo usbip attach 192.168.100.100 1-1.2
It's working well but every time the local network has a problem, I need to do all the process again on both sides. This makes it really hard to use in a production mode because I'd like this system to be reliable and resilient.
I added the modules to /etc/modules to have them start when booting (not sure if it's working), but in that case, the problem is happening without any reboot.
I'm writing two scripts to run these commands periodically on both sides but it still won't be an ideal solution considering that the server has to bind before the client can attach.
Am I doing it wrong? Is there anyone that found a reliable way to make usbip working, which doesn't require to reconfigure everything all the time?