---
title: VZNetworkBlockDeviceStorageDeviceAttachment
framework: virtualization
role: symbol
role_heading: Class
path: virtualization/vznetworkblockdevicestoragedeviceattachment
---

# VZNetworkBlockDeviceStorageDeviceAttachment

A storage device attachment backed by a Network Block Device (NBD) client.

## Declaration

```swift
class VZNetworkBlockDeviceStorageDeviceAttachment
```

## Overview

Overview This storage device attachment provides a Network Block Device (NBD) client implementation. The NBD client connects to an NBD server referred to by an NBD Uniform Resource Indicator (URI), represented as an URL in this API. The NBD server runs outside of and isn’t controlled by the Virtualization framework. The NBD client forwards the guest’s I/O operations to the NBD server, which handles the I/O operations. The NBD client attempts to connect to the NBD server referred to by the URL used when you started the VM with start(). However, it’s important to note that a connection attempt isn’t made when the framework initializes the attachment object. Reconnection attempts take place throughout the life cycle of the VM when the NBD client encounters a recoverable error such as connection timeout and unexpected connection errors. The NBD client disconnects from the server when the VM shuts down. Using this attachment requires the app to have the com.apple.security.network.client entitlement because this attachment opens an outgoing network connection. To create a device that uses an NBD service, first initialize a VZNetworkBlockDeviceStorageDeviceAttachment with the URI of an NBD server, then use the attachment to configure a VZStorageDeviceConfiguration as shown in the example below (the attachment works with any subclass of VZStorageDeviceConfiguration, not just VZVirtioBlockDeviceConfiguration): For more information about Network Block Devices, see the Network Block Device Specification on GitHub. For more information about the NBD URL format, see the Network Block Device URL specification on GitHub.

## Topics

### Creating network block device attachments

- [init(url:)](virtualization/vznetworkblockdevicestoragedeviceattachment/init(url:)-6q4m7.md)
- [init(url:timeout:isForcedReadOnly:synchronizationMode:)](virtualization/vznetworkblockdevicestoragedeviceattachment/init(url:timeout:isforcedreadonly:synchronizationmode:).md)

### Validating a network block device’s URL

- [validate(_:)](virtualization/vznetworkblockdevicestoragedeviceattachment/validate(_:).md)

### Getting information about the attachment point

- [isForcedReadOnly](virtualization/vznetworkblockdevicestoragedeviceattachment/isforcedreadonly.md)
- [synchronizationMode](virtualization/vznetworkblockdevicestoragedeviceattachment/synchronizationmode.md)
- [timeout](virtualization/vznetworkblockdevicestoragedeviceattachment/timeout.md)
- [url](virtualization/vznetworkblockdevicestoragedeviceattachment/url.md)

### Observing changes to the network block device

- [delegate](virtualization/vznetworkblockdevicestoragedeviceattachment/delegate.md)
- [VZNetworkBlockDeviceStorageDeviceAttachmentDelegate](virtualization/vznetworkblockdevicestoragedeviceattachmentdelegate.md)

### Initializers

- [init(URL:)](virtualization/vznetworkblockdevicestoragedeviceattachment/init(url:)-9emt.md)
- [init(URL:timeout:forcedReadOnly:synchronizationMode:)](virtualization/vznetworkblockdevicestoragedeviceattachment/init(url:timeout:forcedreadonly:synchronizationmode:).md)

## Relationships

### Inherits From

- [VZStorageDeviceAttachment](virtualization/vzstoragedeviceattachment.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Attachment points

- [VZDiskBlockDeviceStorageDeviceAttachment](virtualization/vzdiskblockdevicestoragedeviceattachment.md)
- [VZDiskImageStorageDeviceAttachment](virtualization/vzdiskimagestoragedeviceattachment.md)
- [VZStorageDeviceAttachment](virtualization/vzstoragedeviceattachment.md)
