Skip to content

Instantly share code, notes, and snippets.

@cbrunnkvist
Last active October 10, 2025 14:27
Show Gist options
  • Save cbrunnkvist/9fc8193b7b007336d68ff86fa7c2adba to your computer and use it in GitHub Desktop.
Save cbrunnkvist/9fc8193b7b007336d68ff86fa7c2adba to your computer and use it in GitHub Desktop.
WTF IS "Failed to connect to bus: No medium found"

Background

You are logged into a Linux console in some unique fashion, e.g. "The Proxmox web console of an LXC guest".

Problem

You want to start a service, as a REGULAR USER, using the forever 🤬 CURSED systemd in the correct fashion (i.e. "in the user's process namespace").

Since you're logged in with root on the Proxmox web console of the guest LXC and still setting things up, you su - $user in order to get a login shell session of the target user:

root@vinecraft:~# su - minecraft
minecraft@vinecraft:~$ systemctl status --user lodestone.service
Failed to connect to bus: No medium found

NO MEDIUM🪄🔮?!?! Thanks. Much help. Very full.

There is an issue at the dbus layer because ... this is not a "real" session beacuse the namespace was initialized for the root user and ... ONLY LENNART POETTERING KNOWS WHY. But it's a doocumented bug/shortcoming nevertheless. Did he fix it? NO, Lennart and the SystemD wizards in their neverending genius invented another sudo replacement in order to fix it!

Introducing: machinectl "-It's like systemctl but it ctl:s your machine instead of your system!"

So the solution to the problem looks like this:

minecraft@vinecraft:~$ exit
logout
root@vinecraft:~# machinectl shell minecraft@
Connected to the local host. Press ^] three times within 1s to exit session.
minecraft@vinecraft:~$ systemctl status --user lodestone.service
* lodestone.service - Lodestone CLI Minecraft management agent
     Loaded: loaded (/home/minecraft/.config/systemd/user/lodestone.service; enabled; preset: enab>

Yay. It works.

P.S. you are now bowing down to the feet of this nerd:

image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment