A GlobalProtect VPN client built on OpenConnect with support for SSO authentication. It provides command-line tools and the GP Connect desktop application for macOS, Linux, FreeBSD, and OpenBSD.
A GlobalProtect VPN client built on OpenConnect. It provides command-line tools (`gpclient`) and the GP Connect desktop application for macOS, Linux, FreeBSD, and OpenBSD.
> **Disclaimer**: GP Connect is an independent third-party client for GlobalProtect VPN networks. It is not affiliated with or endorsed by Palo Alto Networks, Inc.
<p align="center">
<p align="center">
<picture>
<picture>
@@ -22,147 +24,89 @@ A GlobalProtect VPN client built on OpenConnect with support for SSO authenticat
- **Direct Gateway Connection** – Bypass portal selection when needed
- **Automated HIP Reports** – Built-in HIP report generation or custom scripts
- **Auto-Connect** – Automatically connect on system startup
- **Multi-Portal & Direct Gateway** – Manage multiple saved portals or connect directly to a gateway
- **System Tray Integration** –Convenient system tray icon (requires [gnome-shell-extension-appindicator](https://extensions.gnome.org/extension/615/appindicator-support/) on GNOME)
- **Desktop Integration** –Theme-aware system tray icon, auto-connect on launch, and reconnect on wake
## Usage
## Usage
### Command-Line Interface
### Command-Line Interface
The CLI is free and opensource. Use it to authenticate, connect to portals or gateways, and generate HIP reports from the terminal.
The open-source`gpclient` CLI handles authentication, connection lifecycle, and HIP generation:
#### Basic Commands
```bash
```bash
Usage: gpclient [OPTIONS] <COMMAND>
# Connect to a portal server
sudo gpclient connect <portal>
Commands:
# Connect using browser authentication (SSO / SAML)
connect Connect to a portal server
disconnect Disconnect from the server
launch-gui Launch the GUI
hip Generate HIP report
help Print this message or the help of the given subcommand(s)
Options:
--ignore-tls-errors Ignore the TLS errors
--lock-file <LOCK_FILE> Path to the gpclient PID lock file
--log-format <LOG_FORMAT> Log output format. JSON is intended for non-interactive consumers; interactive prompts remain text. [default: text][possible values: text, json]
-v, --verbose... Enable verbose output, -v for debug, -vv for trace
-q, --quiet... Decrease logging verbosity, -q for warnings, -qq for errors
-h, --help Print help(see more with '--help')
-V, --version Print version
```
> **Tip:** Use `gpclient help <command>` for detailed information on a specific command.
#### HIP reports
HIP is disabled in the CLI unless enabled explicitly. Use `--hip` to generate reports inside `gpclient`, including later reports requested by the gateway:
```bash
sudo gpclient connect <portal> --hip
```
Use `--hip=/absolute/path/to/script` for a custom executable. It runs as the `gpclient` process user unless `--hip-user` specifies another user. No installed HIP script is discovered automatically. `--hip-user` applies only to custom executables.
`gpclient hip` generates a report on demand for inspection; see `gpclient hip --help` for report inputs. The GUI's HIP tab supports generated reports, edited XML, and HIP Off on all desktop platforms. Linux, FreeBSD, and OpenBSD also support desktop-user scripts and explicitly approved root scripts.
#### External Browser Authentication
Use `gpclient` directly for browser-based authentication. It opens the browser as your normal desktop user while keeping VPN tunnel setup privileged:
```bash
sudo gpclient connect <portal> --browser
sudo gpclient connect <portal> --browser
# Connect directly to a gateway server
sudo gpclient connect <gateway> --as-gateway
# Connect with automatic HIP report generation
sudo gpclient connect <portal> --hip
# Headless / remote server authentication (prints auth URL to open in any browser)
sudo gpclient connect <portal> --browser manual
# Disconnect
sudo gpclient disconnect
```
```
For standalone CLI installations, use `--browser manual` (`--browser remote` before v3.0.6): open the printed URL and paste the resulting `globalprotectcallback:…` data into the terminal.
Run `gpclient --help` or `gpclient <command> --help` to view all available commands and options.
To reuse a saved portal cookie for later connections, add `--cookie-cache`:
Add `--gateway <gateway>` to select a particular gateway. Cookie caching is handled by `gpclient`. Its default cache file is `$HOME/.config/gpclient/cookie.json`, which normally belongs to root when running with `sudo`. To choose a predictable location, specify the path explicitly:
- Use `--browser` to automatically select an available browser
- Use `--browser <browser>` to specify a browser (e.g., `firefox`, `chrome`)
- Use `--browser manual` for standalone CLI installations or headless servers
### Graphical User Interface
### Graphical User Interface
GP Connect provides a desktop interface for managing VPN connections. On macOS, open GP Connect from Applications. On Linux, FreeBSD, and OpenBSD, launch it from your application menu or via the terminal:
- **macOS**: Open **GP Connect** from Applications.
- **Linux / BSD**: Launch GP Connect from your application menu or run:
```bash
```bash
gpclient launch-gui
gpclient launch-gui
```
```
> [!TIP]
> [!TIP]
> **On Linux, try Native Shell for lower memory usage.** Switch to it in **Settings → General → Interface**.
> **On Linux, try Native Shell for lower memory usage.** Switch between Native Shell and Tauri in **Settings → General → Interface**.
> [!Note]
>
> The GUI version is partially open source. The background service ([gpservice](./apps/gpservice/)) is open source, while the GUI wrapper is proprietary.
## Installation
## Installation
> [!Note]
>
> For older Linux distributions, use [v2.3.13](https://github.com/yuezk/GlobalProtect-openconnect/releases/tag/v2.3.13) instead of the latest release. It provides release assets for common distro families, including Debian/Ubuntu (`.deb`), Arch Linux / Manjaro (`.pkg.tar.zst`), RPM-based distros such as Fedora / RHEL / Rocky / AlmaLinux / CentOS (`.rpm`), and generic Linux tarballs (`.bin.tar.xz`).
### macOS
### macOS
GP Connect requires Apple silicon and macOS 13 or later. The macOS app includes both the desktop application and the free `gpclient` CLI. The CLI does not require a GUI license.
Requires Apple silicon and macOS 13+. Includes both GP Connect and the `gpclient` CLI.
#### Option 1: Install with Homebrew
#### Option 1: Homebrew (Recommended)
```bash
```bash
brew install --cask yuezk/gp-connect/gp-connect
brew install --cask yuezk/gp-connect/gp-connect
```
```
Open GP Connect from Applications, or connect from the terminal:
#### Option 2: DMG Installer
```bash
Download the `.dmg` from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page and drag GP Connect into Applications.
sudo gpclient connect <portal> --browser
```
#### Option 2: Install from DMG
Download the GP Connect `.dmg` from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page, open it, and drag GP Connect into Applications.
Packages are available on the [openSUSE Build Service](https://build.opensuse.org/package/show/home:yuezk/globalprotect-openconnect). Follow the [OBS instructions](https://software.opensuse.org/download.html?project=home%3Ayuezk&package=globalprotect-openconnect) for your distribution.
Packages are available on the [openSUSE Build Service](https://build.opensuse.org/package/show/home:yuezk/globalprotect-openconnect). Follow the [installation instructions](https://software.opensuse.org//download.html?project=home%3Ayuezk&package=globalprotect-openconnect) for your distribution.
### Other RPM-based Distributions
#### Install from RPM Package
Download the latest RPM package from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page:
```bash
sudo rpm -i globalprotect-openconnect-*.rpm
```
### Alpine Linux
### Alpine Linux
Download the latest `.apk` package from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page, then install:
Download the latest `.apk` package from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page:
The package uses Alpine's native musl build. Make sure the `community` repository is enabled so GUI dependencies such as `webkit2gtk-4.1`, `libsecret`, and `libayatana-appindicator` can be resolved. GUI-launched connections use polkit, and VPN tunnel creation requires `/dev/net/tun`.
*(Requires `community` repository enabled for WebKitGTK and AppIndicator dependencies).*
### FreeBSD
### FreeBSD
Download the latest FreeBSD package from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page, then install:
Download the latest FreeBSD package from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page:
NixOS does not run an imperative package-uninstall hook when a package is
removed from the system configuration. Remove an installed replacement VPN
script from the app settings before removing the package.
The `prebuilt` package and NixOS module use the published release pinned in `flake.nix`. Both `prebuilt` and `fromSource` run natively on the host with packaged dependencies and installer paths. The `fromSource` package builds the current flake checkout, including its Git submodules:
Local source builds require initialized Git submodules and a flake URL with `submodules=1`, as shown above. For a remote source flake, use a Git URL with submodules enabled, such as `git+https://github.com/yuezk/GlobalProtect-openconnect?submodules=1#fromSource`. The `prebuilt` package and NixOS module do not require Git submodules. Build output (`target`, `.build`, and `node_modules`) is excluded from the source input. Updating release asset hashes changes the prebuilt package, independently of source builds.
Source builds also support downloading either desktop interface on NixOS. The
downloader packages the verified Tauri or Native Shell archive with Nix, including
its runtime libraries. Each installed interface has a garbage-collection root
under `/var/lib/gpclient/nix-gui`, so its dependencies remain available after
system upgrades. No Rust compilation or NixOS rebuild is needed for GUI downloads.
Prebuilt packages gain this support when their release includes the updated
service; adding the flake installer alone does not change older service binaries.
### Official Docker Image
The [official Docker image](https://hub.docker.com/r/yuezk/globalprotect-openconnect) provides the CLI tools on Alpine Linux:
On a Linux host, add host networking if the VPN routes should affect the host network namespace:
```bash
docker run --rm -it --network host --cap-add=NET_ADMIN --device=/dev/net/tun \
yuezk/globalprotect-openconnect:<version> \
connect <portal> --browser manual
```
Without `--network host`, the VPN connection stays inside the container's network namespace. Docker Desktop on macOS and Windows does not make the host use the VPN through `--network host`; run `gpclient` on the host or use a container gateway setup for host traffic.
The image includes `gpclient` and `gpauth` only. It does not include embedded webview authentication, `gpgui-helper`, or `gpgui`.
### Other Distributions
### Other Distributions
#### Manual Installation
Download `globalprotect-openconnect_${version}_${arch}.bin.tar.xz` from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page:
1.**Install dependencies:**
```bash
- WebKitGTK 4.1 (for example, `libwebkit2gtk-4.1-0` on Debian/Ubuntu)
tar -xJf globalprotect-openconnect_*.bin.tar.xz
-`libsecret`
cd globalprotect-openconnect_*
-`libayatana-appindicator` or `libappindicator-gtk3`
sudo make install
- polkit (`pkexec`) for GUI-launched VPN connections
```
2.**Download and extract:**
Download `globalprotect-openconnect_${version}_${arch}.bin.tar.xz` from the [releases](https://github.com/yuezk/GlobalProtect-openconnect/releases) page:
```bash
tar -xJf globalprotect-openconnect_${version}_${arch}.bin.tar.xz
cd globalprotect-openconnect_${version}
```
3. **Install:**
```bash
sudo make install
```
## Building from Source
## Building from Source
The instructions below build the open-source components on Linux. For FreeBSD and OpenBSD, see [Building from Source on FreeBSD and OpenBSD](./docs/bsd-source-build.md).
### Prerequisites (Linux)
### Method 1: Using DevContainer
- [Rust](https://www.rust-lang.org/tools/install) 1.91 or later
- Libraries: `gmp`, `gnutls`, `nettle`, `libxml2`, `zlib`, `lz4`, `p11-kit`, `libsecret`, and `webkit2gtk-4.1` (or GTK 4 for Native Shell)
- Polkit (`pkexec`) for privileged tunnel setup
This project includes a DevContainer configuration for Linux development. The repository's `rust-toolchain.toml` selects the Rust toolchain; rustup may need to download it on the first build.
*(For FreeBSD and OpenBSD instructions, see [Building from Source on FreeBSD and OpenBSD](docs/bsd-source-build.md)).*
#### Prerequisites
### Build Steps
- [Docker](https://docs.docker.com/get-docker/)
- [Visual Studio Code](https://code.visualstudio.com/) (optional, for IDE support)
- [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) (if using VS Code)
The proprietary GP Connect desktop application is distributed separately. Use `INCLUDE_GUI=1` with `make build` to download its matching published Linux build for installation.
#### Alternative: Using VS Code
1. Open the project in VS Code
2. When prompted, click "Reopen in Container" (or run **Dev Containers: Reopen in Container**)
3. Once the container is ready, open a terminal and run:
```bash
make build
```
### Method 2: Local Development Build
#### Prerequisites
- [Rust 1.91 or later](https://www.rust-lang.org/tools/install)
- `BUILD_GUI_HELPER=0` – Skip building and installing the GUI helper
- `INCLUDE_GUI=1` – Download and install the matching desktop application bundle.
- `BUILD_WEBVIEW_AUTH=0` – Build `gpauth` without embedded browser authentication; use an external browser or manual authentication
- `BUILD_WEBVIEW_AUTH=0` – Build `gpauth` without embedded browser authentication (uses external browser or manual mode).
- `INCLUDE_GUI=1` – Download the matching published Linux desktop application for installation
- `BUILD_GUI_HELPER=0` – Skip building the helper UI.
- `OFFLINE=1` – Build in offline mode using vendored dependencies
## Frequently Asked Questions
## Troubleshooting
When reporting a problem, follow the [diagnostics collection instructions](docs/diagnostics.md). A standalone script is available for versions without the diagnostics command; you do not need to upgrade first.
- **Headless / Remote Login**: When running without a desktop display or over SSH, use `--browser manual`. Open the printed URL in any browser and paste the callback URL back into the terminal.
- **Diagnostics**: If you encounter issues, run `gpclient diagnostics` or follow the [diagnostics guide](docs/diagnostics.md) when opening an issue.
### Q: How do I resolve the "Secure Storage not ready" error?
Unlock your desktop keyring and ensure the application can access it. On Linux and BSD, check that a keyring service such as GNOME Keyring is installed and running in your desktop session. On macOS, check Keychain access.
Linux and BSD can use file storage when secure storage is unavailable during initial setup. An existing configuration that uses the keyring still needs access to that keyring.
See related issues: [#321](https://github.com/yuezk/GlobalProtect-openconnect/issues/321), [#316](https://github.com/yuezk/GlobalProtect-openconnect/issues/316)
### Q: How do I fix the "cannot open display" error when using CLI?
Run the client from a terminal in your normal desktop session and use an external browser:
```bash
sudo gpclient connect <portal> --browser
```
See related issue: [#316](https://github.com/yuezk/GlobalProtect-openconnect/issues/316)
On a headless server, use `--browser manual` and complete authentication from another machine.
## NetworkManager Integration
## NetworkManager Integration
@@ -564,14 +268,10 @@ On a headless server, use `--browser manual` and complete authentication from an
## Licensing
## Licensing
### Trial and Pricing
- **CLI (`gpclient`)**: Free and open source (GPL-3.0).
- **GUI (GP Connect)**: Commercial desktop application with a free trial.
The **CLI version** is completely free and open source.
### Open Source Components
The **GUI version** is a paid application with a **7-day trial**. Start the trial in the app by verifying your email address with a one-time code. Installing the app alone does not start the trial.
### Open Source Licenses
This project consists of multiple components, each with its own license:
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.