I'm currently facing an issue while trying to use systemctl --user within an LXC. Whenever I run any systemctl --user command, I receive the following error message:
Code:
(error from Debian 12) Failed to connect to bus: No medium found
(error from Fedora 41) Failed to connect to user scope bus via local transport: No medium found
It used to work until I rebooted my PVE. I'm not sure what additional information might be helpful for troubleshooting this problem, so I would appreciate any guidance on what details to provide.
Here are some details:
LXC OS: Debian 12 and Fedora 41
PVE version: 8.4.1
Any help or suggestions would be greatly appreciated. Thank you!
Do you mean "What is the output of last reboot -F -n 3?" or "Is kernel versions before and after reboot matches the output of last reboot -F -n 3?"
Here is the output of last reboot -F -n 3:
Code:
root@pve:~# last reboot -F -n 3
reboot system boot 6.8.12-9-pve Fri Apr 18 21:09:35 2025 still running
reboot system boot 6.5.13-1-pve Fri Apr 18 19:19:29 2025 - Fri Apr 18 21:09:17 2025 (01:49)
reboot system boot 6.5.13-1-pve Thu Apr 17 19:26:38 2025 - Fri Apr 18 19:19:09 2025 (23:52)
wtmp begins Wed Aug 16 23:24:57 2023
I rebooted system at Fri Apr 18 19:19:09 2025 and found systemctl --user failed. Then I upgraded packages and kernel and rebooted at Fri Apr 18 21:09:17 2025, but still failed. I think I made an upgrade between Thu Apr 17 19:26:38 2025 and Fri Apr 18 19:19:09 2025, but I'm not certain about the time.
Thanks for your help and let me know if you need more details!
I rebooted system at Fri Apr 18 19:19:09 2025 and found systemctl --user failed.
Hm, I wonder why it worked before. Have you used it as the container's root user or as a separate user with that command? For the former it shouldn't work as the root user doesn't have its own user service manager.
What is the output of echo $DBUS_SESSION_BUS_ADDRESS and echo $XDG_RUNTIME_DIR for that user? If those are directories, what are their permissions and do you have read/write access?
What is the output of echo $DBUS_SESSION_BUS_ADDRESS and echo $XDG_RUNTIME_DIR for that user? If those are directories, what are their permissions and do you have read/write access?
Neither of these exists.
I searched again and consulted AI. It seems that directly login from the LXC from PVE web console is not considered as a "login". I tried using SSH instead, and everything worked just fine. (Still dont have $DBUS_SESSION_BUS_ADDRESS but have $XDG_RUNTIME_DIR now. After setting $XDG_RUNTIME_DIR to /run/user/$(id -u), the web console started working properly as well.)
I searched again and consulted AI. It seems that directly login from the LXC from PVE web console is not considered as a "login". I tried using SSH instead, and everything worked just fine. (Still dont have $DBUS_SESSION_BUS_ADDRESS but have $XDG_RUNTIME_DIR now. After setting $XDG_RUNTIME_DIR to /run/user/$(id -u), the web console started working properly as well.)
Thank you very much for your help!
Just loged-in for upvoting this answer as AI didn't know how to solve
If the target user isn't actively logged into a graphical or SSH session, their /run/user/UID/ directory and D-Bus processes won't start. You can allow their user session to start at boot and stay alive without an active login.