vpncloud/WINDOWS.md

2.0 KiB

VpnCloud for Windows

Toolchain

Setup toolchain: rustup target add x86_64-pc-windows-gnu rustup toolchain install stable-x86_64-pc-windows-gnu apt-get install mingw64

Cross-compile with: cargo build --target x86_64-pc-windows-gnu

Problems

Running VpnCloud

Problem:

  • Library "daemonize" does not compile
    • Windows uses "Services" instead of daemonized processes
  • Library "privdrop" does not compile
    • Is dropping privileges in Windows services even a thing?
  • Library "signal" does not compile
    • Windows services work differently, no Ctrl-C handling needed
  • Normal Windows programs can't stay active when the user logs out

Potential solution:

Polling solution

Problem:

  • Epoll is Linux only
  • RawFd is Unix only

Potential solution:

Use multi-threading to remove the need to wait on multiple events at the same time:

  • One thread waits on the device and sends to the socket
  • One thread waits on the socket and sends to the device and handles the control traffic

Problems to solve:

  • Synchronization is slow
    • Do not use locking in hot code, cache shared data locally and synchronize periodically
  • Find out if this is faster/slower than current solution

Tun/Tap devices

Problem:

Tun/Tap works completely different on Windows

  • Drivers need to be signed by Microsoft, complicated process

Potential solution:

Use existing Tun & Tap drivers:

Configuration

Problem:

  • Windows users are not used to write config files and execute commands
  • Windows setup is more complicated than in Linux (install Drivers, register Services, etc.)

Potential solution:

  • Create configuration UI