Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to manage services?such as systemctl #18

Closed
dong-lufei opened this issue Nov 28, 2022 · 6 comments
Closed

How to manage services?such as systemctl #18

dong-lufei opened this issue Nov 28, 2022 · 6 comments

Comments

@dong-lufei
Copy link

Your CentOS9 does not seem to recognize systemctl and service

By the way, do you want something else like Ubuntu-WSL

@dong-lufei
Copy link
Author

How to enable or manage this version of process service?

I get an error as soon as I use the command

System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

@felixserna
Copy link

felixserna commented Jan 23, 2023

Create a file "/etc/wsl.conf" with content like this:

[boot]
systemd=true

And reboot wsl.

@FlowerBirds
Copy link

Create a file "/etc/wsl.conf" with content like this:

[boot] systemd=true

And reboot wsl.

It dost not work!

@FlowerBirds
Copy link

mv /usr/bin/systemctl /usr/bin/systemctl.old
curl https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl.py > /usr/bin/systemctl
chmod +x /usr/bin/systemctl

@FlowerBirds
Copy link

The problem is solved:

PS C:\Users\merit> wsl -l -v
  NAME                   STATE           VERSION
* alpine                 Stopped         2
  Rocky9                 Stopped         2
  docker-desktop-data    Stopped         2
  kali-linux             Stopped         2
  docker-desktop         Stopped         2
  ubuntu1804             Stopped         2
  CentOS7                Stopped         2
PS C:\Users\merit> wsl --version
WSL 版本: 1.1.3.0
内核版本: 5.15.90.1
WSLg 版本: 1.0.49
MSRDC 版本: 1.2.3770
Direct3D 版本: 1.608.2-61064218
DXCore 版本: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows版本: 10.0.22000.1574

update wsl2 ifself, then the file "/etc/wsl.conf" will take effect.

@mishamosher
Copy link
Owner

For an alternative under WSL1, please see #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants