Skip to content

feat(vpn): add Linux support for vpn-daemon and OS networking stack#22051

Merged
ibetitsmike merged 6 commits intomainfrom
mike/vpn-daemon-nqx3
Feb 12, 2026
Merged

feat(vpn): add Linux support for vpn-daemon and OS networking stack#22051
ibetitsmike merged 6 commits intomainfrom
mike/vpn-daemon-nqx3

Conversation

@ibetitsmike
Copy link
Collaborator

@ibetitsmike ibetitsmike commented Feb 11, 2026

Summary

Adds Linux support for the Desktop VPN daemon by sharing the Windows/Linux CLI implementation and wiring up a Linux networking stack, while removing unsupported-platform stubs. Also hardens the shared daemon tests so in-process runs do not double-close RPC pipe handles.

Changes

  • Shared Windows/Linux daemon implementation and tests in OS-agnostic files (cli/vpndaemon_windows_linux_shared*.go) with //go:build windows || linux.
  • Added Linux networking stack implementation in vpn/tun_linux.go (TUN + router + DNS configurator).
  • Removed unsupported-platform stubs (cli/vpndaemon_other.go, vpn/tun.go).
  • Adjusted shared daemon tests to duplicate RPC handles (Linux unix.Dup, Windows syscall.DuplicateHandle) before passing them to the in-process daemon to avoid FD/handle reuse issues.

Testing

  • go test -tags=testsmallbatch ./cli -run 'TestVPNDaemonRun|TestOpenApp' -count=1
  • go test -race -tags=testsmallbatch ./cli -run 'TestVPNDaemonRun|TestOpenApp' -count=1
  • go test -tags=testsmallbatch ./cli -count=1
  • go test -race -tags=testsmallbatch ./cli -count=1
  • make lint

@ibetitsmike ibetitsmike marked this pull request as ready for review February 11, 2026 18:22
@ibetitsmike
Copy link
Collaborator Author

@codex review

@ibetitsmike ibetitsmike requested review from deansheather and ethanndickson and removed request for deansheather February 11, 2026 18:22
@coder coder deleted a comment from chatgpt-codex-connector bot Feb 11, 2026
@coder coder deleted a comment from chatgpt-codex-connector bot Feb 11, 2026
@ibetitsmike
Copy link
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link

To use Codex here, create a Codex account and connect to github.

Copy link
Member

@ethanndickson ethanndickson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@ibetitsmike
Copy link
Collaborator Author

ibetitsmike commented Feb 12, 2026

Addressed Dean's review feedback in 79888291e:

  • Shared Windows/Linux daemon implementation in cli/vpndaemon_windows_linux.go with //go:build windows || linux.
  • Shared Windows/Linux tests in cli/vpndaemon_windows_linux_test.go.
  • Removed cli/vpndaemon_linux.go, cli/vpndaemon_linux_test.go, and unsupported-platform stubs (cli/vpndaemon_other.go, vpn/tun.go).
  • Kept stderr-based logging (no tunnel-pipe logging) and adjusted the handshake test path for race-safety.

Validation run locally:

  • go test ./cli -run TestVPNDaemonRun -count=1
  • go test -race ./cli -run TestVPNDaemonRun -count=1
  • go test ./vpn -count=1
  • go build ./cli/...
  • go build ./vpn/...
  • make lint/go

@ibetitsmike ibetitsmike merged commit adc7775 into main Feb 12, 2026
27 checks passed
@ibetitsmike ibetitsmike deleted the mike/vpn-daemon-nqx3 branch February 12, 2026 11:14
@github-actions github-actions bot locked and limited conversation to collaborators Feb 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants