Score:1

Strange behavior when typing sudo password

td flag

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

Organic Marble avatar
us flag
I don't understand. Are you pressing keys and nothing is happening in the password field?
Lenka avatar
td flag
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.
Score:1
vn flag

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.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.