fixed message for vhci mode only linux. and changed readme

This commit is contained in:
2026-02-19 07:25:27 +01:00
parent 1c4ebddd05
commit 4d33063b82
7 changed files with 27 additions and 2 deletions
+11
View File
@@ -144,6 +144,17 @@ choco install make
**Option C: Ohne Make** - Go-Befehle direkt ausfuehren (siehe unten) **Option C: Ohne Make** - Go-Befehle direkt ausfuehren (siehe unten)
### Plattform-Unterstuetzung
| Funktion | Linux | Windows |
|----------|-------|---------|
| Share-Modus (USB-Geraete freigeben) | Ja | Nein (kein usbdevfs) |
| Use-Modus (USB-Geraete empfangen) | Ja | Nein (kein VHCI-Treiber) |
| Relay-Server | Ja | Ja |
| Web-UI / Config | Ja | Ja |
**Windows-Einschraenkung:** Der Windows-Client kann zur Zeit nur als Relay-Server, fuer die Web-UI und zur Konfiguration genutzt werden. Share- und Use-Modus erfordern Linux-spezifische Kernel-Schnittstellen (usbdevfs bzw. vhci-hcd).
### Voraussetzungen (Laufzeit) ### Voraussetzungen (Laufzeit)
**Linux (Share-Modus):** **Linux (Share-Modus):**
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+2 -2
View File
@@ -91,8 +91,8 @@ func (um *UseManager) GetAttachedDevices() []*AttachedDevice {
// AttachDevice requests and attaches a remote USB device // AttachDevice requests and attaches a remote USB device
func (um *UseManager) AttachDevice(clientID, busID string) error { func (um *UseManager) AttachDevice(clientID, busID string) error {
// Check if VHCI is available // Check if VHCI is available
if !usbip.IsVHCIAvailable() { if err := usbip.VHCIUnavailableError(); err != nil {
return fmt.Errorf("vhci-hcd kernel module not loaded (run: sudo modprobe vhci-hcd)") return err
} }
key := busID + "@" + clientID key := busID + "@" + clientID
+9
View File
@@ -166,3 +166,12 @@ func IsVHCIAvailable() bool {
_, err := os.Stat(vhciBasePath) _, err := os.Stat(vhciBasePath)
return err == nil return err == nil
} }
// VHCIUnavailableError returns an error describing why VHCI is not available,
// or nil if VHCI is ready to use.
func VHCIUnavailableError() error {
if IsVHCIAvailable() {
return nil
}
return fmt.Errorf("vhci-hcd Kernel-Modul nicht geladen (ausfuehren: sudo modprobe vhci-hcd)")
}
+5
View File
@@ -8,6 +8,11 @@ func IsVHCIAvailable() bool {
return false return false
} }
// VHCIUnavailableError returns an error describing why VHCI is not available.
func VHCIUnavailableError() error {
return fmt.Errorf("VHCI wird unter Windows nicht unterstuetzt. Der Use-Modus (USB-Geraete empfangen) ist nur unter Linux verfuegbar")
}
func FindFreePort(speed uint32) (int, error) { func FindFreePort(speed uint32) (int, error) {
return -1, fmt.Errorf("VHCI not supported on Windows") return -1, fmt.Errorf("VHCI not supported on Windows")
} }