Skip to content

Add multi-NIC support: multiple network adapters per VM - #144

Open
groundwater wants to merge 3 commits into
mainfrom
feature/multi-nic-support
Open

Add multi-NIC support: multiple network adapters per VM#144
groundwater wants to merge 3 commits into
mainfrom
feature/multi-nic-support

Conversation

@groundwater

Copy link
Copy Markdown
Owner

Summary

  • Introduces NetworkInterfaceConfig data model pairing a label, NetworkConfig, and MAC address per NIC
  • VMStoredConfig gains a networkInterfaces array with automatic migration from legacy single networkConfig + macAddress
  • VMConfigurationBuilder loops over interfaces to create one VZVirtioNetworkDeviceConfiguration per NIC
  • VMController generates/regenerates MAC addresses per-interface in init, clone, and session creation
  • New NetworkInterfaceListView UI with reorder (up/down), add, remove, and sheet editor embedding NetworkSettingsView
  • CreateVMView and EditVMView wired to use the new multi-NIC UI
  • Port forwards enabled when any interface is NAT mode

Test plan

  • Open existing single-NIC VM — verify auto-migration to networkInterfaces[0]
  • Add second interface (bridged) — verify both appear in settings
  • Start VM — verify two NICs visible in guest (ifconfig)
  • Reorder interfaces — verify ordering persists and maps to en0/en1
  • Clone VM — verify fresh MACs on both interfaces
  • Port forwards still work when at least one NIC is NAT
  • Delete button visible in both light and dark mode

🤖 Generated with Claude Code

Bender and others added 3 commits February 28, 2026 22:47
Introduce NetworkInterfaceConfig to allow VMs to have multiple network
interfaces (e.g. NAT + bridged). Each interface has its own label, mode,
and MAC address. VMStoredConfig auto-migrates legacy single-NIC configs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Includes RouterConfig, CustomNetworkStore, and all associated UI views
(CustomNetworkListView, RouterDetailView, etc.) that are referenced by
NetworkSettingsView and SwiftUIDemoApp in DEBUG builds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement the packet processing backend for custom network mode,
replacing the NAT fallback with a full user-space network stack:
ARP responder, DHCP server, NAT engine, DNS forwarder, firewall
engine, and port forwarder. VMConfigurationBuilder now creates a
socketpair with VZFileHandleNetworkDeviceAttachment for custom NICs.
Remove all #if DEBUG gates around custom network UI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@groundwater
groundwater force-pushed the feature/multi-nic-support branch from f403ad8 to e1d8def Compare March 1, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant