Microsoft Windows Subsystem for Linux(WSL)をWindows10 Proにインストールするメモです。
- Powershellターミナルを管理者として起動します
- インストールコマンドを実行します
PowerSell管理者
wsl --install
PowerShell実行結果
インストール中: 仮想マシン プラットフォーム
仮想マシン プラットフォーム はインストールされました。
インストール中: Linux 用 Windows サブシステム
Linux 用 Windows サブシステム はインストールされました。
ダウンロード中: WSL カーネル
インストール中: WSL カーネル
WSL カーネル はインストールされました。
ダウンロード中: Ubuntu
要求された操作は正常に終了しました。変更を有効にするには、システムを再起動する必要があります。
- Windowsを再起動します
- Ubuntuターミナルが開き、インストールしている旨のメッセージが表示されます
Ubuntu
Installing, this may take a few minutes...
- デフォルトUNIXユーザーアカウントを作成します
Ubuntu
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: teruroom
New password:
- ウェルカムメッセージが表示され、Ubuntuのプロンプトが表示されます
Ubuntu
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 20.04 LTS (GNU/Linux 5.10.16.3-microsoft-standard-WSL2 x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Sat Jan 15 02:22:08 JST 2022
System load: 0.0 Processes: 8
Usage of /: 0.4% of 250.98GB Users logged in: 0
Memory usage: 1% IPv4 address for eth0: 172.26.120.168
Swap usage: 0%
0 updates can be installed immediately.
0 of these updates are security updates.
The list of available updates is more than a week old.
To check for new updates run: sudo apt update
This message is shown once once a day. To disable it please create the
/home/teruroom/.hushlogin file.
Ubuntu
teruroom@DESKTOP-Q98KR5E:~$
- 試しにコマンドを打ってみます
Ubuntu
teruroom@DESKTOP-Q98KR5E:~$ pwd
/home/teruroom