Lesstep
GitHub Actions · Ubuntu 26.04 · Checked November 4, 2026

wg-quick "wg0.conf: Permission denied" on Ubuntu 26.04: the new AppArmor profile

ubuntu-latest is moving from Ubuntu 24.04 to 26.04 between October 19 and November 19, 2026 (what else changes). Ubuntu 26.04's apparmor package (5.0.0~beta1) adds profiles for /usr/bin/wg-quick and /usr/bin/wg; Ubuntu 24.04 has neither. Both profiles are in enforce mode and allow WireGuard configuration and key files only under /etc/wireguard/. Root does not get past AppArmor, so sudo does not help.

What it looks like

/usr/bin/wg-quick: line 40: /home/runner/work/<repository>/<repository>/wg0.conf: Permission denied
Error: Process completed with exit code 1.

This is the step that writes the configuration to the checkout directory and runs sudo wg-quick up ./wg0.conf. The same file in the same place works on 24.04.

Where the reports came from

Fix: write the configuration to /etc/wireguard

- name: Connect WireGuard
  env:
    WG_CONFIG: ${{ secrets.WG_CONFIG }}
  run: |
    sudo apt-get install --yes wireguard-tools
    sudo install -d -m 700 /etc/wireguard
    sudo install -m 600 /dev/null /etc/wireguard/wg0.conf
    printf '%s\n' "$WG_CONFIG" | sudo tee /etc/wireguard/wg0.conf > /dev/null
    sudo wg-quick up wg0

Give wg-quick the interface name, not a path, so it reads /etc/wireguard/wg0.conf. The file is created empty with mode 600 before the secret goes in, and tee writes it without printing it to the log. The same applies to wg setconf and to wg set ... private-key: keep the key files under /etc/wireguard/ too.

If you use a WireGuard action, check whether its current version already does this before you fork it.

Or pin the runner

runs-on: ubuntu-24.04 has no WireGuard profiles, so the old step works there, until GitHub retires that image.

Telling it apart

Other 26.04 failures

See failed jobs from IntelliJ IDEA

Pipeline Inbox for GitHub Actions Workflows, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, lists the runs of all your repositories in an IDE tool window, with their jobs and steps, and your current branch's runs are in the status bar. Reading is free; re-running failed jobs, cancelling, running workflows and reviewing deployments are Pro (US$1.50 a month, with a 30-day trial).

Get it on JetBrains Marketplace

GitHub and GitHub Actions are trademarks of GitHub, Inc.; Ubuntu is a trademark of Canonical Ltd.; WireGuard is a registered trademark of Jason A. Donenfeld; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with, sponsored or endorsed by GitHub, Inc., Canonical, the WireGuard project or JetBrains.

More: "The ubuntu-latest label will migrate to Ubuntu 26" · Postgres never starts in Docker on Ubuntu 26.04 · GitHub Actions plugins for IntelliJ IDEA compared · 日本語