ubuntu-wsl2-systemd-script
ubuntu-wsl2-systemd-script copied to clipboard
Dealing with error: nsenter: failed to parse pid
Weirdest thing ever,
Sometimes, I get this error when trying to run WSL:
nsenter: failed to parse pid: '48
49'
It is defiantly something related to that package (systemd) since it never happened before I install it.
Now the way to solve it is to open PowerShell and run wsl --shutdown and then it loads OK.
The weird part is that I'm trying to run it from a bat script and shutdown the WSL every time I run the script using
powershell -Command "& {wsl --shutdown}"
timeout /t 5
or this:
:wsl_stop
for /F "tokens=3 delims=: " %%H in ('sc query "Lxssmanager" ^| findstr " STATE"') do (
if /I "%%H" NEQ "STOPPED" (
wsl --terminate %DISTRIBUTION%
timeout /t 1
sc stop "Lxssmanager"
goto wsl_stop
)
)
But the wsl still wont come up, only when I run then wsl --shutdown command manually on PowerShell.
Any thoughts or a way around it?