VeilNet

Windows Problems

Fix problems particular to Windows hosts: elevation, the Wintun driver, endpoint protection, directory permissions, the observer, ephemeral runs and the service log.

Running Elevated

Every command that changes the machine must run in an elevated PowerShell. Otherwise, conflux exits with code 13 and prints the command to run again:

conflux: bringing up a network interface needs Administrator.
  open PowerShell with "Run as administrator", then:  conflux up

Open PowerShell with Run as administrator and run the line that conflux printed. Membership of the Administrators group is not enough, because the PowerShell session itself must be elevated.

The Wintun Driver

In TUN mode, conflux up gives the host a network interface. On Windows, this needs the Wintun driver, wintun.dll. conflux proxy needs no driver.

Conflux downloads the driver the first time it needs it, and again at any start that finds it missing, such as the first start after an upgrade. It refuses any download that does not match the pinned digest:

DriverValue
VersionWintun 0.14.1
Pinned SHA-256 digest07c256185d6ee3652e09fa55c0b673e2624b565e02c4b9091c79ca7d2f24ef51

Conflux stores the driver next to the anchor binaries, in a directory that only SYSTEM and Administrators may write. The supervisor downloads it before it starts the anchor, so a reboot after an upgrade needs no commands. If the download fails, the supervisor retries.

Offline installation

On a machine with no route to wintun.net, conflux prints the steps to take by hand:

conflux: a network interface on Windows needs wintun.dll, and it could not be fetched: …

  Download wintun-0.14.1.zip from https://www.wintun.net and put
  bin\amd64\wintun.dll at:
    C:\ProgramData\conflux\bin\998ece52739a7c74\wintun.dll

  Or run "conflux proxy PORT=BACKEND", which needs no interface at all
0 of 3 done
  1. On a machine that can reach wintun.net, download wintun-0.14.1.zip. Check its SHA-256 digest against the pinned digest above:

    > Get-FileHash wintun-0.14.1.zip -Algorithm SHA256

If you cannot install the driver at all, use conflux proxy instead. It is a fully supported way to use the overlay. See Choosing a Mode.

If the download does not match the pinned digest, conflux refuses it and prints both digests:

when the download is not the pinned archive
conflux: the downloaded archive is not the pinned one.
  expected sha256 07c256185d6ee3652e09fa55c0b673e2624b565e02c4b9091c79ca7d2f24ef51
  got      sha256 …

Defender and SmartScreen

Conflux writes a large executable to disk and runs it with elevated privileges. Endpoint protection may treat this as malware and quarantine the anchor binaries. When the binaries will not run, conflux names endpoint protection as the likely cause:

conflux: the anchor binaries were extracted to C:\ProgramData\conflux\bin\998ece52739a7c74 but will not run from there.
  an endpoint protection product may have quarantined them: a program that writes and then
  runs a 30 MB executable is a shape scanners are suspicious of.
  check the Defender protection history, and exclude that directory if this is expected.

To fix it:

  • Check the Defender protection history for the anchor binaries.
  • Run conflux version, which prints the SHA-256 digests of both anchor binaries. Check them against the release notes.
  • Exclude %ProgramData%\conflux\bin. Conflux always extracts the binaries to this fixed directory.

Directory Permissions

Conflux restricts %ProgramData%\conflux to SYSTEM and Administrators. It refuses to use the directory if another account created it first, because that account could have put files in it. The message names the owner:

conflux: C:\ProgramData\conflux belongs to DOMAIN\account (SID), which is not an administrator, so conflux did not create it and will not use what is in it.
  Remove it, then run this again as Administrator. If it is left over from conflux itself, running any conflux command as that account once repairs it

Remove the directory that the message names, and run the command again as Administrator. The same fix applies to the message … was made by another account before conflux secured …, which names a file or folder inside the directory.

The Observer

On Windows, the observer captures with an ETW session of Microsoft-Windows-NDIS-PacketCapture. Anchord runs as LOCAL SERVICE, as in proxy mode, and starts the trace session itself. No driver is needed.

To check the observer, run conflux status from an elevated PowerShell. The observer row shows how many flows it holds and how many packets it has taken. If it reads not observing, check whether a policy on the host narrows ETW's security descriptors. LOCAL SERVICE must be able to start the trace session.

When the service stops, the supervisor stops the observer over the socket first, so the trace session ends with it. See Observing Traffic.

Ephemeral Runs

On Windows, conflux up --ephemeral and conflux proxy --ephemeral need an elevated PowerShell in either mode. The run keeps its socket and binaries in %ProgramData%\conflux-ephemeral, which belongs to SYSTEM and Administrators.

Anchord runs as the Administrator who started the run, in conflux's job object, so it stops whenever conflux stops. See Ephemeral Runs.

The Service and Its Log

Conflux registers a Windows service with these settings:

SettingValue
Service nameconflux
Display nameVeilNet Conflux
Runs asLocalSystem, starting automatically at boot, with dependencies on Tcpip, Dnscache and NSI
RecoveryRestarts after 5, 10 and 30 seconds, the last repeating, after a crash or a stop with an error
Log%ProgramData%\conflux\logs\conflux.log

The service writes its output, and the anchor's, to the log file. Each line is stamped with the time in UTC. Past 10 MiB, the file moves aside to conflux.log.1. To read the end of the log, run:

> Get-Content -Tail 50 "C:\ProgramData\conflux\logs\conflux.log"

When the supervisor stops with exit code 1, it reports a service-specific error, and the recovery actions restart it. When it stops itself with exit code 70 or 78, Windows reports the service as stopped, not failed. The recovery actions therefore do not restart it into the same failure. The log records the reason.

  • Anchord runs in a job object that ends it when the supervisor's process ends, however that process ends.
  • conflux down, a restart and conflux uninstall return once the service's process has exited, so its files are closed when they return.
  • conflux down on a service that is already stopped succeeds.

To learn how the supervisor retries and when it gives up on every platform, see Service and Logs.