Setup environment Ubuntu on WSL2 - ytak-sagit/game-of-life-react GitHub Wiki

WSL2, Ubuntuのインストール

Windows側で、ターミナル or PowerShellを管理者権限で起動

wsl --install
#> Ubuntuインストールも自動で実施される

インストール完了後、PCを再起動する

Ubuntuのセットアップ

アカウント登録

PC再起動後、Ubuntuのターミナルが起動するため、usernamepassword を入力

Ubuntu は既にインストールされています。
Ubuntu を起動しています...
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: <ユーザ名>
New password: <パスワード>
Retype new password: <パスワード再入力>
passwd: password updated successfully
Installation successful!
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.153.1-microsoft-standard-WSL2 x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage


This message is shown once a day. To disable it please create the
/home/<ユーザ名>/.hushlogin file.

Ubuntuパッケージのアップデート・アップグレード

sudo apt update && sudo apt upgrade

WSL2のドライブ割り当て (Optional)

Windows側で、PowerShellを管理者権限で起動後、WindowsのドライブレターをWSL2のディレクトリへ割り当てる

net use U: \\wsl$\ubuntu
⚠️ **GitHub.com Fallback** ⚠️