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

# VZFileHandleSerialPortAttachment

An attachment point that allows bidirectional communication using file handles.

```
class VZFileHandleSerialPortAttachment
```

## Overview

Use a [`VZFileHandleSerialPortAttachment`](/documentation/Virtualization/VZFileHandleSerialPortAttachment) object to configure a serial port using separate file handles for reading and writing data. In your virtual machine, use the file handles in this object in the following way:

- To send data to the guest operating system, write data to the file handle in the [`fileHandleForReading`](/documentation/Virtualization/VZFileHandleSerialPortAttachment/fileHandleForReading) property.
- To receive data from the guest operating system, read data from the file handle in the [`fileHandleForWriting`](/documentation/Virtualization/VZFileHandleSerialPortAttachment/fileHandleForWriting) property.

## Topics

### Creating the attachment point

[`init(fileHandleForReading:fileHandleForWriting:)`](/documentation/Virtualization/VZFileHandleSerialPortAttachment/init(fileHandleForReading:fileHandleForWriting:))

Creates a serial port attachment object from the specified file handles.

### Getting the file handles

[`fileHandleForReading`](/documentation/Virtualization/VZFileHandleSerialPortAttachment/fileHandleForReading)

The file handle that the guest operating system uses to read data.

[`fileHandleForWriting`](/documentation/Virtualization/VZFileHandleSerialPortAttachment/fileHandleForWriting)

The file handle that the guest operating system uses to write data.



---

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)