1

I have installed Ubuntu 20.04 on Windows 10 WSL. I am trying to get Docker running. But when opening Ubuntu, I cannot log in, and a few of the letters of my password are typed. Where is the problem?

screenshot of issue

NotTheDr01ds
  • 17,888
Lenka
  • 11
  • I don't understand. Are you pressing keys and nothing is happening in the password field? – Organic Marble Nov 08 '22 at 12:51
  • I am pressing keys and I don't know exactly what is happening except that I see few casual letters appearing and login failed. I think it has something to do with wsl because this happens when I run "wsl --shutdown" and then start to run wsl again. – Lenka Nov 09 '22 at 16:22

1 Answers1

1

WSL normally will never ask for a password when starting up Ubuntu or any other distribution. From the looks of it, you may have a sudo <command> in one of your shell startup files. Perhaps you are trying to sudo service start docker or something similar?

Try going to PowerShell and running wsl ~ -e bash --noprofile --norc. This will start Ubuntu, run Bash as the shell, but tell it not to process the startup files.

I'm assuming that you'll be able to start without it asking for a password, but if not we'll keep troubleshooting that part.

If it does startup without a password, then examine your ~/.bashrc for a sudo command. Remove it if you find it. Other candidates includes ~/.bash_profile or ~/.profile, but the rc file is the likeliest candidate.

If you are trying to start Docker (since you mention it in the question), there are three better options:

  • Docker Desktop is pre-integrated with WSL and will likely alleviate most of your configuration pain. This is the preferred way to run Docker under WSL.

  • Under WSL, you can start services as root without requiring sudo by placing them in your /etc/wsl.conf as mentioned in my Super User answer on the topic.

  • You can now start services via Systemd if desired by using the latest WSL version as noted in this answer.

NotTheDr01ds
  • 17,888