Skip to content

Networking

Networking differs by backend:

BackendNetwork TypeGuest IPHost Access
Firecracker (Linux)TAP device172.16.0.2/30Direct via TAP
Firecracker (Lima)TAP in Lima VM172.16.0.2/30Via Lima NAT
Apple ContainervmnetDHCP-assignedVia vmnet bridge
microvm.nixTAP device172.16.0.2/30Direct via TAP
DockerDocker bridgeDocker-assignedVia Docker port mapping
Firecracker microVM (172.16.0.2/30, eth0)
| TAP interface (tap0)
Lima VM (172.16.0.1/30, tap0) -- iptables NAT -- internet
| Lima virtualization
Host (macOS / Linux)

The microVM has internet access via NAT through the Lima VM (or directly on native Linux). The TAP device connects the microVM to the host network namespace.

Forward guest ports to the host with -p:

Terminal window
mvmctl up --flake . -p 8080:8080
mvmctl up --flake . -p 3000:3000 -p 8080:8080 # multiple ports
# Or forward after boot
mvmctl forward my-vm -p 3000:3000

MicroVMs don’t use networking for host communication — they use vsock:

PortProtocolPurpose
52Length-prefixed JSONGuest agent (health checks, status, snapshot lifecycle)

The host connects by writing CONNECT 52\n to the vsock socket and reading OK 52\n. All requests are request/response pairs. vsock is supported on Firecracker, Apple Container, and microvm.nix backends. Docker uses a unix socket instead.

MicroVMs have no SSH access by design. Communication is exclusively via vsock. This eliminates:

  • SSH key management
  • SSH daemon attack surface
  • Network-based authentication bypasses

For debugging dev builds, use mvmctl logs <name> to view guest console output, or mvmctl logs <name> -f to follow in real time.

By default, microVMs have unrestricted internet access via NAT. Use --network-preset or --network-allow to restrict outbound traffic:

Terminal window
# Built-in presets
mvmctl up --flake . --network-preset dev # GitHub, npm, PyPI, crates.io, OpenAI, Anthropic
mvmctl up --flake . --network-preset registries # Package registries only
mvmctl up --flake . --network-preset none # No outbound (DNS only)
# Explicit allowlist
mvmctl up --flake . \
--network-allow github.com:443 \
--network-allow api.openai.com:443

Network policies are enforced via iptables FORWARD rules on the bridge interface inside the Lima VM. DNS (port 53) is always allowed so domain resolution works. Rules are automatically cleaned up when the VM stops.

Built-in presets:

PresetAllowed Domains
unrestrictedAll traffic (default)
devgithub.com, api.github.com, registry.npmjs.org, crates.io, static.crates.io, index.crates.io, pypi.org, files.pythonhosted.org, api.openai.com, api.anthropic.com
registriesregistry.npmjs.org, crates.io, static.crates.io, index.crates.io, pypi.org, files.pythonhosted.org
noneNo outbound traffic (DNS only)

Restrict the syscalls available inside the microVM with --seccomp:

Terminal window
mvmctl up --flake . --seccomp standard # File ops + process control (no sockets)
mvmctl up --flake . --seccomp network # Standard + socket syscalls
mvmctl up --flake . --seccomp minimal # Signals, pipes, timers only

The seccomp manifest is written to the config drive as seccomp.json for the guest init to apply via prctl(PR_SET_SECCOMP). Tiers are cumulative — each includes all syscalls from lower tiers.

TierSyscallsUse Case
essential~40Process bootstrap only (linker, glibc init)
minimal~110+ signals, pipes, timers, process control
standard~140+ file manipulation, fs operations
network~160+ sockets, connect, bind (for networked agents)
unrestrictedallNo restrictions (default)

The guest’s /etc/resolv.conf is configured at build time to use the host’s DNS resolver. Internet access works out of the box through the NAT chain (Firecracker), vmnet (Apple Container), or Docker bridge networking (Docker).