Skip to content

Coder Connect cannot reach a Coder deployment behind a VPN #201

Closed

Description

@ethanndickson

Problem

If the logged in Coder deployment requires the use of a VPN to connect to (i.e. it is not accessible from the public web) Coder Connect times out when attempting to download the Coder Connect .dylib.

Here's an example with a Tailscale hostname:
Image

Even with the correct .dylib downloaded, subsequent requests to the Coder deployment, those necessary for Coder Connect to function, also fail.

Of note is that:

  • The Coder Desktop app is able to reach the Coder deployment. This explains why the sign in process succeeds.
  • The Coder Connect process (com.coder.Coder-Desktop.VPN, a network system extension) is unable to reach the Coder deployment.

Initial testing would indicate that network system extensions are unable to use network interfaces created by other network system extensions.
Packets written to a UDP socket bound to some other utun<X> interface do not appear in Wireshark. When that packet is written, there's also two OS logs from the kernel:

cfil_hash_entry_log:6088 <CFIL: Error: sosend_reinject() failed>: [30685 com.coder.Coder-Desktop.VPN] <UDP(17) out so b795d11aca7c26bf 57728068503033955 57728068503033955 age 0> lport 3001 fport 3001 laddr 100.108.7.40 faddr 100.112.177.88 hash 58B15863
cfil_service_inject_queue:4472 CFIL: sosend() failed 49

Apple dev forum post: https://developer.apple.com/forums/thread/793037

Solution

Whilst network extensions are subject to this limitation by the NECP (Network Extension Control Protocol), LaunchDaemons are not. Therefore, we'll run the networking component of Coder Connect in a LaunchDaemon.
LaunchDaemons are commonly referred to as:

  • Privileged Helpers
  • Background Items that affect all users (i.e. they run as root)
Image

This will require passing/duping the TUN file descriptor from the NE to the LaunchDaemon process over XPC, and having that process send it's routing configuration back to the NE.

This means we avoid:

  1. Manually altering the routing table
  2. Manually creating a utun/TUN file descriptor.

An initial prototype of this has proved successful.

To resolve:

Activity

  1. added 2 commits that reference this issue on Aug 6, 2025
    8c08563
    b74def3
  2. ethanndickson commented on Aug 6, 2025

    @ethanndickson
    MemberAuthor

    The fix for this is coming in the next Coder Desktop release (v0.8.0), but will also require an update of the Coder deployment, either to v2.24.3 (unreleased as of this message, coming this week) or v2.25.0 (released)

  3. ethanndickson commented on Aug 8, 2025

    @ethanndickson
    MemberAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions