How to install usbip?

I want to use usbip but have no idea how to install it(note: I am very new to nixos)

I tried to mix and match code from this thread and the nix os linux kernel wiki but without success.

failed code:

boot.kernelPatches = [ {
  name = "usbip";
  patch = "null";
  extraConfig = ''
    USB_ACM y
    USBIP_CORE y
    USBIP_VHCI_HCD y
    USBIP_VHCI_HC PORTS 8
    USBIP_VHCI_NR_HCS 1
    USBIP_DEBUG y
    USBIP_SERIAL y
  '';
  } ];

kernel version 6.1.31 and nix version 23.05

It’s included as a module by default.

$ zgrep USBIP /proc/config.gz  
CONFIG_USBIP_CORE=m
CONFIG_USBIP_VHCI_HCD=m
CONFIG_USBIP_VHCI_HC_PORTS=8
CONFIG_USBIP_VHCI_NR_HCS=1
CONFIG_USBIP_HOST=m
CONFIG_USBIP_VUDC=m
# CONFIG_USBIP_DEBUG is not set

You just need to load it:

$ sudo modprobe vhci-hcd
1 Like

I 've been tinkering with it and still don’t understand how i can get from loading the driver modules with modprobe to the working usbip command. could you please elaborate on how i would accomplish this.

The userspace usbip utility is available in linuxPackages.usbip. Add it to your environment.systemPackages or enter a shell with it available:

nix-shell -p linuxPackages.usbip
1 Like