I'll explain the cause later, but I couldn't find a solution, so I gave up and tried to reinstall the distribution. I found it, so I'll record it.
Log in as root from Powershell with the following command, and change the login shell of the default user to/bin/bash.
wsl -u root
chsh -s <user_name>
You can now log in with bash.
In homebrew (linuxbrew), I used zsh as a login shell, but when I was playing with homebrew, zsh was uninstalled.
I searched a lot and found wsl sudo <command>
from Powershel, but I couldn't fix it by hitting it.
When I was looking at the Official Documentation (https://docs.microsoft.com/ja-jp/windows/wsl/wsl-config#unregister-and-reinstall-a-distribution) to reinstall, I'm glad there was a "Run as Specific User" section just below.
Recommended Posts