ã©ãããnippa ã§ãã
macOS ä¸ã« VMware / VirtualBox 㧠Windows11 ãã¤ã³ã¹ãã¼ã«ãã¦ãWSL ãå©ç¨ããã ã¨æã試è¡é¯èª¤ãã¾ããã
ã©ããã¦ã WSL ã®ç°å¢ãç¨æããå¿ è¦ããã£ãã®ã§ããããããªãã¨ã¯ãããªãã£ãã® ã¨ããªããªãæ å ±ããªãã£ãã®ã§ãã¾ã¨ãã¦ç½®ããã¨æãã¾ãã
macOS ä¸ã§ Windows + WSL ã®ç°å¢ãã¤ãã人ãããããªãã¨æãã¾ããã
ç°å¢
- macOS 14.4
- Virtual Box 7.0
WSL ã®ãã¼ã¸ã§ã³ã«ã¤ãã¦
WSL1 㨠WSL2 ã®éãã§ããã以ä¸ã®éãã§ãã
WSL1: Linux ã«ã¼ãã«ãã¨ãã¥ã¬ã¼ããã¦ãããWindows ã®ãã¡ã¤ã«ã·ã¹ãã ã¨ç´æ¥çµ± åããã¦ãããèµ·åãæ©ããWindows 㨠Linux éã®ãã¡ã¤ã«ã®ããåããéãããã ã¤ãã£ãã® Linux ã«ã¼ãã«ã§ã¯ãªããããå®å ¨ãªäºææ§ããªãã
WSL2: å®éã® Linux ã«ã¼ãã«ãä»®æ³ãã·ã³ä¸ã§å®è¡ãã¦ãããLinux ã¢ããªã±ã¼ã·ã§ ã³ã®äºææ§ãåä¸ãã¦ãããä¸æ¹ã§ãä»®æ³åæè¡ã使ç¨ãããããWSL1 ã«æ¯ã¹ã¦èµ·å ãå°ãé ããWindows 㨠Linux éã®ãã¡ã¤ã«ã®ããåããè¥å¹²é ããªããã¨ãããã
WSL2 ã§ã¯ Linux ã«ã¼ãã«ãå®éã«åããã¦ãã¾ãã®ã§ãLinux ãå©ç¨ãã¦ããã®ã¨åã ã§ãããWSL1 ã§ã¯ Linux Like ãªç°å¢ãåããã¦ããã¨èªèãã¦ããã°è¯ãã¨æãã¾ã ããã®å·®ãç°å¢æ§ç¯ã«ãå½±é¿ãã¾ãã
ä»®æ³ç°å¢ä¸ã® Windows ã§ã® WSL ã®å©ç¨
WSL ã®å¯¾å¿ç¶æ³
Microsoft ã®ãã¼ã¸ã«ä»®æ³ç°å¢ï¼VMware/VirtualBoxï¼ã§ã® WSL ã®å¯¾å¿ç¶æ³ãè¨è¼ãã㦠ãã¾ããã
https://learn.microsoft.com/ja-jp/windows/wsl/compare-versions
ä»®æ³ç°å¢ä¸ã§ã¯ WSL1 ã¯å¯¾å¿ãã¦ããããWSL2 ã¯å¯¾å¿ã§ãã¦ããªãã¨ãããã¨ã§ãã
Hypervisor ä¸ã§ Hypervisor ãåããã®ã¯ãªããªã大å¤ã¨ãããã¨ã ã¨æãã¾ãã
ä»®æ³ç°å¢ã® Windows ã§ã® WSL ã®æå¹å
Windows11 ã§ã¯ WSL ã®ãã¼ã¸ã§ã³ã¯ï¼ãããã©ã«ãã«ãªã£ã¦ãã¾ãã
ä»®æ³ç°å¢ä¸ã§ WSL ãå©ç¨ããã«ã¯ãWSL1 ã«å¤æ´ãã¦å©ç¨ããå¿ è¦ãããã¾ãã以ä¸ã®æ é æ¸ WSL ã®æå¹åããã¦ããã¾ãã
wsl ã®ã¤ã³ã¹ãã¼ã«
PowerShell ãéãã¦ã以ä¸ã®ã³ãã³ããå®è¡ã㦠wsl ã®ã³ãã³ããã¤ã³ã¹ãã¼ã«ã ã¾ãã
wsl --install
WSL ã®ãã¼ã¸ã§ã³ã®è¨å®
ç¾å¨ã®ã¨ãããä»®æ³ç°å¢ã® Windows ã§ã¯ WSL1 ã®ã¿ã対å¿ãã¦ãã¾ããWindows11 㧠ã¯ããã©ã«ãããã¼ã¸ã§ã³ï¼ãããã¯ãè¨å®ããã¦ããªãã®ã§ããã¼ã¸ã§ã³ï¼ã«è¨å® ãã¾ãã
ã¾ããWAS ã®ããã©ã«ãã®ãã¼ã¸ã§ã³ãè¨å®ããã¦ãããã確èªãã¾ãã
wsl -l -v
# åºåçµæ
Linux ç¨ Windows ãµãã·ã¹ãã ã«ã¤ã³ã¹ãã¼ã«ããã¦ãããã£ã¹ããªãã¥ã¼ã·ã§ã³ã¯ããã¾ããã
ããã©ã«ãããã¼ã¸ã§ã³ 1 ã«ã»ãããã¾ãã
wsl --set-default-version 1
# åºåçµæ
ãã®æä½ãæ£ããçµäºãã¾ããã
以ä¸ã®ãããªã¨ã©ã¼ãåºãå ´åãããã¾ãããã®å ´åãWindows ã® Linux ãµãã·ã¹ã ã ãæå¹åããã¦ããªããã¨ãåå ã§ãã
WSL1 ã¯ãç¾å¨ã®ãã·ã³æ§æã§ã¯ãµãã¼ãããã¦ãã¾ããã
WSL1 ã使ç¨ããã«ã¯ã"Linux ç¨ Windows ãµãã·ã¹ãã " ãªãã·ã§ã³ ã³ã³ãã¼ãã³ããæå¹ã«ãã¦ãã ããã
ã¨ã©ã¼ ã³ã¼ã: Wsl/WSL_E_WSL1_NOT_SUPPORTED
æå¹åã¯ãã³ã³ããã¼ã«ããã«ã-ãããã°ã©ã ã-ãããã°ã©ã ã¨æ©è½ã-ãWindows ã®æ©è½ã®æå¹åã¾ãã¯ç¡å¹åããããLinux ç¨ Windows ãµãã·ã¹ãã ãã«ãã§ãã¯ã ãããããä¸è¨ã³ãã³ãã§æå¹åãããã·ã³ãåèµ·åã§è§£æ±ºã§ãã¾ãã
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
WSL ç¨ã®ãã£ã¹ããªãã¥ã¼ã·ã§ã³ã®ã¤ã³ã¹ãã¼ã«
ã¤ã³ã¹ãã¼ã«å¯è½ãªãã£ã¹ããªãã¥ã¼ã·ã§ã³ã®ç¢ºèªããã¦ã¤ã³ã¹ãã¼ã«ãã¾ãã
# ãã£ã¹ããªãã¥ã¼ã·ã§ã³ã®ç¢ºèª
wsl -l --online
# åºåçµæ
NAME FRIENDLY NAME
Ubuntu Ubuntu
Debian Debian GNU/Linux
kali-linux Kali Linux Rolling
Ubuntu-18.04 Ubuntu 18.04 LTS
Ubuntu-20.04 Ubuntu 20.04 LTS
Ubuntu-22.04 Ubuntu 22.04 LTS
openSUSE-Tumbleweed openSUSE Tumbleweed
# ãã£ã¹ããªãã¥ã¼ã·ã§ã³ã®ã¤ã³ã¹ãã¼ã«
wsl --install Ubuntu22.04 1
ãã㧠WSLï¼ubuntu22.04 ã¢ããªï¼ãèµ·åã§ããã°ã¤ã³ã¹ãã¼ã«å®äºã«ãªãã¾ãã
WSL2 ãã¤ã³ã¹ãã¼ã«ãã¦å®è¡ããå ´åã®ã¨ã©ã¼
WSL2 ãã¤ã³ã¹ãã¼ã«ãã¦å®è¡ããã¨ä»¥ä¸ã®ãããªã¨ã©ã¼ãçºçãã¾ããWSL1 ã«ãã¼ã¸ã§ ã³ãå¤æ´ãã¦ã¤ã³ã¹ãã¼ã«ãã¦ãã ããã
Installing, this may take a few minutes... WslRegisterDistribution failed with error: 0x80370102 Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS. For information please visit https://aka.ms/enablevirtualization Press any key to continue...
ææ³
ä»åãmacOS 㧠仮æ³ç°å¢ã® Windows11 ã« WSL ãã¤ã³ã¹ãã¼ã«ãã¾ãããæ å ±ãå°ãªã æéåã£ãã®ã§ã対å¿æ¹æ³ãæ®ãã¦ããã¾ãã
ä»®æ³ç°å¢ã® Windows ã WSL2 ã«å¯¾å¿ããã¨ãã®ãããªä½æ¥ã¯ãªããªãã¨æãã¾ãããã¾ ã ãã°ããã¯é£ããããªã®ã§ãã®æ¹æ³ã試ãã¦ã¿ã¦ãã ããã
ã§ã¯ã§ã¯ãã¾ã次åã