VirtualHere for Steam Link

VirtualHere for Steam Link

devilsclaw Apr 23, 2021 @ 7:38pm
VirtualHere is most likely just a copy of usbip
When I started having a bunch of problems with VirtualHere I searched for usb over ip and I found usbip and it works exactly the same as VirtualHere except with better control and recover ability.

usbip works on linux and windows and maybe macos, its not to hard to setup either and its free.

This on the client side the side you want to control with the usbip
#!/bin/bash usbip_attach() { sudo modprobe usbip_core sudo modprobe vhci-hcd #sudo usbip attach -r 192.168.1.254 -b 1-1.3 sudo usbip attach -r 192.168.1.254 -b 1-1.4.1.2 sudo usbip attach -r 192.168.1.254 -b 1-1.4.1.1 } usbip_detach() { #sudo usbip detach -p 2 sudo usbip detach -p 1 sudo usbip detach -p 0 sudo modprobe -r vhci-hcd sudo modprobe -r usbip_core } case $1 in attach) usbip_attach ;; detach) usbip_detach ;; start) ssh pi@192.168.1.254 "./usbip_setup.sh bind" usbip_attach ;; stop) usbip_detach ssh pi@192.168.1.254 "./usbip_setup.sh unbind" ;; shutdown) $0 stop ssh pi@192.168.1.254 "./usbip_setup.sh shutdown" ;; *) echo "usage: $0 attach/detach/start/stop" ;; esac

This is the host side which is what you use to control the client
#!/bin/bash usbip_bind() { sudo modprobe usbip_core sudo modprobe vhci-hcd sudo modprobe usbip_host sudo usbipd -D #sudo usbip bind -b 1-1.3 sudo usbip bind -b 1-1.4.1.1 sudo usbip bind -b 1-1.4.1.2 } usbip_unbind() { #sudo usbip unbind -b 1-1.3 sudo usbip unbind -b 1-1.4.1.1 sudo usbip unbind -b 1-1.4.1.2 sudo killall -9 -r usbipd sudo modprobe -r usbip_host sudo modprobe -r vhci-hcd sudo modprobe -r usbip_core } pid="" get_pid() { pid=$(ps -ef | grep "$1" | grep -v "grep" | awk '{printf "%s\n", $2}') } killp() { get_pid "$1" while [ "${pid}" != "" ] ; do kill -9 ${pid} get_pid "$1" done } shutdown_steamlink() { killp "steamlink.sh" killp "cec-client" killp "steamlink-cec" killp "screenblank" killp "streaming_client" } case $1 in bind) usbip_bind ;; unbind) usbip_unbind ;; start) usbip_bind ssh dc@192.168.1.2 "./usbip_setup.sh attach" ;; stop) ssh dc@192.168.1.2 "./usbip_setup.sh detach" usbip_unbind ;; shutdown) shutdown_steamlink ;; *) echo "usage: $0 bind/unbind/start/stop" ;; esac

the usb ids like 1-1.4.1.1 will be different for how ever your usb is connected

NOTE: This is a linux to linux setup with the controlling unit being my raspberry pi so I can steamlink with fully mouse control like 4th and 5th mouse button working and not accidental alt+tab making focus get lost.