"System has not been booted with systemd as init system (PID 1). Can't operate"
The reason for getting the above error is systemd is not running under WSL2.
Let's try to fix the error with Distroid open source tool.
- Go to WSL2 terminal and run the commands mentioned below to make the Ubuntu distro run with systemd
- Download latest installer script
curl -L -O "https://raw.githubusercontent.com/nullpo-head/wsl-distrod/main/install.sh"
- Run downloaded installer script
chmod +x install.sh sudo ./install.sh install
- Use the following command to enable distroid in the WSL2 distro
sudo /opt/distrod/bin/distrod enable
- Close WSL2 terminal, open a new Windows command prompt and run the following command to stop the Ubuntu distro
wsl --terminate <<your distro name >>
Now you would be able to open new WSL2 terminal and try out the Chef service start command successfully
No comments:
Post a Comment