After staring minikube
my WSL2 system started to misbehave. When I try to run npm
command under WSL2, I get this message:
$ npm
WSL 1 is not supported. Please upgrade to WSL 2 or above.
System inspection:
$ which npm
/mnt/c/Program Files/nodejs/npm
$ cat /proc/version
Linux version 5.15.146.1-microsoft-standard-WSL2 (root@65c757a075e2) (gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.37) #1 SMP Thu Jan 11 04:09:03 UTC 2024
$ head -n 1 /etc/os-release
PRETTY_NAME="Kali GNU/Linux Rolling"
$ cat /proc/sys/fs/binfmt_misc/WSLInterop
cat: /proc/sys/fs/binfmt_misc/WSLInterop: No such file or directory
$ /mnt/c/Program Files/nodejs/node.exe
zsh: exec format error: /mnt/c/Program Files/nodejs/node.exe
WSL version:
PS > wsl -v
WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.3447
I’ve tried advice from https://github.com/kubernetes/minikube/issues/17700#issuecomment-1859073841
$ sudo systemctl start wsl-binfmt
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
$ ps -aux | head -2
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 2280 1528 hvc0 Sl+ 20:20 0:00 /init
Do I need to switch to systemd to fix the system?