Add a network interface using the virtio-net device type via the --device flag.
Backend Types
type=unixgram: Uses a UNIX datagram socket backend (e.g., gvproxy or vmnet-helper).type=unixstream: Uses a UNIX stream socket backend (e.g., passt or socket_vmnet).
Arguments
mac: MAC address of the VM.path: Path to the UNIX socket (mutually exclusive with fd).fd: UNIX socket file descriptor (mutually exclusive with path).offloading: (Optional) Enable network offloading. Default is off.vfkitMagic: (Optional) Send the vfkit magic value after connection. Only supported with type=unixgram. Default is off.
Examples
Using vmnet-helper (basic):
--device virtio-net,type=unixgram,path=/Users/user/vm-network.sock,mac=ff:ff:ff:ff:ff:ff
Using gvproxy with offloading and vfkit magic:
--device virtio-net,type=unixgram,path=/Users/user/vm-network.sock,mac=ff:ff:ff:ff:ff:ff,offloading=on,vfkitMagic=on
Using passt (unixstream):
--device virtio-net,type=unixstream,fd=<passt_fd>,mac=ff:ff:ff:ff:ff:ff,offloading=true
--device virtio-net,type=unixgram,path=/Users/user/vm-network.sock,mac=ff:ff:ff:ff:ff:ff,offloading=on,vfkitMagic=on