Created
January 29, 2021 04:28
-
-
Save lopugit/dcff73fe104e5897599972bfcfd8aedd to your computer and use it in GitHub Desktop.
run root command in wsl without starting user session, for recovering broke wsl init configs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you only need to remove the script, try from cmd wsl.exe -u root -e rm /etc/profile.d/00-wsl2.systemd.sh. | |
If you have bad startup config in /etc/wsl.conf, perhaps you can run wsl -u root -e mv /etc/wsl.conf /etc/wsl.conf.bak. | |
EDIT: you know what -u root does, don't you ;) As for -e, it means do not invoke the default login shell and run the rm or mv binaries directly. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment