How To Set Up A USB-Over-IP Server And Client With Debian Lenny
How To Set Up A USB-Over-IP Server And Client With Debian LennyVersion 1.0 This tutorial shows how to set up a USB-over-IP server with Debian Lenny as well as a USB-over-IP client (also running Debian Lenny). The USB/IP Project aims to develop a general USB device sharing system over IP network. To share USB devices between computers with their full functionality, USB/IP encapsulates "USB I/O messages" into TCP/IP payloads and transmits them between computers. USB-over-IP can be useful for virtual machines, for example, that don't have access to the host system's hardware - USB-over-IP allows virtual machines to use remote USB devices. I do not issue any guarantee that this will work for you!
1 Preliminary NoteThis tutorial is based on AliRezaTaleghani's tutorial How To Modify Your Gnu/Linux Box To Serve As A USB Over IP Server, but I've adjusted it for Debian Lenny (server and client). If you want to use a Windows client, please take a look at AliRezaTaleghani's tutorial - that part is still the same. In this tutorial I use the server server1.example.com with the IP address 192.168.0.100 and the client client1.example.com with the IP address 192.168.0.101, both running Debian Lenny. These settings might differ for you, so you have to replace them where appropriate.
2 Installing And Using USB/IP On The Serverserver1: There's a usbip package for Debian Squeeze (testing), but not for Lenny. To install the usbip package from Squeeze on Lenny, we modify the following three files (take a look at my tutorial A Short Introduction To Apt-Pinning to understand what I'm doing here): vi /etc/apt/sources.list Add the Debian Squeeze (testing) repositories at the end of the file:
vi /etc/apt/apt.conf Put the following line into this file:
vi /etc/apt/preferences Make the file look as follows:
Update the package database... aptitude update ... and install usbip as follows: aptitude install usbip usbip-source module-assistant We need to build the usbip kernel modules for our Debian Lenny kernel, that's why we must install the usbip-source and module-assistant packages as well. We can now build the kernel modules as follows: m-a prepare m-a update m-a a-i usbip-source Afterwards we load the usbip kernel modules: modprobe usbip To check if they really got loaded, run: lsmod | grep usbip The output should be similar to this one: server1:~# lsmod | grep usbip To make sure that both modules get loaded automatically whenever you boot the system, you can add them to /etc/modules: vi /etc/modules
Now we can start the usbip daemon: usbipd -D server1:~# usbipd -D Now attach a USB device that you want to export to the server - I'm using a SanDisk USB flash drive here. Execute the command lsusb to find the corresponding Vendor/Device ID which is in the form of: Bus XXX Device YYY: ID VendorID:DeviceID The output on my server is as follows: server1:~# lsusb The Vendor/Device ID of my SanDisk USB flash drive is 0781:5151. Now run usbip_bind_driver --list The output on my server is as follows: server1:~# usbip_bind_driver --list As you see, the Vendor/Device ID of my SanDisk USB flash drive (0781:5151) corresponds to the BUSID 4-5. We need this BUSID to attach the USB device to the server: usbip_bind_driver --usbip 4-5 server1:~# usbip_bind_driver --usbip 4-5 That's it, we can now use the SanDisk USB flash drive on a remote usbip client. BTW, if you run... netstat -tap ... you should see that the usbip daemon is listening on port 3240 so please make sure that this port isn't blocked by your firewall: server1:~# netstat -tap
|




Recent comments
20 hours 16 min ago
21 hours 25 min ago
23 hours 18 min ago
1 day 18 min ago
1 day 32 min ago
1 day 3 hours ago
1 day 5 hours ago
1 day 7 hours ago
1 day 21 hours ago
2 days 13 hours ago