<3>WSL (9) ERROR: CreateProcessEntryCommon:574: execvpe /bin/bash failed 2
<3>WSL (9) ERROR: CreateProcessEntryCommon:583: Create process not expected to return
That's an indication that the Bash shell is no longer accessible. The WSL2 init process (among other things):
- Determines the default user id
- Looks up the user's shell in
/etc/passwd
(typically /bin/bash
)
- Attempts to start the shell
Not being able to find /bin/bash
is a pretty serious issue. From the comments (edited into the main question), we did determine that you can still launch /usr/bin/sh
, which means that at least that shell is available.
It's possible that you simply deleted the symlink from /bin/
to /usr/bin
, and we could easily recreate it if that were the case. But, it's also possible that you deleted more than that, and we just don't know at this point.
Given that you mentioned that there are no important files, the easiest recovery will be to simply "reset" Ubuntu back to the initial rootfs state. This is a destructive operation, so it's only recommended because you say there's nothing to recover:
From PowerShell:
# WARNING: Destructive operation
wsl --unregister Ubuntu
# Then re-install Ubuntu
ubuntu.exe
After a few seconds, it should ask for your username and password, just as it did when you initially installed.
Note for other reasons who may need to attempt recovery:
Before running the command above, back up the filesystem via PowerShell with:
wsl --export Ubuntu <path_to>/my_ubuntu_backup.tar
Examine the tarball to ensure that your files are included. Then after running the --unregister
above, you can restore any necessary files to your home directory from that tarball.