{"id":2896,"date":"2023-10-14T19:16:36","date_gmt":"2023-10-14T19:16:36","guid":{"rendered":"https:\/\/voodoo.business\/?p=2896"},"modified":"2026-10-07T00:53:07","modified_gmt":"2026-10-07T00:53:07","slug":"usb-over-network","status":"publish","type":"post","link":"https:\/\/www.voodoo.business\/blog\/2023\/10\/14\/usb-over-network\/","title":{"rendered":"USB over IP (network)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hyper-v does not provide USB passthrough, some people use USB redirection from remote desktop RDP&#8230; A similar technology might be USB over network, but this does not always work, as many USB devices have very little tolerance for lag ! and this will introduce some lag !<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">My objective is to connect a MINI-VCI connected on a raspberry PI to a computer running other software to analyze the data, whether this works or not is yet to be seen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There seems to be a few solutions online, some using generic hardware, and some using specialty hardware<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The most diverse of those solutions that can work on everything from a raspberry pi to a windows computer and android phone is (<a href=\"https:\/\/www.virtualhere.com\/\">https:\/\/www.virtualhere.com\/<\/a>), but I have not yet verified whether this software is USB\/IP compatible or not<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">USB\/IP has been built into the <strong>linux kernel<\/strong> for some time now, and a couple of solutions for both server and client are available on github, So here I will be investigating what I can do to bridge the Linux Raspberry PI to my windows PC,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">USBIP is a protocol where the server is the machine connected to the USB device via wire, and the client is the machine that needs to use the USB device but is not connected to it via USB.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In linux, usbipd is the name of the server, and usbip being the client, In debian, both server and client are included in the usbip package, hence, on the raspberry PI and on the Linux server, we need to run the command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt install usbip usbutils<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The modules of USB\/IP (usbip-core, usb-host, and vhci-hcd) are already included,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We will get to the Windows client after the Linux to Linux section<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The two options<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In the cases we are exploring here, the server is a Raspberry Pi (3), the client is a Windows machine, but there are a couple of things to try first, the Windows clients are KVM virtual machines, we will try<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1- The client is the Linux Host machine hosting the windows virtual machines, and the USB port is passed to the virtual machine<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">OR<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2- The Windows client has the USBIP driver directly connecting to the Raspberry PI server  <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Steps<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">On Raspberry PI<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Installing the USB\/IP server on the raspberry pi &#8220;apt-get install usbip&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt install usbip usbutils<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, let us assume i want to connect the following device to my debian machine so that i can leave it on a different desk<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">lsusb<br>Bus 001 Device 005: ID 10c4:ea60 Silicon Labs CP210x UART Bridge<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Let us start by loading the requiered kernel modules<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo modprobe usbip-core<br>sudo modprobe usbip-host<br>echo -e \"usbip-core\\nusbip-host\" | sudo tee -a \/etc\/modules<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we need to start the usbip deamon<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo usbipd -D<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we need to list the devices all over again ! but through usbip<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">usbip list -l<br>busid 1-1.5 (10c4:ea60)<br>Silicon Labs : CP210x UART Bridge (10c4:ea60)<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The above is the relevant one, I chose to delete the other 3 (They come with every pi)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Notice how we already have the data from the lsusb command `Bus 001 Device 005: ID 10c4:ea60 Silicon Labs CP210x UART Bridge`, but i have added this one too for completeness, and because the ids are easier to see<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Binding the Device: the device needs to be off limits to the pi itself, and proxiedthrough usbip, so we bind it with<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo usbip bind -b 1-1.5<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Notice how i copied the <code>1-1.5<\/code> from the usbip command<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We should also probably make it persistent by creating the file <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo nano \/lib\/systemd\/system\/usbipd.service<br>--------<br>[Unit]<br>Description=usbip host daemon<br>After=network.target<br><br>[Service]<br>Type=forking<br>ExecStart=\/usr\/sbin\/usbipd -D<br><br>[Install]<br>WantedBy=multi-user.target<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Start and enable !<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl daemon-reload<br>sudo systemctl enable usbipd.service<br>sudo systemctl start usbipd.service<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, you may be asking, how do we &#8220;Authenticate&#8221;, and the act of the matter is, we don&#8217;t, this is an <strong>unsecured<\/strong> thing, and if you want security, UFW is probably your friend<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">On my Debian machine !<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Let us connect this to my Debian machine<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, the same package has the tools for both the server (PI) and the client (My PC)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt install -y usbip<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we need tools to create virtual USB devices, fake device driver so to speak<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo modprobe vhci-hcd<br>echo \"vhci-hcd\" | sudo tee -a \/etc\/modules<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, list remote devices<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">usbip list -r 192.168.5.220<br> - 192.168.5.220<br>      1-1.5: Silicon Labs : CP210x UART Bridge (10c4:ea60)<br>           : \/sys\/devices\/platform\/soc\/3f980000.usb\/usb1\/1-1\/1-1.5<br>           : (Defined at Interface level) (00\/00\/00)<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, all you need to do is attach the device<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo usbip attach -r 192.168.5.220 -b 1-1.5<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, to verify the connection<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">usbip port<br>Imported USB devices<br>====================<br>Port 00: &lt;Port in Use&gt; at Full Speed(12Mbps)<br>       Silicon Labs : CP210x UART Bridge (10c4:ea60)<br>       3-1 -&gt; usbip:\/\/192.168.5.220:3240\/1-1.5<br>           -&gt; remote bus\/dev 001\/005<br><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we are done with debian, but the truth of the matter is, we probably need this more for virtual windows machines ! in my case, the printer and scanner are the 2 things i need on windows, because of linux drivers problems !<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, to disconnect the above<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo usbip detach -p 00<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Windows<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">So let us dive into windows<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Install usbip-win2 (Get it <a href=\"https:\/\/github.com\/vadimgrn\/usbip-win2\/releases\">here<\/a>)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now use the GUI, that is what it is for<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you insist on not doing that&#8230;.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><br>usbip.exe list -r 192.168.5.220<br>usbip.exe attach -r 192.168.7.220 -b 3-2<br># And to disconnect<br>usbip.exe detach -p 1<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hyper-v does not provide USB passthrough, some people use USB redirection from remote desktop RDP&#8230; A similar technology might be USB over network, but this does not always work, as many USB devices have very little tolerance for lag ! and this will introduce some lag ! My objective is to connect a MINI-VCI connected [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,9,217,195],"tags":[],"class_list":["post-2896","post","type-post","status-publish","format-standard","hentry","category-networking","category-pc-hardware","category-raspberry-pi","category-usbip"],"_links":{"self":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/2896","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/comments?post=2896"}],"version-history":[{"count":33,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/2896\/revisions"}],"predecessor-version":[{"id":6663,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/2896\/revisions\/6663"}],"wp:attachment":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/media?parent=2896"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/categories?post=2896"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/tags?post=2896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}