Skip to content

usb: presets that match how the device is used - #77

Merged
dormancygrace merged 3 commits into
mainfrom
claude/usb-presets
Oct 11, 2026
Merged

dormancygrace merged 3 commits into
mainfrom
claude/usb-presets

Conversation

@dormancygrace

@dormancygrace dormancygrace commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

The USB presets predate audio, the serial console helper (#76) and RustDesk's USB needs, and none of them matched the compositions a device actually runs: a fresh install (three HID functions and the virtual disk without media, 4 IN / 4 OUT) showed "Custom composition" with the manual section open, and so did a device after RustDesk had added audio. The "Headless" preset had no keyboard and the USB network, and "HID compatibility (USB 1.1)" was a copy of "Keyboard and mouse only" with another USB profile.

The presets now

The budget is 6 IN / 7 OUT, so everything at once (HID + network + disk + serial = 8 IN) does not fit; every preset gives something up, and its description says what.

Preset Functions IN / OUT Gives up
KVM (first: what a fresh install runs) three HID, disk 4 / 4 no network adapter on the computer
KVM + USB network three HID, network, disk 6 / 5 the serial console
KVM + serial console three HID, serial, disk (with the helper disk) 6 / 5 the USB network
Headless server serial only 2 / 1 keyboard, mouse and storage: for a server whose serial login was set up before (with the console preset and its helper disk, or over the network), nothing but the console appears on it, so no USB storage in its boot order; RustDesk adds HID and audio back (5 / 5, fits)
Remote desktop three HID, disk, audio 4 / 5 what RustDesk enables; a second speaker on the computer
Keyboard and mouse only three HID 3 / 3 everything else
  • A fresh image (usb.dev, empty usb.disk0) matches KVM without any image change. usbPresets[0] is also the fallback when USB is switched back on with nothing remembered.
  • From KVM, EnsureRemoteAccessUSB (RustDesk) produces exactly Remote desktop.
  • Headless server is the serial console only, as decided: the server's login on it is set up before, with KVM + serial console (where the helper disk from usb: a console helper for headless Linux hosts (script, helper disk, console test) #76 appears) or over the network, and then the server sees no keyboard, mouse or storage from the NanoKVM. USB network, disk or audio can be added by hand.
  • The HID-only compatibility profile (USB 1.1) is now a switch in the manual section, not a preset: it is a property of a composition. Turning it on drops network, disk and audio (they do not exist in that profile); turning one of them on leaves the profile, as before. A composition with it on shows as custom with the manual section open.
  • Preset ids standard, console, control keep their meaning; headless changes composition; kvm and remote are new; compatibility is gone.
  • The mouse jiggler is shown only when a mouse function is enabled.
  • No server change: the presets live in the web UI. The server tests get the two new compositions in the budget table.

Docs

docs/usb-composition.md: the preset table with the trade-offs, the fresh-install and RustDesk notes, the compatibility switch, an audio row in the endpoint table, and the counts the code has (seven boolean fields, ten boot flags, 128 manual selections; it said six, eight and 64). README.md: the presets, and "NCM/RNDIS" becomes NCM (RNDIS was removed in beta-4).

Checked

  • web/tests/usb-composition.test.mjs: every preset fits and is matched; the fresh-install and the RustDesk compositions match kvm and remote; what each preset gives up (serial does not fit on standard, network not on console, headless has room for network and audio, audio fits on the full KVM presets); the compatibility switch drops network, disk and audio and is left again; the existing budget sweeps. tests/i18n-keys.test.mjs.
  • tsc --noEmit, eslint, prettier; go test for the endpoint budget with the new compositions.

Not covered

  • Not run on the stand: a UI-only change; the compositions themselves (serial + disk, HID + disk + audio) are ordinary ones the server already accepts.
  • The hardware reason for the compatibility profile is still undocumented beyond "USB 1.1 descriptors"; the switch's hint says what it is for in general terms.

🤖 Generated with Claude Code

dormancygrace and others added 3 commits October 11, 2026 17:32
The five presets dated from before audio, the serial console helper and
RustDesk's own USB needs, and none of them matched the two compositions
a device actually ends up in: a fresh install (three HID functions and
the virtual disk, 4 IN / 4 OUT) showed "custom", and so did a device
after RustDesk had added audio.

Six presets now, in the order shown: KVM (the fresh-install composition,
first, no network adapter on the computer), KVM + USB network, KVM +
serial console (with its helper disk), Headless server (serial console
and the helper disk only, as decided: no keyboard, no network), Remote
desktop (HID, disk and audio, what RustDesk enables), and Keyboard and
mouse only. Each description says what the preset gives up, since the
6 IN / 7 OUT budget cannot hold everything at once.

The HID-only compatibility profile (USB 1.1 descriptors) is no longer a
preset but a switch in the manual section: it is a property of a
composition. Turning it on drops network, disk and audio; turning one of
those on leaves it again. The mouse jiggler is shown only when a mouse
function is enabled. The docs get the preset table with the trade-offs,
the audio row in the endpoint table, and the field, flag and selection
counts the code has (seven, ten, 128); the README no longer mentions
RNDIS.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Serial and disk leave 3 IN / 5 OUT; the three HID functions and audio
that RustDesk enables fit on top (6 / 6). The description, the docs
table and a test say so, instead of "no remote desktop".

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A headless server's serial login is set up before, with the console
preset (where the helper disk appears) or over the network; afterwards
the server needs nothing else from the NanoKVM. Without the virtual disk
no USB storage shows up in its boot order. 2 IN / 1 OUT; RustDesk still
fits on top (5 / 5), and network, disk or audio can be added by hand.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@dormancygrace
dormancygrace merged commit fc87fbd into main Oct 11, 2026
13 checks passed
@dormancygrace
dormancygrace deleted the claude/usb-presets branch October 11, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant