I got a new Surface, so I'd like to try WSL. It's just a summary, so it's for those who want to save the trouble of checking.
WSL2 is required to use Docker Desktop WSL 2 backend, so I think you should upgrade to WSL2 from the beginning.
If you already have a WSL1 distribution, [the same document also describes how to upgrade](https://docs.microsoft.com/en-us/windows/wsl/install-win10#set-your- distribution-version-to-wsl-1-or-wsl-2).
Zsh Same procedure on Linux. Open WSL and install ZSH. (If you enter wsl in PowerShell etc., it will open)
sudo apt update
sudo apt install zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Open ~ / .zshrc in a text editor such as Vim and add the following in the file:
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
Reload Zsh:
source ~/.zshrc
VSCode It works just by installing VS Code. Official Manual (Japanese) Extension for WSL
I made the Default Shell ZSH in the following way, but I'm not sure if I need it:
In VS Code Ctrl + Shift + P
→ Enter" Select Default Shell "→ Select WSL (ZSH)
NodeJS The procedure is the same as installing NodeJS on Linux. Install using NVM.
Installation
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash
Add the following to ~ / .zshrc:
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
Reload Zsh:
source ~/.zshrc
NodeJS Open WSL. Install a specific version
nvm install x.x.x
or latest version
nvm install node
Docker (Docker Desktop WSL 2 backend) The requirements should be met according to the WSL and WSL2 manuals mentioned above. Just download the latest version of the installer and check the WSL2 checkbox during the installation.
Official Manual (English) (You don't have to look at it)
If you get the following error when typing docker in WSL:
The command 'docker' could not be found in this WSL 2 distro.
We recommend to activate the WSL integration in Docker Desktop settings.
See https://docs.docker.com/docker-for-windows/wsl/ for details.
Check if you have Docker Desktop running on Windows or check the WSL version of your Linux Distribution, it will only work with WSL2.
Confirmation and upgrade method
Recommended Posts