guacamole-client icon indicating copy to clipboard operation
guacamole-client copied to clipboard

GUACAMOLE-522: USB Device Redirection.

Open aleitner opened this issue 4 months ago • 4 comments

This PR adds Web USB API integration to the Guacamole client, enabling users to redirect local USB devices from their browser to remote desktop sessions through the Guacamole protocol. This complements the server-side PR

Each USB device connection creates a ManagedUSB instance that manages the entire lifecycle of that specific device. This handles opening, claiming interfaces, polling endpoints for data, and disconnecting. These are registered with the ManagedClient.

Data Flow

  1. User connects a USB device via Web USB API
  2. ManagedUSB instance is created and added to ManagedClient.usbDevices
  3. Device interfaces are claimed and endpoint polling begins
  4. Incoming USB data is base64-encoded and sent via usbdata messages
  5. Server responses are decoded and written to appropriate USB endpoints
  6. Disconnection can be initiated from either client or server side

New proposed protocol messages

client → server

  • usbconnect: Sent when a USB device is connected, includes device ID, vendor/product IDs, device metadata, and flattened interface/endpoint descriptors
  • usbdata: Streams data from USB device endpoints to the server with endpoint number and transfer type
  • usbdisconnect: Notifies server when a USB device is disconnected locally

server → client

  • usbdata: Receives data from the server to write to specific USB device endpoints
  • usbdisconnect: Server-initiated disconnection requests for specific devices

aleitner avatar Aug 20 '25 19:08 aleitner

@aleitner : GUACAMOLE-2050 was closed as a duplicate of GUACAMOLE-522.

necouchman avatar Aug 20 '25 20:08 necouchman

anything blocking this PR from getting merged?

lokenorlinjohannessen avatar Nov 08 '25 21:11 lokenorlinjohannessen

anything blocking this PR from getting merged?

Just has not been reviewed, yet.

necouchman avatar Nov 09 '25 03:11 necouchman

anything blocking this PR from getting merged?

Just has not been reviewed, yet.

Great to hear, if you want a extra tester, i have some scenarios I can use to test on the PR :)

lokenorlinjohannessen avatar Nov 09 '25 09:11 lokenorlinjohannessen