Windows系统中WSL2 Ubuntu2204+Docker desktop 安装1panel报错解决方法

Windows系统中WSL2 Ubuntu2204+Docker desktop 安装1panel报错解决方法

The error messages "System has not been booted with systemd as init system (PID 1). Can’t operate." and "Failed to connect to bus: Host is down" in WSL2 when installing 1Panel indicate that systemd​ is not enabled within your WSL2 distribution, and consequently, services that rely on systemd cannot function.

To resolve this, systemd needs to be explicitly enabled in your WSL2 distribution:

  • Update WSL: Ensure your WSL installation is up-to-date. Open PowerShell as an administrator and run:

代码

    wsl --update

Then check your WSL version:

代码

    wsl --version

Ensure it is version 0.67.6 or higher, which is required for systemd support.

  • Enable systemd in wsl.conf: Open your WSL2 distribution and edit the wsl.conf file. If it doesn’t exist, create it.

代码

    sudo nano /etc/wsl.conf

Add the following lines to the file:

代码

    [boot]
    systemd=true

Save the file and exit the editor.

  • Shutdown WSL: Close all WSL terminals and then shut down the WSL environment from PowerShell to apply the changes:

代码

    wsl --shutdown
  • Restart WSL and Verify: Open a new WSL terminal. systemd should now be enabled. You can verify this by running:

代码

    systemctl status

This command should show the status of systemd and its running services.

After successfully enabling systemd, you can proceed with the 1Panel installation.

© 版权声明
THE END
喜欢就支持一下吧