USB redirection

Hi all,

I am going through the example code shared at

here client side code is for windows, but server side its there for LINUX, what I want is server side also should be for windows, any link is there so that i can just refer and learn

or if I can get some hint how to proceed would be very helpful, client side I am able to install virtual driver , but server side where actuall USB will be attached , I think server should be there so that communication can happen.

please provide some idea how to proceed, basically I need win to win .

thanks.

The docs are a bit confusing but it supports windows as either a client or a server.

but how to use it as server, if i go through the documentation its not clear, the command which is mentioned is for linux machine right, need some idea how to achieve this, actually i have remote application which uses TCP channel to communicate,where i just want to redirect USB from host machine to local machine. just to achieve that i am referring this but not able to get how to redirect actual host side attached USB to local machine where virtual driver will be installed

As I said, the readme is confusing. However in the Windows server section when you get to the last step:

  • Attach USB/IP device on Linux machine
  • # usbip attach -r <usbip server ip> -b 1-59

Just ignore that and follow the windows client install (ignoring the linux server install steps)./

so if i am not wrong, the above steps itself not required for windows as server

  • Run usbipd.exe
    • > usbipd.exe -d -4
    • TCP port 3240 should be allowed by firewall

above command will run the server, and at client side we need to attach to server ip

using

  • Attach a remote USB device
    • PS> usbip.exe attach -r <usbip server ip> -b 2-2

plz correct me if i am wrong

thanks

Hi all

when i run below command in server machine

usbipd.exe -d -4
usbipd: info: starting usbipd (usbip-win 0.3.5)
usbipd: debug: usbipd_sock.c:38:[build_sockfd] opening 0.0.0.0:3240
usbipd: info: listening on 0.0.0.0:3240

here port number is 3240 but what is 0.0.0.0?
is it ip of usbip server?

if so when i try to
run below command in client
usbip.exe attach -r 0.0.0.0 -b 3-2

its saying
usbip: error: failed to connect a remote host: 0.0.0.0

plz help , what I am doing wrong?

@Mark_Roddy @Tim_Roberts need your help

Hi mark

when i run below command in server machine

usbipd.exe -d -4
usbipd: info: starting usbipd (usbip-win 0.3.5)
usbipd: debug: usbipd_sock.c:38:[build_sockfd] opening 0.0.0.0:3240
usbipd: info: listening on 0.0.0.0:3240

here port number is 3240 but what is 0.0.0.0?
is it ip of usbip server?

if so when i try to
run below command in client
usbip.exe attach -r 0.0.0.0 -b 3-2

its saying
usbip: error: failed to connect a remote host: 0.0.0.0

plz help , what I am doing wrong?

Have you not done TCP/IP socket code? When a server binds to 0.0.0.0, that just means "we are listening on all the interfaces". You should be able to use any IP address that the server exposes. If you're on the same system, use 127.0.0.1. Otherwise, you'll need its IP address.

Hi tim,

i am using usbip-win code from the git path i shared above, i think they already have handled socket part and as per their doc we just need to call usbipd.exe -d -4

but after running this command the ip i got is 0.0.0.0 and same i am using at server side to attach

usbip.exe attach -r 0.0.0.0 -b busid

but the connection keeps failing

so what is the issue here, do i need to code my own tcp ip channel and that we can use for communication between usb ip server and client or this usbip-win code itself has some issue?