How To Share USB Devices Over IP Using A Raspberry Pi

  Рет қаралды 14,768

Tech Tutorials - David McKone

Tech Tutorials - David McKone

Күн бұрын

If you want to share a USB device over IP, then you can do this for free using a Raspberry Pi
Although, only one Linux computer can use a USB device at a time
This could be used to allow you to configure a VM for instance to access a USB device over the network without tying it to a specific hypervisor so that you can migrate the VM more easily
It allows you to share USB devices from a central location so that you don't have to be physically present to transfer them between computers
It also provides an option to place USB devices such as radio controllers in areas where they can get better wireless coverage, but access them from a server in a rack for instance
Useful links:
derushadigital.com/other%20pr...
wiki.archlinux.org/title/USB/IP
Hardware Suggestions:
Raspberry Pi 4 Kit
amzn.to/3eyU0OZ
NOTE: I am part of the Amazon affiliate program and may earn commission through Amazon website links if used. However, there is no additional cost to the buyer
=============================
SUPPORT THE CHANNEL
Donate through Paypal:
paypal.me/DavidMcKone
Donate through Buy Me A Coffee:
buymeacoffee.com/dmckone
Become a monthly contributor on Patreon:
/ dmckone
Become a monthly contributor on KZfaq:
/ @techtutorialsdavidmckone
==============================
==============================
MEDIA LINKS:
Website - www.techtutorials.tv/
Twitter - / dsmckone1
Facebook - / dsmckone
Linkedin - / dmckone
Instagram - / david.mckone
==============================
Steps Taken
See pinned comment for configuration details as some characters aren't allowed in the description
Chapters
00:00 Intro
00:55 Overview
01:31 Server
14:04 Client
22:43 Summary
Credits
LoveLife | Instrumental Prod. Blue Mango | EQMUSEQ.COM by Don Da Vinci
soundcloud.com/eqmuseq/loveli...
usb over ip,usb over ip raspberry pi,usb over ip free,usb over ip ubuntu,usb over ip network,raspberry pi usb over network,raspberry pi usb over ip,raspberry pi usb over ip server,usb over ethernet,usb over network,share usb over network
Raspberry Pi USB Over IP

Пікірлер: 47
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone Жыл бұрын
Raspberry Pi: Switch to root account su - Install software apt install usbip modprobe usbip_host echo 'usbip_host' >> /etc/modules List USB devices and note down the product/vendor usbip list -l Create start script nano /usr/sbin/usbip_start.sh #!/bin/bash usb1='0781:5567' usb2='0658:0200' /usr/sbin/usbip bind --$(/usr/sbin/usbip list -p -l | grep '#usbid='$usb1'#' | cut '-d#' -f1) /usr/sbin/usbip bind --$(/usr/sbin/usbip list -p -l | grep '#usbid='$usb2'#' | cut '-d#' -f1) Make this executable chmod +x /usr/sbin/usbip_start.sh Create stop script nano /usr/sbin/usbip_stop.sh #!/bin/bash usb1='0781:5567' usb2='0658:0200' /usr/sbin/usbip unbind --$(/usr/sbin/usbip list -p -l | grep '#usbid='$usb1'#' | cut '-d#' -f1) /usr/sbin/usbip unbind --$(/usr/sbin/usbip list -p -l | grep '#usbid='$usb2'#' | cut '-d#' -f1) killall usbipd Make this executable chmod +x /usr/sbin/usbip_stop.sh Create service nano /lib/systemd/system/usbipd.service [Unit] Description=usbip host daemon After=network.target [Service] Type=forking ExecStart=/usr/sbin/usbipd -D ExecStartPost=/bin/bash -c '/usr/sbin/usbip_start.sh' ExecStop=/bin/bash -c '/usr/sbin/usbip_stop.sh' [Install] WantedBy=multi-user.target systemctl --system daemon-reload systemctl enable usbipd.service systemctl start usbipd.service Check what USB devices are found usbip list -p -l --- Linux Client Switch to root account su - Check USB device is attached lsusb Install software and create a service apt install usbip hwdata usbutils -y modprobe vhci-hcd echo 'vhci-hcd' >> /etc/modules Create start script nano /usr/sbin/usbip_start.sh #!/bin/bash server1='192.168.200.7' usb1='0781:5567' usb2='0658:0200' /usr/sbin/usbip attach -r $server1 -b $(/usr/sbin/usbip list -r $server1 | grep $usb1 | cut -d: -f1) /usr/sbin/usbip attach -r $server1 -b $(/usr/sbin/usbip list -r $server1 | grep $usb2 | cut -d: -f1) Make this executable chmod +x /usr/sbin/usbip_start.sh Create stop script nano /usr/sbin/usbip_stop.sh #!/bin/bash /usr/sbin/usbip detach --port=$(/usr/sbin/usbip port | grep '' | sed -E 's/^Port ([0-9][0-9]).*/\1/') /usr/sbin/usbip detach --port=$(/usr/sbin/usbip port | grep '' | sed -E 's/^Port ([0-9][0-9]).*/\1/') Make this executable chmod +x /usr/sbin/usbip_stop.sh Create service nano /lib/systemd/system/usbip.service [Unit] Description=usbip client After=network.target [Service] Type=oneshot RemainAfterExit=yes ExecStartPost=/bin/bash -c '/usr/sbin/usbip_start.sh' ExecStop=/bin/bash -c '/usr/sbin/usbip_stop.sh' [Install] WantedBy=multi-user.target systemctl --system daemon-reload systemctl enable usbip.service systemctl start usbip.service Check USB device is attached usbip port lsusb
@peterkleingunnewiek5068
@peterkleingunnewiek5068 Жыл бұрын
thanks David for de Great tutorial. How can I add the USB client to supervised homeassistant? So I can add zwavesticks, memory sticks, RFX com usb devices to my virtual homeassistant machine
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone Жыл бұрын
@@peterkleingunnewiek5068 The supervised install uses Debian so you can add the client software similar to what was done in the video. After you attach a USB device it should then be useable
@peterkleingunnewiek5068
@peterkleingunnewiek5068 Жыл бұрын
@@TechTutorialsDavidMcKone Thanks for you Help, when type "apt install usbip hwdata usbutils " for installing client I get in Homeassistant web terminal "zsh: command not found: apt" or do I have to login into de supervisor docker container and must I then install portainer to do this or is the a more simple way to do that? I am using a vmware ova with supervisor-core and host installed. The Hacs installation did work from within this terminal.
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone Жыл бұрын
@@peterkleingunnewiek5068 You need to be logged into the Debian operating system Once you add the USB devices there, Home Assistant should be able to detect them like any other USB device
@gnulinux-mj
@gnulinux-mj Жыл бұрын
BigTHX for Information. Very good guidance !!!👌
@davidbarker-tf2vo
@davidbarker-tf2vo Жыл бұрын
I needed a long USB cable for my project and I found it here. Arduino Mega Raspberry Pi Ubuntu. Thank you David.
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone Жыл бұрын
Thanks for the suggestion
@davidbarker-tf2vo
@davidbarker-tf2vo Жыл бұрын
Thanks!
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone Жыл бұрын
Many thanks, much appreciated
@beadon1
@beadon1 9 ай бұрын
Very useful for connecting USB devices on one machine from another. However, this solution is a little finnicky when the USB devices suddenly disconnect. (someone unplugs from the other side). Or, if the USB device operates in 2 different modes -- as often occurs with embedded systems which is seen by the linux system as a new USB device entirely. Devices like TI , or Nordic chipsets flip between "normal" (debug) and "device firmware update" mode.
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone 9 ай бұрын
Yeah, I find it works great for single use over distance, but as you say an interruption breaks things and requires manual intervention The code for this was written a long long time ago but it still works and it does the job I've been finding it very useful for a VM as it allows me to migrate it between nodes during patching without any downtime
@beadon1
@beadon1 9 ай бұрын
@@TechTutorialsDavidMcKone - If USBIP supported sending an entire "hub" to a remote machine, then unplug/replug and devices switching behaviors while still connected should be a seamless experience. Do you know of a way to export 1 whole hub (and all peripherals then would be shared automatically )
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone 9 ай бұрын
@@beadon1Nothing I've really looked into. I just wanted to separate USB devices from Proxmox VE and so USB over IP setup has been working fine
@streamx2
@streamx2 Жыл бұрын
I want to share a usb containing some pictures, where would i access those pictures from on the clinet machine ( ubuntu)?
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone Жыл бұрын
As long as the USB flash drive shows up on the client you should be able to mount it You can check if it's detected by Linux by running the following command from a terminal session lsusb
@cdxer
@cdxer 4 ай бұрын
this video needs an update as "apt install usbip" won't work anymore. the package is not found
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone 4 ай бұрын
What OS are you using as it still works for Debian 12?
@elwinbeekman8531
@elwinbeekman8531 Жыл бұрын
i have 2 usb's with same vendor id, do you have a fix for it ? thanks for the video!
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone Жыл бұрын
I'm assuming you have two copies of the same device? So the vendor id AND product id are the same Not something I've run into as each device on the Pi is different But it would require some way of changing the product id I did a search on Google myself and didn't find anything particularly useful
@elwinbeekman8531
@elwinbeekman8531 Жыл бұрын
@@TechTutorialsDavidMcKone Hi, thanks for you respone. nah 1 for the evohome ramses, the other is for DSMR (Dutch energy p1 monitor) but same vendor and id. but I did find a workaround. hope it will work.
@beadon1
@beadon1 9 ай бұрын
@@elwinbeekman8531 many time it's possible to flash a new serial number to a USB device like this. However, your mileage may vary ..
@nxtphone4696
@nxtphone4696 Жыл бұрын
thank you for the tutorial. i installed usbip but wasn't able to load the modules. getting "modprobe:FATAL Module usbip_host not found in directory /lib/modules/6.1.19-v8+. however the modules are located in /lib/modules/6.1.19-v8+/kernel/drivers/usb/usbip/ compressed as *.ko.xz
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone Жыл бұрын
Are you logged in as root or are you using sudo to execute commands? And is the Ubuntu OS up to date Because it worked fine for me on the latest version while logged in as root
@nxtphone4696
@nxtphone4696 Жыл бұрын
@@TechTutorialsDavidMcKone thanks for your suggestions. my raspberry just needed a reboot for some reason but ok. setting up the host and binding my usb-sata docking station worked well just with sudo. not sure the windows client connected succesfully to the adapter but i think it did. unfortunately no HDD drives showed up though.
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone Жыл бұрын
@@nxtphone4696 Good to know things worked I haven't tried hard drives, more flash drives as well as USB Z-Wave and Zigbee controllers for Home Assistant
@bahadirm
@bahadirm Жыл бұрын
How do I share USB Devices between Windows systems over IP? Currently I'm using RDP+RemoteFX, but the USB device will obviously be disconnected if I disconnect from the RDP session.
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone Жыл бұрын
Other than Windows projects that were abandoned a long time ago and so probably unsafe, I only came across commercial options for Windows clients like Flexihub Another option I suppose might be Windows Subsystem for Linux But that's why the video only covers Linux
@eadweard.
@eadweard. 8 ай бұрын
There's dorssel/usbipd-win
@davidk.3450
@davidk.3450 6 ай бұрын
What would be the minimum hardware (server) that one could imagine to transport exactly 1x USB into the network? Because I only need computing power on the client. In an ideal World even with POE ;)
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone 6 ай бұрын
Not sure what else there is other than a Raspberry Pi or similar as you need something to run Linux But you can get a POE HAT for a Pi if it helps
@davidk.3450
@davidk.3450 3 ай бұрын
@@TechTutorialsDavidMcKone For Sure I allready have such. But my PI3 (Pi1+2 do not have PoE Headders) is ideling with 3-5% CPU load for this task. On the other hand the FAN for cooling PoE is runng most of the time. (Btw. PoE for Pi5 is a technical desaster as known). So the intention was to hear about something that I had not on my screen. ;)
@E3SniperspreeE3
@E3SniperspreeE3 Жыл бұрын
I tried to send a usb3.0 capture card over ip. And I could not get it to work. No card worked. Do you think it could be a driver issue? All other usb devices worked.
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone Жыл бұрын
Unfortunately I don't have one to test myself but it could be a driver problem
@E3SniperspreeE3
@E3SniperspreeE3 Жыл бұрын
@@TechTutorialsDavidMcKone Would you consider adding It to the list of video ideas? I have tried an elgato, but that is very windows dependent. The one I recommend is the Evga XLR lite. It has linux support. Impressive specs for $50 with passthrough. This will work wonderfully for sending video over the network to a streaming pc/server. Ndi is too much cpu for older machines.
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone Жыл бұрын
Does it work if you plug it directly into the computer rather than connecting over the network?
@E3SniperspreeE3
@E3SniperspreeE3 Жыл бұрын
@@TechTutorialsDavidMcKone yes. And with an over a 30ft usb extender (active). The ability for other computers to pick up the signal is lost with the direct plug in approach.
@melissa6793
@melissa6793 Жыл бұрын
it would be very helpful to put the commands you copy and paste in the description. I tried it but keep getting tcp connect errors. usbip: error: tcp connect Both devices, the Pi and the VM are are on the same subnet
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone Жыл бұрын
Check the pinned comment as that contains the details The description doesn't accept some characters
@absak
@absak Жыл бұрын
hey, i am running this in a proxmox LXC container but i cannot get it to make these command work : modprobe vhci-hcd echo 'vhci-hcd' >> /etc/modules i'm guessing these need to be runned at the host shell right ? because when i try to run them in the container it says : modprobe: FATAL: Module vhci-hcd not found in directory /lib/modules/5.15.102-1-pve and when i try to start the service none the less it says Job for usbip.service failed because the control process exited with error code. and the error code is Mar 26 19:43:39 octoprint-debian systemd[1]: Starting usbip client... Mar 26 19:43:39 octoprint-debian bash[15069]: usbip: error: import device Mar 26 19:43:39 octoprint-debian bash[15074]: usbip: error: import device Mar 26 19:43:39 octoprint-debian systemd[1]: usbip.service: Control process exited, code=exited, status=1/FAILURE Mar 26 19:43:39 octoprint-debian systemd[1]: usbip.service: Failed with result 'exit-code'. Mar 26 19:43:39 octoprint-debian systemd[1]: Failed to start usbip client.
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone Жыл бұрын
Containers and VMs for that matter are limited in what they can do in all sorts of ways If you want to share hardware for instance you have to add it at the host level and then make it available to a container
@absak
@absak Жыл бұрын
@@TechTutorialsDavidMcKoneoh I see, I've been trying to get it to work all day, I'll have a try with that approach when I'll have time, otherwise I'll just use a lan USB extender, but I'd like to get it to work myself... And thanks for the quick update !
@xgrapher
@xgrapher 8 ай бұрын
how to share over the internet, i can't find a single video, all are for local networks
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone 8 ай бұрын
It's usually not a good idea to expose things directly to the Internet If you need to access something over the Internet, the better security practice is to setup a VPN tunnel and access any devices through that Another concern though might be the extra delay due to the distance apart
@xgrapher
@xgrapher 8 ай бұрын
@@TechTutorialsDavidMcKone I want to expose, don't worry about it, do you know how to do it, not by VPN or tunnel, then I can simply use TeamViewer. I want USB access over the internet period
Control ANY COMPUTER with these Pi KVMs!
17:46
Jeff Geerling
Рет қаралды 809 М.
PiVPN : How to Run a VPN Server on a $35 Raspberry Pi!
35:06
Sigma Kid Hair #funny #sigma #comedy
00:33
CRAZY GREAPA
Рет қаралды 39 МЛН
ЧУТЬ НЕ УТОНУЛ #shorts
00:27
Паша Осадчий
Рет қаралды 10 МЛН
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 9 МЛН
Intro to Docker using a Raspberry Pi 4
20:49
Gary Explains
Рет қаралды 213 М.
You're running Pi-Hole wrong! Setting up your own Recursive DNS Server!
18:02
Digi AnywhereUSB/14 Reliably Attach USB to any VM - 716
24:40
My PlayHouse
Рет қаралды 29 М.
The Mini PC You SHOULD Be Looking At
11:50
Hardware Haven
Рет қаралды 1,2 МЛН
Broadcast Audio Over IP Explained
16:48
Bartos Media
Рет қаралды 25 М.
USB over IP
8:48
Tall Paul Tech
Рет қаралды 39 М.
Hack like Mr Robot // WiFi, Bluetooth and Scada hacking
45:23
David Bombal
Рет қаралды 2,1 МЛН
Proxmox How To Backup and Restore VMs to a NAS
37:18
Tech Tutorials - David McKone
Рет қаралды 4,3 М.
Looks very comfortable. #leddisplay #ledscreen #ledwall #eagerled
0:19
LED Screen Factory-EagerLED
Рет қаралды 9 МЛН
Look, this is the 97th generation of the phone?
0:13
Edcers
Рет қаралды 7 МЛН
Better Than Smart Phones☠️🤯 | #trollface
0:11
Not Sanu Moments
Рет қаралды 16 МЛН