DamionGans / ubuntu-wsl2-systemd-script

[Does not work anymore!] Script to enable systemd support on current Ubuntu WSL2 images
1.56k stars 382 forks source link

Is there a way to undo this? #87

Open abalter opened 1 year ago

abalter commented 1 year ago

I don't need systemd to run anymore, and I'm occasionally running into problems at boot. How do I undo the changes this script makes?

apos commented 1 year ago

I updated wslg on latest (!!!) Windows 11 with the new systemd support (check first!):

In Powershell !

wsl --shutdown
wsl --update

# there should be a message, that an update occured, if not you are on the old version
# Check:
wsl --version
WSL-Version: 0.70.0.0
Kernelversion: 5.15.68.1
WSLg-Version: 1.0.45
MSRDC-Version: 1.2.3575
Direct3D-Version: 1.606.4
DXCore-Version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows Version: 10.0.22621.674

I used the uninstall script.

In Ubuntu ! See: https://github.com/DamionGans/ubuntu-wsl2-systemd-script/pull/43

Then in Powershell ! wsl --shutdown

After that I had to enable systemd in wsl.conf::

In Ubuntu !

sudo -e /etc/wsl.conf
[boot]
systemd=true

In Powershell ! wsl --shutdown Systemd than run for 100% CPU, which I could fix with systemd running with 100% and does not respond : https://github.com/microsoft/WSL/issues/8867

In Ubuntu !
sudo ln -s /dev/null /etc/systemd/system/acpid.service
sudo ln -s /dev/null /etc/systemd/system/acpid.path

In Powershell ! wsl --shutdown

totszwai commented 1 year ago

Run this script to uninstall

https://raw.githubusercontent.com/DamionGans/ubuntu-wsl2-systemd-script/dee9b7f604d7a4f4f0294a8dbb9b942fe0aedda9/uninst_00.sh