Skip to content

refactor: require usb_version with usb#383

Merged
kp2099 merged 1 commit intomainfrom
feat/add-usb-3.0-support
Oct 6, 2025
Merged

refactor: require usb_version with usb#383
kp2099 merged 1 commit intomainfrom
feat/add-usb-3.0-support

Conversation

@tenthirtyam
Copy link
Copy Markdown
Collaborator

@tenthirtyam tenthirtyam commented Sep 3, 2025

Description

Caution

This is a breaking change and will be shipped in v2.

Introduces support for configurable USB controller versions in virtual machine builds, with improved handling for Apple Silicon systems. The changes allow users to specify the USB version ("2.0" or "3.1") via a new usb_version option, and ensure automatic USB configuration for plugin compatibility on Apple Silicon. Extensive validation and tests have been added to ensure correct behavior across platforms.

USB Controller Configuration Enhancements:

  • Added a new usb_version option to allow selection between USB 2.0 and USB 3.1 controllers when USB is enabled, with validation for allowed values. [1] [2] [3] [4]
  • Improved handling for Apple Silicon (darwin/arm64): USB is automatically enabled and set to version 2.0 if not explicitly configured, ensuring plugin functionality. [1] [2]

VMX Template and Build Logic:

  • Updated the VMX template and build logic to conditionally include USB controller configuration based on usb and usb_version values, supporting both USB 2.0 and 3.1. [1] [2] [3]

Validation and Testing:

  • Added comprehensive unit tests to verify USB configuration, version selection, defaulting, and error handling for invalid settings. [1] [2]

Documentation Updates:

  • Updated documentation to reflect new USB configuration options and platform-specific behavior, including changes in .web-docs/components/builder/iso/README.md and docs-partials/builder/vmware/common/HWConfig-not-required.mdx. [1] [2]

Example and Cleanup:

  • Removed legacy manual USB configuration instructions from the example README, as USB controllers are now handled automatically and via the new options.

Resolved Issues

  • Adds USB 3.1 support to the plugin without the need to use vmx_data.
  • Automatically enables USB for VMware Fusion on Apple Silicon-based systems as it's required on arm64.

Rollback Plan

Revert commit.

Changes to Security Controls

None.

@tenthirtyam tenthirtyam added this to the v2.0.0 milestone Sep 3, 2025
@tenthirtyam tenthirtyam self-assigned this Sep 3, 2025
@tenthirtyam tenthirtyam added the enhancement Enhancement label Sep 3, 2025
@tenthirtyam tenthirtyam force-pushed the feat/add-usb-3.0-support branch 2 times, most recently from 6777bbc to 9590983 Compare September 3, 2025 23:28
@tenthirtyam tenthirtyam changed the title [wip] feat: add usb 3.0 support [wip] feat: add usb 3.1 support Sep 3, 2025
@tenthirtyam tenthirtyam force-pushed the feat/add-usb-3.0-support branch 2 times, most recently from cf0eb4e to 2e482b2 Compare September 3, 2025 23:45
@tenthirtyam tenthirtyam added the stage/needs-discussion Stage: Needs Discussion label Sep 4, 2025
@vmware vmware locked as spam and limited conversation to collaborators Sep 4, 2025
@tenthirtyam tenthirtyam modified the milestones: v2.0.0, v2.y.z Sep 10, 2025
@tenthirtyam tenthirtyam force-pushed the feat/add-usb-3.0-support branch from 2e482b2 to 394d756 Compare September 30, 2025 16:15
@tenthirtyam tenthirtyam changed the title [wip] feat: add usb 3.1 support [wip] refactor: require usb_version with usb Sep 30, 2025
@tenthirtyam tenthirtyam removed the request for review from JenGoldstrich September 30, 2025 16:18
@tenthirtyam tenthirtyam modified the milestones: v2.y.z, v2.0.0 Sep 30, 2025
@tenthirtyam tenthirtyam force-pushed the feat/add-usb-3.0-support branch 11 times, most recently from 7777b63 to 53a9931 Compare September 30, 2025 18:54
@tenthirtyam tenthirtyam changed the title [wip] refactor: require usb_version with usb refactor: require usb_version with usb Sep 30, 2025
@tenthirtyam tenthirtyam marked this pull request as ready for review September 30, 2025 18:58
@tenthirtyam tenthirtyam requested a review from a team as a code owner September 30, 2025 18:58
Copilot AI review requested due to automatic review settings September 30, 2025 18:58
@tenthirtyam tenthirtyam added breaking-change Breaking Change and removed stage/needs-discussion Stage: Needs Discussion labels Sep 30, 2025
@tenthirtyam tenthirtyam marked this pull request as draft October 1, 2025 02:18
BREAKING CHANGE:

`usb_version` field is required when `usb` is enabled"

- Adds `usb_version` string field with values "2.0" or "3.1"
- Requires explicit `usb_version `when `usb = true`
- Adds error handling for requiring both fields.
- Automatically enables USB and uses version 2.0 on Apple Silicon-based hypervisors.

Signed-off-by: Ryan Johnson <rya@tenthirtyam.org>
@tenthirtyam tenthirtyam force-pushed the feat/add-usb-3.0-support branch from 53a9931 to 3fa2e31 Compare October 1, 2025 02:35
@tenthirtyam tenthirtyam marked this pull request as ready for review October 1, 2025 02:38
@kp2099 kp2099 merged commit 2337e44 into main Oct 6, 2025
14 checks passed
@kp2099 kp2099 deleted the feat/add-usb-3.0-support branch October 6, 2025 11:31
@tenthirtyam tenthirtyam review requested due to automatic review settings March 23, 2026 20:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

breaking-change Breaking Change enhancement Enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants