Contents

vmnet

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

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.

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

[Image]

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

Creating a network configuration

Starting and stopping interfaces

Customizing a network configuration

Reading and Writing Packets

Data types

Constants

Reference

Variables