What to do when booting Ubuntu on WSL2 and getting "Process terminated with code 1"

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.

Coping

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.

Cause

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

What to do when booting Ubuntu on WSL2 and getting "Process terminated with code 1"
What to do when CentOS cannot be started with VirtualBox on Catalina
Notes on what to do when EC2 is set up with t2.micro
How to remove Ubuntu when dual booting Windows and Ubuntu
What to do when you launch an application with rails
WSL2 Ubuntu 20 can no longer apt-get, so what to do
[Joke] What to do when the invalid sample rate is reached when using Mixxx on Ubuntu 20.04
What to do if you enable UFW on Ubuntu VM on GCP and you can't connect to SSH
Results of trying to use NVENC (CUDA) with Ubuntu 18.04 on WSL2
Notes on what to do if Ubuntu 20.04 installation on Virtual box 6.1 (Windows10) fails with "Error 5 Input / output error"
What to do if Intel RST (Rapid Storage Technology) interferes with dual booting Ubuntu20.04LTS and Windows10
A note when I was addicted to converting Ubuntu on WSL1 to WSL2
What to do when javax.batch.operations.JobStartException occurs
[IOS] What to do when the image is filled with one color
What to do when "npm ERR! Code ENOSELF" is displayed after npm install
A memorandum when IME cannot be turned on with VS Code (Ubuntu 20.04)
What to do when Blocked Host: "host name" appears in Ruby on Rails
What to do and how to install when an error occurs in DXRuby 1.4.7
What to do if tomcat process remains when tomcat is stopped in eclipse
What to do when "call'Hoge.connection' to establish a connection" appears on rails c
Notes on what to do when a WebView ClassNotFoundException occurs in JavaFX 12
What to do when a javax.el.PropertyNotWritableException occurs
Use cljstyle with Spacemacs on Ubuntu on WSL2
What to do if you install Ubuntu
What to do when undefined method ʻuser_signed_in?'
Monitor the Docker container and SystemD process on the same host with Zabbix on Ubuntu.
What to do when "Nil location provided. Can't build URI." Appears on CarrierWave
Introducing a dark Jupyter Notebook with pyenv and Vim keybindings on Ubuntu on WSL 2
What to do when is invalid because it does not start with a'-'
[Ubuntu] What to do when MongoDB cannot be started due to a SocketException error
WELD-001408: What to do when Unsatisfied dependencies for type Bean with qualifiers @Default
What to do if you get an error saying "Please enter a valid value" when getting with Rails datetime_field
Docker on Ubuntu18.04 on WSL2 and VSCode installation instructions
What to do when debugging "Source not found"
What do you use when converting to String?
What to do when IllegalStateException occurs in PlayFramework
After installing'devise''bootstrap' of gemfile with rails, what to do when url is an error
What I was addicted to when developing a Spring Boot application with VS Code
What to do if you get a NoClassDefFoundError when trying to run eclipse on Java9
Ssh to Ubuntu on VirtualBox on your Mac and do it until you install Docker
What to do when build fails by rbenv install / pyenv install with anyenv (Debian system)
What to do when routing settings do not work after building Docker environment with Laravel
Eh !? Run Linux on Windows? I can do it! !! (I set WSL2 and put Ubuntu)
What to do if the JSONHint annotation does not work with lombok and JSONIC
What to do if you get a port error when docker-compose up on Mac
Code to use when you want to process Json with only standard library in Java
What to do when The SSL certificate has expired
What to do when JSF tags do not become HTML
What to do if ClassNotFoundException occurs when starting Tomcat
To implement, write the test and then code the process
What to do if TextToSpeech doesn't work on Android 11
Introduce JavaFX 15 and do GUI development with VS Code
What to do when a null byte error occurs
What to do when rails creates a 〇〇 2.rb file
What to see when IntelliJ doesn't start on Mac
What I stumbled upon when installing Ruby on Ubuntu
Install rbenv with apt on ubuntu and put ruby
Error ExecJS :: RuntimeUnavailable: What to do when it occurs
How to use RealSense with ubuntu 20.04 and ROS Noetic
Common problems with WSL and how to deal with them
ParseException: What to do when Unparseable date is reached