<!--
{
  "availability" : [
    "macOS: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Virtualization",
  "identifier" : "/documentation/Virtualization/VZVirtioConsoleDeviceDelegate/consoleDevice(_:didOpen:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Virtualization"
    ],
    "preciseIdentifier" : "c:objc(pl)VZVirtioConsoleDeviceDelegate(im)consoleDevice:didOpenPort:"
  },
  "title" : "consoleDevice(_:didOpen:)"
}
-->

# consoleDevice(_:didOpen:)

Tells the delegate that the framework opened a console port.

```
optional func consoleDevice(_ consoleDevice: VZVirtioConsoleDevice, didOpen consolePort: VZVirtioConsolePort)
```

## Parameters

`consoleDevice`

The console port’s console device.

`consolePort`

The [`VZVirtioConsolePort`](/documentation/Virtualization/VZVirtioConsolePort) port that the framework opened.

## Discussion

Be sure to process or flush any pending data from the [`VZVirtioConsolePort`](/documentation/Virtualization/VZVirtioConsolePort) attachment before communicating with a new virtual machine process, or additional data might remain on the serial port from the previous session.

---

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)