Lesstep
GitHub Actions · Ubuntu 24.04 and 26.04 · Checked November 22, 2026

systemctl --user on GitHub Actions runners: "Failed to connect to user scope bus via local transport: Operation not permitted"

On GitHub-hosted Ubuntu runners, /etc/environment contains XDG_RUNTIME_DIR=/run/user/1001, the runtime directory of the runner user. A session of any other user inherits it, so systemctl --user looks for the bus in a directory that user cannot open and stops with:

Failed to connect to user scope bus via local transport: Operation not permitted
(consider using --machine=<user>@.host --user to connect to bus of other user)

This is actions/runner-images #14649. It is open, with no fix released as of November 22, 2026.

Which images

The issue lists Ubuntu 24.04, Ubuntu 24.04 Arm64, Ubuntu 26.04 and Ubuntu 26.04 Arm64, and says the line is present on both. It became visible on 26.04 only because of the newer systemd: the report says systemctl --user still connects with systemd 255 (24.04) and fails with systemd 259 (26.04), which uses XDG_RUNTIME_DIR. A job that worked on ubuntu-24.04 can therefore fail on ubuntu-latest once the label points to 26.04 (what else changes).

When a job fails in a step you did not touch: Pipeline Inbox for GitHub Actions Workflows, a plugin for JetBrains IDEs, sends a notification when a run of yours or of your current branch fails, with a link to the failed job's log.

Why

The issue's analysis: XDG_RUNTIME_DIR is a per-user, per-session variable that pam_systemd sets at login. sshd applies /etc/environment on top of the PAM environment, so the correct value for the other user is overwritten with /run/user/1001, which is drwx------ runner runner. DBUS_SESSION_BUS_ADDRESS is not in that file, so it keeps the right value (the report shows unix:path=/run/user/2000/bus), and the two variables disagree.

A maintainer reproduced it on both images and wrote that linger is enabled, so pam_systemd already sets the correct per-session value and the static line overrides it. The same comment says the image build does not write the line: the scripts in images/ubuntu only set XDG_CONFIG_HOME, and it appears to be added later by the runner provisioning step at deploy time, outside the image build. A search of images/ in the runner-images repository finds no XDG_RUNTIME_DIR, which fits that. A commenter suggests removing the line from /etc/environment and setting it where the runner service starts; that change is not in your hands on a hosted runner.

Reproduce it

The repro from the issue creates a user, logs in over ssh and runs systemctl --user:

jobs:
  repro:
    runs-on: ubuntu-26.04
    steps:
      - run: grep XDG_RUNTIME_DIR /etc/environment

      - name: a session of another user gets the wrong XDG_RUNTIME_DIR
        run: |
          sudo useradd -u2000 -m -d/home/other -s/bin/bash other
          sudo mkdir -p -m 0700 /home/other/.ssh
          ssh-keygen -t ecdsa -N "" -f "$HOME/.ssh/other.key"
          sudo cp "$HOME/.ssh/other.key.pub" /home/other/.ssh/authorized_keys
          sudo chown -R other:other /home/other
          ssh -t -t -o StrictHostKeyChecking=no -i "$HOME/.ssh/other.key" other@localhost -- \
            'id -u; echo "XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR"; ls -ld /run/user/1001; systemctl --user show --property Version'

Fix: give that user's command its own directory

The expected value, per the issue, is /run/user/$(id -u) for the user whose session it is. Set it in the command that runs as that user. Over ssh, the single quotes make $(id -u) run on the far side, as the other user:

ssh -i "$HOME/.ssh/other.key" other@localhost -- \
  'XDG_RUNTIME_DIR=/run/user/$(id -u) systemctl --user show --property Version'

With sudo -u or su, name the user's uid in the same way:

sudo -u USER env XDG_RUNTIME_DIR=/run/user/$(id -u USER) systemctl --user show --property Version

If the command does not need the user bus and only trips over the inherited value, remove the variable for that command:

sudo -u USER env -u XDG_RUNTIME_DIR COMMAND

Inside a login shell that already runs as the other user, unset XDG_RUNTIME_DIR does the same. The user's runtime directory must exist for the first form to work: it is created when that user logs in, and loginctl enable-linger USER keeps a user manager running after logouts (loginctl, pam_systemd). The issue does not name linger as a fix.

See failed jobs from IntelliJ IDEA

Pipeline Inbox for GitHub Actions Workflows, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, is free for reading: run history across your repositories, jobs, steps and job logs in the IDE, and a notification when a run of yours or of your current branch fails, with a link to the failed job's log. Re-running failed jobs (or all, with debug logging), cancelling runs, running workflows with inputs and approving deployments are Pro (US$1.50 a month, with a 30-day trial).

Install it free from JetBrains Marketplace (reading your runs needs no license)

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

More: "The ubuntu-latest label will migrate to Ubuntu 26" · sudo -E on Ubuntu 26.04 · Failed to enable snapd service · detected dubious ownership · Postgres in Docker on Ubuntu 26.04 · bubblewrap on Ubuntu 26.04 · 日本語