<!--
{
  "availability" : [
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Virtualization",
  "identifier" : "/documentation/Virtualization/VZUSBController",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Virtualization"
    ],
    "preciseIdentifier" : "c:objc(cs)VZUSBController"
  },
  "title" : "VZUSBController"
}
-->

# VZUSBController

A class that represents a USB controller in a VM.

```
class VZUSBController
```

## Overview

Don’t create a `VZUSBController` directly. You need to first configure USB controllers on a [`VZVirtualMachineConfiguration`](/documentation/Virtualization/VZVirtualMachineConfiguration) through a subclass of [`VZUSBControllerConfiguration`](/documentation/Virtualization/VZUSBControllerConfiguration). When you create a [`VZVirtualMachine`](/documentation/Virtualization/VZVirtualMachine) from the configuration, the USB controllers are available through the [`usbControllers`](/documentation/Virtualization/VZVirtualMachine/usbControllers) property.

The concrete type of a `VZUSBController` corresponds to the type the configuration uses. For example, a [`VZXHCIControllerConfiguration`](/documentation/Virtualization/VZXHCIControllerConfiguration) leads to a device of type [`VZXHCIController`](/documentation/Virtualization/VZXHCIController).

## Topics

### Instance properties

[`usbDevices`](/documentation/Virtualization/VZUSBController/usbDevices)

The list of attached USB devices for the controller.

### Attaching and detaching devices

[`attach(device:completionHandler:)`](/documentation/Virtualization/VZUSBController/attach(device:completionHandler:))

Attaches a USB device to the controller.

[`detach(device:completionHandler:)`](/documentation/Virtualization/VZUSBController/detach(device:completionHandler:))

Detaches a USB device from the controller.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)