---
title: vmnet
framework: vmnet
role: collection
role_heading: Framework
platforms: [Mac Catalyst 13.0+, macOS 10.10+]
path: vmnet
---

# vmnet

Connect with network interfaces to read and write packets on guest operating systems.

## Overview

Overview The vmnet framework is an API for virtual machines to read and write packets. The API allows a Guest OS interface to be in host mode or shared mode. Interfaces in host mode can communicate with the native host system and other interfaces running in host mode. In shared mode, the network interface can send and receive packets to the Internet, the native host, and other interfaces running in sharing mode. note: For more information about virtualization technologies, see the Hypervisor framework. Requirements The vmnet framework has the following requirements: Entitlements A sandboxed user space process must have the com.apple.vm.networking entitlement in order to use the vmnet API. Architecture

The VM Network API provides support for an interface in the guest operating system. The API provides the MAC address and MTU that you need to be configure on the guest OS interface. The interface receives a private IPv4 address via DHCP. IPv4 traffic originating from the guest operating system must use the private IPv4 address. The system drops packets sent from a different IPv4 address. You can create a maximum of 32 interfaces with a limit of 4 per guest operating system. Each read or write call allows up to 200 packets to be read or written for a maximum of 256KB. Each packet written needs to be a complete ethernet frame.

## Topics

### Essentials

- [com.apple.vm.networking](bundleresources/entitlements/com.apple.vm.networking.md)

### Creating a network configuration

- [vmnet_network_create(_:_:)](vmnet/vmnet_network_create(_:_:).md)
- [vmnet_network_configuration_create(_:_:)](vmnet/vmnet_network_configuration_create(_:_:).md)
- [vmnet_network_create_with_serialization(_:_:)](vmnet/vmnet_network_create_with_serialization(_:_:).md)
- [vmnet_network_copy_serialization(_:_:)](vmnet/vmnet_network_copy_serialization(_:_:).md)

### Starting and stopping interfaces

- [vmnet_start_interface(_:_:_:)](vmnet/vmnet_start_interface(_:_:_:).md)
- [vmnet_interface_start_with_network(_:_:_:_:)](vmnet/vmnet_interface_start_with_network(_:_:_:_:).md)
- [vmnet_interface_set_event_callback(_:_:_:_:)](vmnet/vmnet_interface_set_event_callback(_:_:_:_:).md)
- [vmnet_stop_interface(_:_:_:)](vmnet/vmnet_stop_interface(_:_:_:).md)

### Customizing a network configuration

- [vmnet_network_configuration_ref](vmnet/vmnet_network_configuration_ref.md)
- [vmnet_network_configuration_add_dhcp_reservation(_:_:_:)](vmnet/vmnet_network_configuration_add_dhcp_reservation(_:_:_:).md)
- [vmnet_network_configuration_add_port_forwarding_rule(_:_:_:_:_:_:)](vmnet/vmnet_network_configuration_add_port_forwarding_rule(_:_:_:_:_:_:).md)
- [vmnet_network_configuration_disable_router_advertisement(_:)](vmnet/vmnet_network_configuration_disable_router_advertisement(_:).md)
- [vmnet_network_configuration_disable_nat66(_:)](vmnet/vmnet_network_configuration_disable_nat66(_:).md)
- [vmnet_network_configuration_disable_nat44(_:)](vmnet/vmnet_network_configuration_disable_nat44(_:).md)
- [vmnet_network_configuration_disable_dns_proxy(_:)](vmnet/vmnet_network_configuration_disable_dns_proxy(_:).md)
- [vmnet_network_configuration_disable_dhcp(_:)](vmnet/vmnet_network_configuration_disable_dhcp(_:).md)
- [vmnet_nat66_prefix_length_key](vmnet/vmnet_nat66_prefix_length_key.md)
- [vmnet_nat66_prefix_key](vmnet/vmnet_nat66_prefix_key.md)
- [vmnet_port_forwarding_rule_get_details(_:_:_:_:_:)](vmnet/vmnet_port_forwarding_rule_get_details(_:_:_:_:_:).md)
- [vmnet_network_configuration_set_external_interface(_:_:)](vmnet/vmnet_network_configuration_set_external_interface(_:_:).md)
- [vmnet_network_configuration_set_ipv4_subnet(_:_:_:)](vmnet/vmnet_network_configuration_set_ipv4_subnet(_:_:_:).md)
- [vmnet_network_configuration_set_ipv6_prefix(_:_:_:)](vmnet/vmnet_network_configuration_set_ipv6_prefix(_:_:_:).md)
- [vmnet_network_configuration_set_mtu(_:_:)](vmnet/vmnet_network_configuration_set_mtu(_:_:).md)
- [vmnet_network_get_ipv6_prefix(_:_:_:)](vmnet/vmnet_network_get_ipv6_prefix(_:_:_:).md)
- [vmnet_network_get_ipv4_subnet(_:_:_:)](vmnet/vmnet_network_get_ipv4_subnet(_:_:_:).md)

### Reading and Writing Packets

- [vmnet_read(_:_:_:)](vmnet/vmnet_read(_:_:_:).md)
- [vmnet_write(_:_:_:)](vmnet/vmnet_write(_:_:_:).md)

### Data types

- [vmnet_return_t](vmnet/vmnet_return_t.md)
- [vmpktdesc](vmnet/vmpktdesc.md)
- [interface_ref](vmnet/interface_ref.md)
- [interface_event_t](vmnet/interface_event_t.md)
- [operating_modes_t](vmnet/operating_modes_t.md)
- [vmnet_mode_t](vmnet/vmnet_mode_t.md)
- [vmnet_network_ref](vmnet/vmnet_network_ref.md)

### Constants

- [interface_desc XPC Dictionary Keys](vmnet/interface_desc_xpc_dictionary_keys.md)
- [interface_param XPC Dictionary Keys](vmnet/interface_param_xpc_dictionary_keys.md)
- [event XPC Dictionary](vmnet/event_xpc_dictionary.md)

### Reference

- [vmnet Constants](vmnet/vmnet_constants.md)
- [vmnet Functions](vmnet/vmnet_functions.md)
- [vmnet Data Types](vmnet/vmnet_data_types.md)

### Variables

- [vmnet_enable_virtio_header_key](vmnet/vmnet_enable_virtio_header_key-swift.var.md)
