---
title: "init(network:)"
framework: virtualization
role: symbol
role_heading: Initializer
path: "virtualization/vzvmnetnetworkdeviceattachment/init(network:)"
---

# init(network:)

Creates the attachment and configures it with the specified data.

## Declaration

```swift
init(network: vmnet_network_ref)
```

## Parameters

- `network`: The logical network object

## Return Value

Return Value An initialized VZVmnetNetworkDeviceAttachment object, or nil if there was an error.

## Discussion

Discussion To ensure proper isolation between application processes, a virtual machine (VM) can only use the network that the same application process creates. If an application’s VM tries to use a network that another application’s VM creates, initialization fails. For more information on vmnet configuration requirements and restrictions, see vmnet The following example demonstrates how to create and initialize a custom network using VZVmnetNetworkDeviceAttachment.

## See Also

### Creating the vmnet network device attachment

- [network](virtualization/vzvmnetnetworkdeviceattachment/network.md)
