VPN manager for Qubes OS

This project was made using AI: Claude Opus 5.5

I’ve been working on qubes-vpn, a small tool for managing VPN qubes on Qubes OS.
If anyone has been thinking about making their own VPN client, this might be useful.

The code works, but consider it a prototype, not a finished product.

https://github.com/renehoj/qubes-vpn

What it does

Manages several VPN qubes at once. It supports both WireGuard and OpenVPN.

Gives you a tray icon and a GTK window in the style of qubes-firewall. The window shows a tree of each VPN qube and the qubes behind it, with connection state, the active profile, live up/down speeds, latency, handshake age, a six-minute traffic graph and the full route (disp1234 → sys-vpn-secure → sys-vpn → sys-firewall).

Lets you connect, disconnect, start and shut down VPN qubes, and move client qubes between net qubes. It warns you before you do something that would cut a qube off or take it out of the VPN.

Includes a headless CLI (qubes-vpn-cli) that gives the same overview as text.

How it’s built

Agent: runs inside each VPN qube and exposes a few qrexec services (vpn.Connect, vpn.Status, vpn.Stats, …). It also handles the kill switch (its own nftables table: downstream traffic can only leave through the tunnel, and IPv6 is dropped) and DNS, sending Qubes’ virtual DNS to the VPN’s servers so nothing leaks.

Manager: runs in a separate vpn-manager qube that has no network. It talks to the agents over qrexec and to qubesd through the Admin API.

dom0 only holds the qrexec policy, plus one optional small whitelisted service if you want to restrict which net qubes can be set.

Security

The manager treats everything a VPN qube sends back as untrusted. Output is size-limited, ASCII-only, and every key and value is checked against a schema. Bad values are dropped, not “cleaned”.

Keys and passwords never leave the VPN qube. The manager only knows profile names.

One known limitation: admin.vm.property.Set +netvm can’t be restricted by value. The optional dom0 service vpn.SetNetvm exists to close that gap.

4 Likes

Nice!

2 Likes