Closed AaronNGray closed 3 years ago
Reinstalled Ubuntu and its working now.
In PowerShell or CMD:
The following command starts WSL as root:
wsl --user root
After logging in to the system, execute the following script using the following
#!/bin/bash
self_dir=$(pwd)
echo "Uninstalling ubuntu-wsl2-systemd-script"
sudo rm -rf /usr/sbin/start-systemd-namespace
sudo rm -rf /usr/sbin/enter-systemd-namespace
sudo rm -rf /etc/sudoers.d/systemd-namespace
cd /var/tmp
if [ -f "/etc/bash.bashrc" ]; then
sudo grep -v "# Start or enter a PID namespace in WSL2
export USE_WSLG_SOCKET=false
export USE_WSLG_SOCKET=true
source /usr/sbin/start-systemd-namespace" /etc/bash.bashrc > tmpfile
sudo mv tmpfile /etc/bash.bashrc
fi
cd $self_dir
Once this is done, you can log in with your own user.
reference:https://blog.csdn.net/marin1993/article/details/127935273
Getting the following after installing :-