WindowsServer2019からWSLをサーバーマネージャーからインストールできるようになったんですね。
今までは、2016まではCygwinとかを入れていたけれど、役割機能からすぐに入れられるので便利ですね。
ただ、サーバOSにLinux環境入れるのってどういう利点があるのかがイマイチ分からない。
ssh.exeとかもバンドルされているからDocker環境とかに使うのかな。まあいいか。
Powershellの場合
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Ubuntuのインストール
Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile ubuntu-1804.zip Expand-Archive .\ubuntu-1804.zip cd .\ubuntu-1804\ .\ubuntu1804.exe
Linux環境を使う
PS C:\Users\Administrator\ubuntu-1804> .\ubuntu1804.exe 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 password: Retype new UNIX password: passwd: password updated successfully Installation successful! To run a command as administrator (user "root"), use "sudo <command>". See "man sudo_root" for details. password@WIN-H9ROE12B2PB:~$ password@WIN-H9ROE12B2PB:~$ sudo su - [sudo] password for password: root@WIN-H9ROE12B2PB:~# pwd /root root@WIN-H9ROE12B2PB:~#