SkillAgentSearch skills...

Desktop

Private Internet Access - Desktop VPN Client for Windows/macOS/Linux

Install / Use

/learn @pia-foss/Desktop
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Private Internet Access Desktop Client

This is the desktop client for the Private Internet Access VPN service. It consists of an unprivileged thin GUI client (the "client") and a privileged background service/daemon (the "daemon"). The daemon runs a single instance on the machine and is responsible for not only network configuration but also settings and account handling, talking to PIA servers as necessary. The client meanwhile runs in each active user's desktop and consists almost entirely of presentation logic. No matter how many users are active on a machine, they control the same single VPN instance and share a single PIA account.

The project uses Qt 6.2 for cross-platform development, both in the client and daemon. The client GUI is based on Qt Quick, which uses declarative markup language and JavaScript and offers hardware accelerated rendering when available. Qt and Qt Quick tend to be more memory and CPU efficient compared to web-based UI frameworks like Electron or NW.js.

Building and developing

The client is intended to be built on the target platform; Windows builds are built on Windows, macOS builds on macOS, and Linux builds on Debian.

The entire product is built using rake, using the supporting framework in the rake/ directory.

Dependencies such as OpenVPN and the Windows TAP driver are included as precompiled binaries under the deps directory in this project for convenience. To recompile any of these, please refer to their corresponding directories and/or repositories for build instructions.

Cloning the repository

Before cloning the Git repository, first make sure Git LFS is installed and initialized:

> git lfs version
git-lfs/2.3.4 (GitHub; windows amd64; go 1.8.3; git d2f6752f)

> git lfs install
Updated git hooks.
Git LFS initialized.

After this, cloning the repository normally should also fetch the precompiled binaries:

> git clone https://github.com/pia-foss/desktop.git
...
Filtering content: 100% (24/24), 17.13 MiB | 1.89 MiB/s, done.

Prerequisites

  • On Windows (x86_64, arm64):
    • Using git from git bash instead of powershell is recommended, due to some knows bugs in Windows built-in openssh service in regards to git-lfs.
    • Use chocolatey from an admin powershell session chocolatey.org/install running:
      • choco install ruby 7Zip git git-lfs
    • Qt 6.2.4
      • Follow this process if you want to be able to fully debug into Qt code and QML:
        • Download Qt from the official website: https://www.qt.io/download-open-source, scroll down and click "Download the Qt Online Installer"
        • The installer name should look like this "qt-unified-windows-x64-4.6.0-online.exe"
        • You will need to create an account and login
        • Select path C:\Qt and "Custom installation"
        • When selecting components check these boxes:
          • Qt / Qt 6.2.4 / MSVC2019 32-bit, MSVC2019 64-bit, Sources, Qt Debug Information Files
          • Qt / Developer and Designer Tools / Qt Creator, ...CDB Debugger support, Debugging Tools for Windows, CMake
        • (optional) If you have multiple installations of Qt, set user environment variable QTROOT to C:\Qt\6.2.4
      • Otherwise, use aqtinstall if you just need to build the client:
        • Run these commands in Powershell with admin priviledges
        • choco install python
        • Close Powershell and open a new Admin instance
        • pip install aqtinstall
        • mkdir C:\Qt-aqt
        • aqt install-qt -O "C:/Qt-aqt" windows desktop 6.2.4 win64_msvc2019_64
        • (optional for windows arm64)
          • aqt install-qt -O "C:/Qt-aqt" windows desktop 6.2.4 win64_msvc2019_arm64
        • (optional) If you have multiple installations of Qt
          • set user environment variable QTROOT to C:\Qt-aqt\6.2.4
    • Visual Studio 2022
      • Can install with choco with choco install visualstudio2022community
      • Once installed, open the Visual Studio Installer app.
      • Click on "More" -> "Import configuration"
      • Select the config file in scripts-internal/pia-default.vsconfig
      • It will install everything you should need, but you can add more components as needed.
      • The VS installer doesn't include the Console Debugger (CDB), which is needed to debug in Qt Creator. More info: Setting Up Debugger
  • On macOS:
    • Qt 6.2.4
      • PIA's universal build of Qt is recommended: desktop-dep-build releases
      • The universal Qt build can be used for universal or single-architecture PIA builds.
      • If you want Qt Creator, also install Qt from qt.io
    • Big Sur or newer is required to build
    • Up-to-date version of Xcode
    • Ruby, can be installed using Homebrew with brew install ruby
    • Install rake: sudo gem install rake
  • On Linux:
    • Supported distribution with clang 11 or newer
    • Supported architectures: x86_64, arm64
    • Qt 6.2.4 or later
    • Host build (Debian 11+ and derivatives):
      • sudo apt install build-essential rake clang mesa-common-dev libnl-3-dev libnl-route-3-dev libnl-genl-3-dev git git-lfs
    • Host build (Arch and derivatives):
      • sudo pacman -S base-devel git-lfs ruby-rake clang llvm libnl zip
    • Debian 11 docker image build (used to build published releases for maximum compatibility, and for cross builds)

Running and debugging

Each platform requires additional installation steps in order for the client to be usable (e.g. the Windows TAP adapter needs to be installed).
The easiest way to perform these steps is to build and run an installer, after which you can stop and run individual executables in a debugger instead.

To debug your own daemon, the installed daemon must first be stopped:

  • Windows: Run services.msc and stop the Private Internet Access Service. Set it to manual
  • macOS: Run sudo launchctl unload /Library/LaunchDaemons/com.privateinternetaccess.vpn.daemon.plist
  • Linux: Run sudo systemctl stop piavpn

The daemon must run as root. Consult your IDE/debugger documentation for how to safely run the debugger target as root.

Windows only:

  • If you have installed Qt using the official installer, add C:\Qt\6.2.4\msvc2019_64\bin to your user environment variable path.
    This is needed if you want to run pia-client.exe or pia-service.exe via command line.
  • To run the pia-daemon, execute .\pia-service.exe run in Powershell with admin privileges

To check PIA logs, go to your *installation_path*\data (The default path on Windows is C:\Program Files\Private Internet Access\data).
In order to enable all the logs, in PIA app Settings page go to Help and select Enable Debug Logging.

Quick start

  • To build the final installer for the host OS and architecture: rake installer
    • Produced in out/pia_debug_<arch>/installer
  • To build all artifacts for the host OS and architecture: rake all
    • Artifacts go to out/pia_debug_<arch>/artifacts
  • To build just the staged installation for development: rake
    • Staged installation is in out/pia_debug_<arch>/stage - run the client or daemon from here
  • To run tests: rake test
  • To build for release instead of debug, set VARIANT=release with any of the above

Updating the built dependencies

Linux: check that the symbolic links are correct using ls -lah -R deps/built/linux/.
If they are not, create them using ln -sf libfile linkname.

Build system

The following targets can be passed to rake. The default target is stage, which stages the built client, daemon, and dependencies for local testing (but does not build installers, tests, etc.)

| Target | Explanation | |--------|-------------| | (default) | Builds the client and daemon; stages executables with dependencies in out/pia_debug_x86_64/stage for local testing. | | test | Builds and runs unit tests; produces code coverage artifacts if possible on the current platform (requires clang 6+) | | installer | Builds the final installer artifact, including code signing if configured. | | export | Builds extra artifacts needed from CI but not part of any deployable artifact (currently translation exports) | | libs | Builds the dtop libraries and development artifact (see DTOP-LIBS.md) | | tools | Builds extra tools for development purposes that are not used as part of the build process or as part of any shipped artifact. | | artifacts | Builds all artifacts and copies to out/pia_debug_x86_64/artifacts (depends on most other targets, execpt test when coverage measurement isn't possible) | | all | All targets. |

Configurations

The build system has several properties that can be configured, either in the environment or by passing the appropriate variables to rake.

These are implemented in rake/build.rb. The output directory name includes the current brand, variant, and architecture.

| Variable | Values | Default | Explanation | |----------|--------|---------|-------------| | VARIANT | debug, release | debug | Create a debug build (unoptimized, some compression levels reduced for speed), or release build (optimized, maximum compression). | | ARCHITECTURE | x86_64, x86, arm64, arm64e, armhf, universal | Host architecture | Select an alternate architecture. Architecture support varies by p

Related Skills

View on GitHub
GitHub Stars320
CategoryDevelopment
Updated1d ago
Forks61

Languages

C++

Security Score

80/100

Audited on Apr 8, 2026

No findings