mintty / wsltty

Mintty as a terminal for Bash on Ubuntu on Windows / WSL
Other
3.12k stars 104 forks source link

WSL session starts as root #270

Closed tnguyen14 closed 3 years ago

tnguyen14 commented 3 years ago

When I opened wsltty, it starts a session as root.

I don't see this behavior when I open the default Ubuntu terminal, or Windows Terminal.

I have tried uninstalling and reinstalling wsltty, but the problem is still there.

What can I do to further debug this issue?

mintty commented 3 years ago

It works here. No idea.

Biswa96 commented 3 years ago

Hi @tnguyen14

Also if wslbridge2 is not executed with -u or --user option, it will never change WSL user.

tnguyen14 commented 3 years ago

Thanks @Biswa96. I tried all that you suggested, but nothing seemed odd.

Though I think I've sort of figured it out. wsltty created a bunch of different icons. I clicked WSL Terminal, which I think opened a different VM. If I clicked on Ubuntu 20.04 Terminal, it works fine.

I'm guessing the WSL Terminal is opening to docker-desktop

wsl.exe --list                                                                                       
Windows Subsystem for Linux Distributions:                                                                              
docker-desktop (Default)                                                                                                
docker-desktop-data                                                                                                     
Ubuntu-20.04        
mintty commented 3 years ago

Interesting resolution of this issue. There had been reports about this scenario before, however, it's curious why in your case a WSL shell starts at all when running a Docker instance. Maybe Docker has changed to provide a shell?