WSL: WSL2-Ubuntu [process exited with code 1] under updating 19564.1005

As the title. I updated the insider version to 19564.1005. WSL2-Ubuntu cannot start. I got [process exited with code 1] error with Terminal-run.

QQ截图20200215123656

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 8
  • Comments: 69 (3 by maintainers)

Most upvoted comments

I also have this issue, but by trying “netsh winsock reset” under admin, it solved the problem.

@dtriana - either apt install zsh or modify your users shell with chsh.

Thanks @benhillis. For other non linux users like me, uninstalling zsh with apt-get doesn’t reset the shell to bash, but since we already lost access to either shell, it is necessary to first get a new shell with that wsl --user root, and then run chsh -s /bin/bash [theUsernameOfYourUser] , then its all good again.

I also have this issue, but by trying “netsh winsock reset” under admin, it solved the problem.

Worked perfectly! 👍

However, everytime when I reboot my computer, this problem appears again. 😢

if you have any solution? i meet the same situation as you. everytime i reboot, it will not work

Mine too. I installed an then uninstalled zsh. And am stuck with [process exited with code 1] message now. Wsl shutdown and winsock reset do not work 😕

Hi, I was getting the same error but in VSCode integrated terminal. This is how I solved it. Check the default WSL distribution with wsl -l --all. I had docker-desktop set as the default distribution. Change the distribution to Ubuntu with wsl --setdefault Ubuntu. HTH.

I also have this issue, but by trying “netsh winsock reset” under admin, it solved the problem.

Worked perfectly! 👍

However, everytime when I reboot my computer, this problem appears again. 😢

if you have any solution? i meet the same situation as you. everytime i reboot, it will not work

Mine too. I installed an then uninstalled zsh. And am stuck with [process exited with code 1] message now. Wsl shutdown and winsock reset do not work 😕

Same here, my brain farted and I removed zsh without thinking too much. Now either I manage to enter as root in that WSL Distro or I think I’ve got to rebuild it completely.

EDIT: nvm, I managed to solve the issue by using wsl --user root and fixing zsh from there.

It seems very random as to whether it starts the instance, or fails to connect/start it still. I’m still alternating between both “The Windows Subsystem for Linux Instance has terminated.” and the original connection error when attempting to launch a new session after running wsl --shutdown

In my case, it’s the fish shell was removed in unknown reason after I installed Docker Desktop. Just open a PowerShell and run

wsl -e /bin/bash

you can go into bash shell, then reinstall the missing fish

sudo apt install fish

that solved the problem.

Hello everyone! I had this issue running chsh to change my default shell and provided a shell that didn’t exist, e.g. /usr/bin/bash when it should’ve been /bin/bash Any attempts to modify chsh would ask for a password and I could not access the WSL terminal in vscode or any other method.

To resolve this, you need to execute commands directly from the CMD. For example this command wsl.exe -e chsh -s /bin/bash This executes the linux command chsh and changes the shell to /bin/bash

Now if it asks you for a password and says PAM: Authentication failure this is because the root user doesn’t have a valid profile under passwd config to execute this command. We can temporarily disable this by accessing your WSL folder directory, mine is under \\wsl$\Ubuntu-18.04\etc\pam.d which you can type into explorer if your ubuntu instance is running. Edit the chsh file to change auth required pam_shells.so to auth sufficient pam_shells.so and save the file.

You should now be able to run the wsl.exe command in CMD without a password prompt. I recommend you revert the chsh file back to required after making your change.

I removed zsh from wsl distro then I got the error [process exited with code 1] , I managed to solve this by logging in to wsl using wsl --user root -d [distro name] then running command chsh --shell /bin/bash [username] fixed the issue.

I also have this issue, but by trying “netsh winsock reset” under admin, it solved the problem.

Worked perfectly! 👍

However, everytime when I reboot my computer, this problem appears again. 😢

The Error Cause

The error is the result of lauching docker-desktop when it is set as your default WSL distribution.

Solution 1

As @rahulrai-in pointed out, you can simply set a default distro.

Solution 2

Also, if you have multiple profiles in your windows terminal, you have to provide a start-up command for each terminal profile.

Example

This settings.json is not complete but should provide necessary information to update your win-term-settings. %localappdata%\Packages\Microsoft.Windos.Terminal._………………\LocalState\settings.json ->

{
    "profiles":
    {
        "list":[
            {
                "hidden": false,
                "name": "Ubuntu-20.04",
                "source": "Windows.Terminal.Wsl",
                "commandline": "wsl -d Ubuntu-20.04"
            }
        ]
    }
}

open your terminal as administrator and type: wsl -u root

and then execute this command: chsh -s /bin/bash your-ubuntu-username

restart terminal.

As the title. I updated the insider version to 19564.1005. WSL2-Ubuntu cannot start. I got [process exited with code 1] error with Terminal-run. QQ截图20200215123656

Open PowerShell then type wsl -e bash to use the bash shell, then replace the default shell using bash by typing chsh -s /bin/bash

I wished I read this earlier. I ultimately did the same thing, but logged in as root from PowerShell wsl -d <distro> --user root. From there, switched user and ran the command to run the default shell: su <normalUser> -s /usr/bin/bash. Then reinstalled zsh and changed the shell back to zsh: sudo apt install zsh -y && chsh -s /usr/bin/zsh. The reason why I posted this is in case anyone else may need a reason to access the shell from within WSL as root and change the necessary configs.

As the title. I updated the insider version to 19564.1005. WSL2-Ubuntu cannot start. I got [process exited with code 1] error with Terminal-run.

QQ截图20200215123656

Open PowerShell then type wsl -e bash to use the bash shell, then replace the default shell using bash by typing chsh -s /bin/bash

Same here, my brain farted and I removed zsh without thinking too much. Now either I manage to enter as root in that WSL Distro or I think I’ve got to rebuild it completely.

EDIT: nvm, I managed to solve the issue by using wsl --user root and fixing zsh from there.

@edmael Can you elaborate or share a link on “fixing zsh from there”?, The reason I’m stuck here is because of uninstalling zsh … Thanks

This is severe enough, hitting so many users, I don’t understand why dev / microsoft is not looking into it with high urgency.

If you came to the conclusion that you need to renistall the ubuntu, instead, Reset the app in the Add or removes program.

Screenshot 2022-07-04 213222 Screenshot 2022-07-04 213248

wsl --user root

this command worked for me.thanks

The only thing that helped me was reinstall the shell (uninstall under windows and install again)

It seems like some customizations may possibly breaks wsl. It is important than that it will be properly documented.

In my case however, I did have a fresh install of Ubuntu-20.04 , after upgrading to wsl v2. But that does not work as it hits this issue. I have not customized anything special other than terminal colors, prompt and path. If this breaks wsl, something is really broken.

I gave up on v2. I’ve converted my distos back to v1, and I am back in business.

@thisisbenmanley Did you try the options mentioned in the previous reply? #4899 (comment)

Yeah. Mine wasn’t a docker problem at all, but yes I already had a default distro that was working previously, and adding a start-up command didn’t work either.

@thisisbenmanley from what you mentioned, it seems like your WSL2 is borked. I hope reinstalling WSL2 solves your problem.

Still getting [process exited with code 1]. Guest: Ubuntu 18.04 Host: Windows version 2004, build 19041.329 WSL1 was working great forever, converted to WSL2 and got numerous errors but eventually only this one. netsh winsock reset and any amount of restarting never worked for me. Tried converting back to WSL1, still the same error. Going to do a full reinstall of Ubuntu starting in WSL2 because other threads have mentioned that working.

I also have this issue, but by trying “netsh winsock reset” under admin, it solved the problem.

It works! Thanks!