Skip to content

WSL2 CentOS 7 Failed to get D-Bus connection: Operation not permitted #13328

@gregbown

Description

@gregbown

systemd fails to start in CentOS 7 image after transferring image to new computer despite all the correct and identical configuration
[boot]
systemctl=true

The initial error was for this check

systemctl list-units --type service
Failed to get D-Bus connection: No such file or directory

Both original & new system are Windows 11Pro Version 24H2
Exact same distro image, however; the failing case has WSL version: 2.5.9.0 & the working/original one has WSL version: 2.2.4.0
Systemd still works perfectly with the same CentOS 7 image on the original computer
On the new system, I have a Rocky Linux 8 image with systemd working fine, but the imported CentOS 7 image, systemd does not work, neither does it work on a variety of CentOS images. . . see "Some additional testing" below

I configured my WSL2 for local debug output using below in my .wslconfig
[wsl2]
debugConsole=true
The logs showed the error

Failed to get D-Bus connection: Operation not permitted

Attached are logs collected using the recommended script
WslNetworkingLogs-2025-08-02_22-41-59.zip

This seems similar to a closed issue #13040

Some additional testing
I pulled/imported 2 other images from CentOS official docker, a CentOS 7.1, & CentOS 7,9, tried enabling systemd on them and got the exact same error after configuration

systemctl list-units --type service
Failed to get D-Bus connection: No such file or directory

I pulled/imported another Rocky Linux 8 from official Rocky docker, configured that for systemd and it worked perfectly
So something is weirdly broken ONLY for CentOS systemd, and ONLY on that computer OR the latest version of WSL ???

Verified this is ONLY an ISSUE in WSL 2.5.9.0 & 2.6.0, + maybe a few more versions back.
I installed the same Centos7.9 on my old system that is running WSL 2.2.4.0 and . . .
systemd worked immediately after updating /etc/wsl.conf

[boot]
systemctl=true

WSL version 2.6.0 does not fix this

wsl --update --pre-release

After updating to the pre-release version 2.6.0, the error is now:

Failed to start the systemd user session for 'root'. See journalctl for more details

Here are the logs for startup on WSL version 2.6.0

WslLogs-2025-08-04_08-29-59.zip

Note: In all of these cases I run the images directly in WSL2 using Windows console as root. I am not running anything in docker, etc.

WSL version on computer exhibiting the issue

WSL version: 2.5.9.0
Kernel version: 6.6.87.2-1
WSLg version: 1.0.66
MSRDC version: 1.2.6074
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26100.4652

WSL version on computer where CentOS7 image systemd works perfectly

WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.26100.4652

Backstory
I need to use CentOS7 because I need to maintain a legacy code base that cannot be installed on newer Linux distros.
I originally set up this CentOS 7 image in WSL2 on my personal Windows 11Pro workstation 13th Gen Intel i9-13950HX
I configured systemd as per all the current Windows documentation and it works perfectly
I was able to run services in the image connecting to all the API's through a VPN connection
Due to changes in my companies VPN, some of the services are no longer reachable outside my companies internal network
I exported the .tar file of my CentOS 7 Linux and loaded it onto my internal Windows 11Pro work computer 12th Gen Intel i7-12700K
Assuming I would have no issues since that computer already had a Rocky Linux 8 image with systemd working on it.
I imported the CentOS Linux .tar and everything seemed in tact until I went to check systemctl and found it had not started properly

Questions:

  1. Is it possible to roll back my version of WSL using method described here
  2. Is there a better way to roll back?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions