æ´ããæ¥ææ¥ã®ååä¸ã丸ã
æ½°ãã¦ãã¾ã£ãã
Â
Windows Server 2022ã§PowerShellãèµ·åããã¨wslã³ãã³ããåããã¨ã«æ°ã¥ããã
Â
Ubuntuã使ããã
PS C:\Users\Administrator> wsl -l -o
ã¤ã³ã¹ãã¼ã«ã§ããæå¹ãªãã£ã¹ããªãã¥ã¼ã·ã§ã³ã®ä¸è¦§ã次ã«ç¤ºãã¾ãã
æ¢å®ã®åå¸ã¯ ' * ' ã§è¡¨ããã¾ãã
'wsl --install -d <Distro>'ã使ç¨ãã¦ã¤ã³ã¹ãã¼ã«ãã¾ãã
NAME FRIENDLY NAME
* Ubuntu Ubuntu
Debian Debian GNU/Linux
kali-linux Kali Linux Rolling
openSUSE-42 openSUSE Leap 42
SLES-12 SUSE Linux Enterprise Server v12
Ubuntu-16.04 Ubuntu 16.04 LTS
Ubuntu-18.04 Ubuntu 18.04 LTS
Ubuntu-20.04 Ubuntu 20.04 LTS
Â
ã¤ã³ã¹ãã¼ã«ãã¦ã¿ãã¨ãã¾ããã£ãããã®ã¿ã¤ãã³ã°ã§WSL(Windows Subsystem for Linux)ã®ã¤ã³ã¹ãã¼ã«ãããã®ãã
PS C:\Users\Administrator> wsl --install -d Ubuntu
ã¤ã³ã¹ãã¼ã«ä¸: ä»®æ³ãã·ã³ ãã©ãããã©ã¼ã
ä»®æ³ãã·ã³ ãã©ãããã©ã¼ã ã¯ã¤ã³ã¹ãã¼ã«ããã¾ããã
ã¤ã³ã¹ãã¼ã«ä¸: Linux ç¨ Windows ãµãã·ã¹ãã
Linux ç¨ Windows ãµãã·ã¹ãã ã¯ã¤ã³ã¹ãã¼ã«ããã¾ããã
ãã¦ã³ãã¼ãä¸: WSL ã«ã¼ãã«
ã¤ã³ã¹ãã¼ã«ä¸: WSL ã«ã¼ãã«
WSL ã«ã¼ãã« ã¯ã¤ã³ã¹ãã¼ã«ããã¾ããã
ãã¦ã³ãã¼ãä¸: Ubuntu
è¦æ±ãããæä½ã¯æ£å¸¸ã«çµäºãã¾ãããå¤æ´ãæå¹ã«ããã«ã¯ãã·ã¹ãã ãåèµ·åããå¿
è¦ãããã¾ãã
Â
åèµ·åããã
ãªãããã£ã¦ãã
Â
ããããã¨ã©ã¼åºã¦ãã
Â
æ¤ç´¢ãã¦ã¿ãã
camedphone.com
ã»ä»®æ³åãBIOSã®è¨å®ã§æå¹ã«ãªã£ã¦ããããè¦ã¦ãã ãã
ã»å¤ãCPUã§ã¯æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ãã¦ãWSL2ãå®è¡ã§ããªã
Â
ä»®æ³ãã·ã³ã ãå¤ãCPUã§ã¯ãªãã®ã§ããä»®æ³åãæå¹ã«ãªã£ã¦ãªããã®ã»ãã ããã
Â
æãåºãã¦ã¿ããå¤åã³ã¬ã
shigeo-t.hatenablog.com
shigeo-t.hatenablog.com
Â
以åã®ã¨ã³ããªã®ä¾ã§ã¯VirtualBoxã ããVMã®Windows Server 2022ã§ã¯Hyper-Vãåãã¦ããªãã¯ãããã§ãã¯ãã¦ã¿ãã確ãã«Unsupportedã§ããã
Â
ãã¼ã«ã¯ãã¡ãã
openlibsys.org
Â
ã¨ãããã¨ã§ã·ã£ãããã¦ã³ãã¦vmxãã¡ã¤ã«ãæ¸ãæããã
Â
èµ·åããããããã¨ã©ã¼ã«ãªãã
Â
vhv.enable = "TRUE"ãåãé¤ãã¨èµ·åããã
Â
ä»åº¦ã¯ä»®æ³ãã·ã³ã®è¨å®ã®å¤æ´ã§ããã»ããµãé¸ã³ãIntel VT-x/EPTã¾ãã¯AMD-V/RVIãä»®æ³åã«ãã§ãã¯ãå
¥ãããããã§vmxãã¡ã¤ã«ãè¦ãã¨vhv.enable = "TRUE"ã追å ããã¦ããã
Â
èµ·åããã¨Playerã§ã¯ãã¹ããããä»®æ³åã¯ãµãã¼ããã¦ãã¾ããã«ãªã£ã¦ãã¾ãã
Â
以åã¯éå»ã¨ã³ããªã®ããã«æ®éã«ãã¹ãã§ãã¦ããã®ã§ãæ©è½ãçµã£ãã®ã ãããã¨æã£ã¦æ¤ç´¢ãã¦ã¿ããããããããã
degitech91.com
Â
ããããã°ãã¹ãOSã®Windows 10ã§ã¯WSL2ãåãã®ã§Hyper-Vãåãã¦ããã
bcdedit /set hypervisorlaunchtype off
ããã§Hyper-Vãæ¢ããIntel VT-x/EPTã¾ãã¯AMD-V/RVIãä»®æ³åã«ãã§ãã¯ãå
¥ãåèµ·åãèµ·åã§ããã
Â
ä»åº¦ã¯å
¨é¨OKã
Â
Ubuntuãèµ·åãã¦ã¿ããã§ã0x80370102ã
Â
ã©ããªã£ã¦ãããè¦ã¦ã¿ãã¨ã¤ã³ã¹ãã¼ã«ããã¦ããªããã¨ã«ãªã£ã¦ããã
Â
ä»åº¦ã¯Ubuntu 20.04ãã¤ã³ã¹ãã¼ã«ãã¦ã¿ãã
ã§ãã¾ã0x80370102ã§ãããä¸åº¦WSLãã¢ã³ã¤ã³ã¹ãã¼ã«ãã¦æåããããç´ããåèµ·åããã
PS C:\Users\Administrator> wsl --install -d Ubuntu-20.04
ã¤ã³ã¹ãã¼ã«ä¸: Linux ç¨ Windows ãµãã·ã¹ãã
Linux ç¨ Windows ãµãã·ã¹ãã ã¯ã¤ã³ã¹ãã¼ã«ããã¾ããã
ãã¦ã³ãã¼ãä¸: Ubuntu 20.04 LTS
è¦æ±ãããæä½ã¯æ£å¸¸ã«çµäºãã¾ãããå¤æ´ãæå¹ã«ããã«ã¯ãã·ã¹ãã ãåèµ·åããå¿
è¦ãããã¾ãã
ã§ãçµæã¯å¤ãããã
Â
ã¨ãããã¨ã§ããåãã¦Windows Server 2022ãæ¶ããã¯ãªã¼ã³ã¤ã³ã¹ãã¼ã«ãã¦ããããè¨å®ãã¦WSLãå
¥ãç´ããã
PS C:\Users\Administrator> wsl -l -o
ã¤ã³ã¹ãã¼ã«ã§ããæå¹ãªãã£ã¹ããªãã¥ã¼ã·ã§ã³ã®ä¸è¦§ã次ã«ç¤ºãã¾ãã
æ¢å®ã®åå¸ã¯ ' * ' ã§è¡¨ããã¾ãã
 'wsl --install -d <Distro>'ã使ç¨ãã¦ã¤ã³ã¹ãã¼ã«ãã¾ãã
 NAME       FRIENDLY NAME
* Ubuntu      Ubuntu
 Debian      Debian GNU/Linux
 kali-linux    Kali Linux Rolling
 openSUSE-42   openSUSE Leap 42
 SLES-12     SUSE Linux Enterprise Server v12
 Ubuntu-16.04   Ubuntu 16.04 LTS
 Ubuntu-18.04   Ubuntu 18.04 LTS
 Ubuntu-20.04   Ubuntu 20.04 LTS
PS C:\Users\Administrator> wsl --install -d Ubuntu-20.04
ã¤ã³ã¹ãã¼ã«ä¸: ä»®æ³ãã·ã³ ãã©ãããã©ã¼ã
ä»®æ³ãã·ã³ ãã©ãããã©ã¼ã ã¯ã¤ã³ã¹ãã¼ã«ããã¾ããã
ã¤ã³ã¹ãã¼ã«ä¸: Linux ç¨ Windows ãµãã·ã¹ãã
Linux ç¨ Windows ãµãã·ã¹ãã ã¯ã¤ã³ã¹ãã¼ã«ããã¾ããã
ãã¦ã³ãã¼ãä¸: Ubuntu 20.04 LTS
è¦æ±ãããæä½ã¯æ£å¸¸ã«çµäºãã¾ãããå¤æ´ãæå¹ã«ããã«ã¯ãã·ã¹ãã ãåèµ·åããå¿
è¦ãããã¾ãã
Â
ä»åº¦ã¯æåããã
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: shigeo
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 20.04 LTS (GNU/Linux 4.4.0-20348-Microsoft x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Sun Jun 19 10:43:08 JST 2022
System load: 0.52 Processes: 7
Usage of /home: unknown Users logged in: 0
Memory usage: 12% IPv4 address for eth0: 192.168.157.129
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/shigeo/.hushlogin file.
shigeo@WIN-B66PFC0P6VO:~$
Â
ã¨ãããã¨ã§ãæåããä»®æ³åãåãç°å¢ãããªãã¨æåããªãã£ã½ãã
Â
ã§ã調ã¹ã¦ã¿ãã¨WSL1ã§ããã
PS C:\Users\Administrator> wsl -l -v
NAME STATE VERSION
* Ubuntu-20.04 Running 1
Â
ããã§ãã®WSL2ã«ããã
PS C:\Users\Administrator> dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
å±éã¤ã¡ã¼ã¸ã®ãµã¼ãã¹ã¨ç®¡çãã¼ã«
ãã¼ã¸ã§ã³: 10.0.20348.1
ã¤ã¡ã¼ã¸ã®ãã¼ã¸ã§ã³: 10.0.20348.587
æ©è½ãæå¹ã«ãã¦ãã¾ã
[==========================100.0%==========================]
æä½ã¯æ£å¸¸ã«å®äºãã¾ããã
Â
ã§ãwsl --set-versionã¨ãå
¥ãã¦ããã«ããæµãããHyper-Vãå
¥ã£ã¦ãªãã£ãã
Â
shigeo-t.hatenablog.com
Â
Hyper-Vãã¤ã³ã¹ãã¼ã«ãããã§ãç¶æ
ã¯å¤ãããªããstatusãè¦ã¦ã¿ãã¨WSL 2ã«ã¼ãã«ãã¡ã¤ã«ãè¦ã¤ãããªãã¨ãããããã§updateãæããã失æã
PS C:\Users\Administrator> wsl --status
æ¢å®ã®é
å¸: Ubuntu-20.04
æ¢å®ã®ãã¼ã¸ã§ã³: 1
WSL ã®èªåæ´æ°ãæå¹ã«ãªã£ã¦ãã¾ãã
WSL 2 ã«ã¼ãã« ãã¡ã¤ã«ãè¦ã¤ããã¾ãããã«ã¼ãã«ãæ´æ°ã¾ãã¯å¾©å
ããã«ã¯ã'wsl.exe --update' ãå®è¡ãã¦ãã ããã
PS C:\Users\Administrator> wsl --update
æ´æ°ããã§ãã¯ä¸...
å©ç¨ã§ããæ´æ°ã¯ããã¾ããã
WSL 2 ã«ã¼ãã« ãã¡ã¤ã«ãè¦ã¤ããã¾ãããæåã§ã®åã¤ã³ã¹ãã¼ã«ã¾ãã¯ä¿®å¾©ãå¿
è¦ãªå¯è½æ§ãããã¾ãã
詳細ã«ã¤ãã¦ã¯ãhttps://aka.ms/wsl2kernel ãã覧ãã ããã
Â
è¨ãããéããhttps://aka.ms/wsl2kernel ãè¦ãã
docs.microsoft.com
Â
æ示éãææ°ã®ããã±ã¼ã¸ããã¦ã³ãã¼ããããèµ·åããã¨ãããªæãã
ã©ãã©ãé²ããã
Â
ä¸å¿ææ°ã«ãªã£ãã
PS C:\Users\Administrator> wsl --update
æ´æ°ããã§ãã¯ä¸...
å©ç¨ã§ããæ´æ°ã¯ããã¾ããã
ã«ã¼ãã« ãã¼ã¸ã§ã³: 5.10.16
PS C:\Users\Administrator> wsl --status
æ¢å®ã®é
å¸: Ubuntu-20.04
æ¢å®ã®ãã¼ã¸ã§ã³: 1
Linux ç¨ Windows ãµãã·ã¹ãã ã®æçµæ´æ°æ¥: 2022/06/19
WSL ã®èªåæ´æ°ãæå¹ã«ãªã£ã¦ãã¾ãã
ã«ã¼ãã« ãã¼ã¸ã§ã³: 5.10.16
Â
ããwsl --set-versionã³ãã³ããå
¥ããã¨ãã«ããæµãããããããããªãã®ã§OSåèµ·åããããå¤ãããªããããã§Ubuntu-20.04ãåé¤ã
PS C:\Users\Administrator> wsl --unregister Ubuntu-20.04
ç»é²ã解é¤ãã¦ãã¾ã...
PS C:\Users\Administrator> wsl -l -v
Linux ç¨ Windows ãµãã·ã¹ãã ã«ã¯ããã£ã¹ããªãã¥ã¼ã·ã§ã³ãã¤ã³ã¹ãã¼ã«ããã¦ãã¾ããã
ãã£ã¹ããªãã¥ã¼ã·ã§ã³ã¯ Microsoft Store ã«ã¢ã¯ã»ã¹ãã¦ã¤ã³ã¹ãã¼ã«ãããã¨ãã§ãã¾ã:
https://aka.ms/wslstore
Â
ããã§æ°ãéãã¦Windows Updateãæãã¦ã¿ãããªãã¼ãå
¥ã£ããããã¨ã©ãã§ãããã
PS C:\Users\Administrator> wsl --set-default-version 2
WSL 2 ã¨ã®ä¸»ãªéãã«ã¤ãã¦ã¯ãhttps://aka.ms/wsl2 ãåç
§ãã¦ãã ãã
ãã®æä½ãæ£ããçµäºãã¾ããã
WSL2ã«ãªã£ãã£ã½ãã確èªããã
PS C:\Users\Administrator> wsl --status
æ¢å®ã®ãã¼ã¸ã§ã³: 2
Linux ç¨ Windows ãµãã·ã¹ãã ã®æçµæ´æ°æ¥: 2022/06/19
Windows Subsystem for Linux ã«ã¼ãã«ã¯ã' wsl--update ' ã使ç¨ãã¦æåã§æ´æ°ã§ãã¾ãããã·ã¹ãã è¨å®ãåå ã§èªåæ´æ°ãçºçãããã¨ã¯ããã¾ããã
ã«ã¼ãã«ã®èªåæ´æ°ãåãåãã«ã¯ã Windows Update ã®è¨å®ãæå¹ã«ãã¦ãã ãã:' Windowsã®æ´æ°ã«ããã®ä»ã®Microsoftã®è£½å
ã®æ´æ°æ
å ±ãåãåã'ã
詳細ã«ã¤ãã¦ã¯ã https://aka.ms/wsl2kernel.
ãåç
§ãã¦ãã ãã
ã«ã¼ãã« ãã¼ã¸ã§ã³: 5.10.16
Â
æéæãã£ãããªãã¨ã使ããã¨ããã¾ã§æ¥ããæ¶ããUbuntu 20.04ãããä¸åº¦å
¥ãããå
¥ã£ã¦ãã£ã¦è¨ããããã©WSL2ã§åããã
PS C:\Users\Administrator> wsl --install -d Ubuntu-20.04
Ubuntu 20.04 LTS ã¯æ¢ã«ã¤ã³ã¹ãã¼ã«ããã¦ãã¾ã
Ubuntu 20.04 LTS ãèµ·åãã¦ãã¾ã...
PS C:\Users\Administrator> wsl -l -v
NAME STATE VERSION
* Ubuntu-20.04 Running 2
Â
ãã¨ä½è«ã ãã©ãåã«ä½ã£ãVMã¯ã¡ã¢ãª8GBã§ãªãããã£ããã ãªã¨æã£ã¦ãããã ãã©ãããåããå¢ãã§ã¡ã¢ãª16GBã«ããããã£ãããããªãã£ããServerã®ããã«æå¤ã¨ããããéããªã£ã¦ããã®ãããããªãWindows Server 2022ããã2019ããã£ããã ã£ãããã