WSL2
複数インスタンスの使用
code:powershell
# Install distribution from online
wsl --list --online
wsl --install Ubuntu
# Export and import distribution
wsl --export Ubuntu-18.04 Ubuntu-18.04.tar
wsl --import test ./test_dir Ubuntu-18.04.tar
wsl -d test
# In wsl
adduser foo
usermod -aG sudo foo
exit
# Login to wsl again with foo
wsl -d test -u foo
# Enable systemd
sudo vim /etc/wsl.conf
boot
systemd=true
# Logout from wsl and restart it
wsl --terminate test
wsl -d test -u foo
# Remove distribution
wsl --unregister foo
Appxファイルから新規インスタンスの作成
code:bash
curl.exe -LR -o Ubuntu-1804.Appx https://aka.ms/wsl-ubuntu-1804
mv .\Ubuntu-1804.Appx .\Ubuntu-1804.Appx.zip
Expand-Archive -Path .\Ubuntu-1804.Appx.zip -DestinationPath .\Ubuntu-1804
wsl --import test-ubuntu-18.04 $Env:USERPROFILE\wsl\test-ubuntu-18.04 .\Downloads\Ubuntu-1804\install.tar.gz
wsl -d test-ubuntu-18.04
# ここからWSLの中
adduser user
usermod -aG sudo user
sudo vim /etc/wsl.conf
boot
systemd=true
boot
systemd=true
WSLgのキーボード設定
/programming-notes/WSLgでkeyboard layoutを日本語配列にする
警告音を止める
https://stackoverflow.com/questions/36724209/disable-beep-in-wsl-terminal-on-windows-10
Uncommenting set bell-style none in /etc/inputrc and creating a .bash_profile with setterm -blength 0 didn't stop vim from beeping.
What worked for me was creating a .vimrc file in my home directory with set visualbell.
VS code
https://stackoverflow.com/questions/71464269/vscode-remote-wsl-downloading-server-every-time