æ¦è¦ ã WSL ãã¤ã³ã¿ã¼ãããã«ç¹ãããªããã¨ããææ§ãªãã®ãåå²ãï¼è§£æ±ºããï¼ ãã®è¨äºã§ã解決ã§ããªãå¯è½æ§ãèæ ®ãï¼åé¡è§£æ±ºã«æå¹ã ã¨èããããæ å ±ãæå¾ã«ã¾ã¨ããï¼ èæ¯ ç§ã¯ãã WSL2 ãå©ç¨ãã¦ãã[1]ããï¼å¹¾åº¦ããããã¯ã¼ã¯é¢ä¿ãä¸èª¿ã«ãªã£ããã¨ãããï¼ ãããï¼ãããã®è¨äºã¯å°ãªãããã«æããï¼[2]ããã§ï¼è§£æ±ºçãã¾ã¨ãããã¨ã«ããï¼ å¯¾è±¡èªè WSL2 å©ç¨è æªæ¥ã®èªå æ¬è« ååé¡è§£æ±ºã«é¢ããæç®ã¯ï¼ãã®è¨äºã®æå¾ã«ã¾ã¨ãã¦è¿°ã¹ã¦ããï¼ ã¾ãï¼ä»¥é㧠WSL ã¨è¡¨è¨ããã¨ã㯠WSL2 ã«éå®ãï¼Windows 㯠Windows11 ãæ³å®ããï¼ ããã«ï¼åèµ·åãªã©ã¯å ¨ã¦è©¦è¡æ¸ã¿ã ã¨ããï¼ å½å解決ã«å¤±æãã¦ããå ´å ãã®å ´åã¯ï¼ããè¦ããããã®ã§ï¼åå ã®è§£æ±ºãç°¡åãã¤æ å ±ãè±å¯ã§ããï¼ å¤é¨ã¸ã¢ã¯ã»ã¹ãããã¨ã¯ã§ãããï¼å½å解決ã«ï¼DNS é¢ä¿ã§ï¼å¤±æ
Windows Subsystem for Linuxï¼WSLï¼ã®GUIè¨å®ç»é¢ãéããªããªãªã¼ã¹ãã¡ã¢ãªã®èªå縮éæ©è½ã¯æ£å¼çã« ãã¤ã¯ãã½ããã¯ãWindowsä¸ã§Linuxã®æ©è½ãå©ç¨ã§ããWindows Subsystem for Linuxï¼WSLï¼ã®GUIã«ããè¨å®ç»é¢ãéçºä¸ã§ãããã¨ãæããã«ãã¾ããã ã¾ããç¾å¨å®é¨çæ©è½ã¨ãªã£ã¦ããã¡ã¢ãªã®èªå縮éæ©è½ãæ£å¼çã«ãªããã¨ãæããã«ãã¾ããã WSLã®GUIè¨å®ç»é¢ãç»å ´ ããã¾ã§WSLã®è¨å®ã¯ã.wslconfigããã¡ã¤ã«ã«ãã£ã¦è¡ãå¿ è¦ãããã¾ããã éããªãããã®è¨å®ãã¡ã¤ã«ã¨äºææ§ã®ããGUIè¨å®ç»é¢ãç»å ´äºå®ã§ããããã«ãããWSLã®ã¡ã¢ãªãµã¤ãºãããã»ããµæ°ãã¹ã¯ãããµã¤ãºãã¹ã¯ãããã¡ã¤ã«ãã»ã¼ãã¢ã¼ãã§ã®èµ·åãªã©ãããã¾ã§è¨å®ãã¡ã¤ã«ãæ¸ãæããå¿ è¦ããã£ãè¨å®ãGUIãã容æã«è¡ããããã«ãªãã¾ãã ã¡
WSL2ã«Ubuntuãå ¥ãã¦ãéçºã¨ãã¯ãã¡ããå©ç¨ãã¦ãã¾ãã ã¾ããDocker DesktopãWSL2ã®ããã¯ã¨ã³ãã¨ã³ã¸ã³ãå©ç¨ãã¦ãã¾ãã ç¥ãåãã¨ã®è©±ã§ãUbuntuã®å¤ä»ãã®SSDããã¦ã³ãããã¨ãã話ãåºã¦ãã¦ãããã ã¨é ããªãï¼Ubuntuèªä½ã移åã§ããããããªãããªï¼ã¨ãã æµãã«ãªãã¾ããã ç¥ãåãã¯ãç¹ã«ç§»åã¨ãã¯èãã¦ãªãã£ãã®ã§ãããèªåã®ãã£ã¹ã¯ã®å®¹éãä»ã©ã®ããã使ããã¦ããã®ããæ°ã«ãªãã調ã¹ã¦ã¿ãã¨ã Cãã©ã¤ãã®ä½¿ç¨çã90%ãè¶ ãã¦ããããªãã§ããã WizTreeã¨ããã½ãããååå ¥ãã¦ããã®ãæãåºãã¦ãå度調ã¹ã¦ã¿ãã¨ããUbuntuãããvhdxãã¡ã¤ã«ã®ãµã¤ãºã171GBãDocker Desktopã®ãã¼ã¿é åã®vhdxãã¡ã¤ã«ã®ãµã¤ãºã81GBã¨ãçµæ§ãªå²åã§ãã ååã¯ãHyper-V管çãã¼ã«ã§ä»®æ³ãã£ã¹ã¯ã®å§ç¸®å¦çãè¡ã£
WSLãç»å ´ãã¦ãã大å¤ä¾¿å©ã«å©ç¨ãã¦ãã¾ãã 以åã¯VMwareãVirtualBoxã¨ãã£ãä»®æ³ãã·ã³ããã¼ã«ã«PCã¸å ¥ããããã¦ãã¾ããããç§ã®å ´åãããã¦ãã¯WSLã§è¶³ããæãã«ãªã£ã¦ãã¾ãã ç§ã®å ´åãç°å¢ã使ã£ã¦ãããã¡ã«ãã¯ã©ãã·ã¥ããããããã±ã¼ã¸ãããããã¾ããã¦è¨å®ãããããªã£ã¦å°ã£ããªã©ããã°ãã°ç°å¢ãæ»ããããã¨ãããã¾ãã ä»®æ³ãã·ã³ãå©ç¨ãã¦ããæã¯ãã®ã¤ã¡ã¼ã¸ã®ã¹ãããã·ã§ãããåå¾ãããã¨ã§ä¸¸ãã¨ããã¯ã¢ãããã¦ãã¾ããã WSL2ã§ãããã¯ã¢ãããããã¨ãå¯è½ã§ããæé ãã¡ã¢ãã¦ããã¾ãã ç°å¢ 2023å¹´1ææç¹ã®å 容ã«ãªãã¾ããWSLã¯çµæ§é²åãã¦ããå°è±¡ã§ãã®ã§ãè¨äºãå¤ããªã£ãéã¯æ³¨æã§ãã ï¼å°å ¥æé ãªã©åæã«æ¯ã¹ãã¨ããªã楽ã«ãªãã¾ããï¼ OSã¯Windows11 Proã§ããPowerShellããæä½ãã¾ãã PS > wsl --vers
WSL2ã§ã¯ãã¤ã³ã¹ãã¼ã«ããUbuntuãä»®æ³ãã·ã³ã¨ãã¦ç¨¼åãããã¹ãã¨ã¯å¥ã®IPã¢ãã¬ã¹ãæãã¾ãããã®ããããã¹ã(Windows)ããWSL2(Ubuntu)ã§åãã½ããã¦ã§ã¢ãã¤ã¤ãéãWSL2ã®IPã¢ãã¬ã¹ãæå®ããå¿ è¦ãããå ´åãããã¾ãã ã§ã¯ãWSL2ã®IPã¢ãã¬ã¹ã¯ã©ã®ããã«ç¢ºèªããã°ããã§ãããã? ãªãã以ä¸è¨äºã®ããã«.wslconfigãè¨å®ãã¦ããã¨ãWSL2ä¸ã§ç¨¼åããã½ããã¦ã§ã¢ã«localhostã§ã¢ã¯ã»ã¹ã§ããããã«ãªãã®ã§ãããå°ãªãã¨ãèªåã®ç°å¢ã§ã¯ã.wslconfigããªãããã¾ãåããªãã£ããããã¹ãå´ã®ã½ããã¦ã§ã¢ãlocalhostããã¾ã解決ã§ããªãã£ããããå ´åãããã¾ããæ¬è¨äºã¯ããããã±ã¼ã¹ã§å½¹ã«ç«ã¤æ³å®ã§ãã ããWSL 2ãæ大ã®èª²é¡ã§ãã£ãâlocalhostâåé¡ã解決 ï½ãWindows 10ãBuild 18945ã
WSL2ã¯åå解決ãWindowsãã¹ãã«ãé¡ããã¦ããã®ã§ãããããåãã¾ãããã¨ãã話ã ã¤ã¼ãµãããã¢ããã¿ã¼ vEthernet (WSL) ã®IPv4ã¢ãã¬ã¹ãã¨ãã limitation /etc/resolv.conf㧠nameserver 8.8.8.8ã¨ããè¨å®ãã¦ãã¨ä½¿ããªã (ãããåå 㧠DISPLAY ç°å¢å¤æ°ã« 8.8.8.8:0 ãè¨å®ãã¦ãã¾ãæå ã®emacsã®æç»ãGoogleã«ãé¡ããã¦ãã¾ãã¾ãã) 2. ipconfig.exe ãå©ã ipconfig.exe | sed -e 's/\r//' | grep 'IPv4 Address' | head -n 1 | cut -d ':' -f 2 | awk '{print $1}' Windows IP æ§æ ã¤ã¼ãµããã ã¢ããã¿ã¼ ã¤ã¼ãµããã: æ¥ç¶åºæã® DNS ãµãã£ãã¯ã¹ . .
ãWindows Subsystem for Linuxä¸ã®Ubuntuä¸ã®Rubyãã®ã¡ã¢ã§ãããã£ãã®ã¯ä¸è¨ã Windows 10ã§WSLï¼Windows Subsystem for Linuxï¼ãæå¹åãã¦Ubuntuã¤ã³ã¹ãã¼ã« Ubuntuä¸ã§rbenvã¤ã³ã¹ãã¼ã« rbenvã使ã£ã¦Rubyã¤ã³ã¹ãã¼ã« bundlerã使ã£ã¦gemï¼ã©ã¤ãã©ãªï¼ã¤ã³ã¹ãã¼ã« ãã¼ã«ã«ã«Rubyç°å¢ãæ´ãã¦ãããã¨æã£ãã®ã ãã©ãããã¾ã§ãã使ã£ã¦ããPerlã§ã¯Windowsåºæã®åé¡ã§æéåããã¨ããã£ãã®ã§ããWindowsçRubyããWindows Subsystem for Linuxä¸ã®Ubuntuä¸ã®Rubyãã®ä¸¡æ¹ãç¨æãããã¨ã«ãã¾ãããããã¯å¾è ã®ä½æ¥ã¡ã¢ã¨ãããã¨ã«ãªãã¾ãã Windows 10ä¸ã«Ubuntuãå°å ¥ ããWSLå ¥éã第1åãWindows 10æ¨æºL
February 25, 2024 VSCode + WSL makes Windows awesome for web development Iâm kinda shocked. Windows actually got good for web developers. Between VSCode, WSL, and Intelâs latest desktop chips, Iâve been living with a PC for over a week that runs my programming tests faster than an M3 Max, ships with an excellent window manager out-the-box, and generally feels like a completely viable alternative t
WSL2ã使ããããã«ãªã£ãã®ã§ãWindows ã§ã Docker ã使ã£ã¦ã¿ããã¨ã«ãã¾ãããDocker Desktop ãã¤ã³ã¹ãã¼ã«ããã¨ãç¡æ¡ä»¶ã§ Cãã©ã¤ãä¸ã«ä»®æ³ç°å¢ãä½ããã¾ããããCãã©ã¤ãã®ç©ºã容éãå°ãªããªã£ãã®ã§ãDockerç°å¢ãDãã©ã¤ãã«ç§»åããã¨ãã話ã 試ããç°å¢ Windows10 Pro 2004 OSãã«ã 19041.329 Docker Desktop community 2.3.0.3 WSL2(Windows Subsystem for Linux) Docker Desktop ã®è¨å®ã§ã¯ WSL2 Integration ãæå¹ã«ãã¦ãã¾ããWSLã®ãã£ã¹ããªãã¥ã¼ã·ã§ã³ã¯ Ubuntu 20.04 ã使ã£ã¦ããã®ã§ãããã¨ã®ã¤ã³ãã°ã¬ã¼ã·ã§ã³ãæå¹ã«ãã¦ããã¾ãã æ¹æ³ Docker Desktop ã使ã£ã¦ãã WSL ä¸ã®ãã£ã¹ã
WSL 2.0.0以éã§è©¦é¨çã«æä¾ããã¦ãããããã¯ã¼ã¯ãã©ã¼ã¢ã¼ãã¯é常ã«é åçã§ããã¾ã 試é¨çã¨ãããã¨ã§ããã¤ã課é¡ãããã®ãäºå®ã§ããããã§ã¯Dockerã§ã®èª²é¡ã¨åé¿çã交ãã¤ã¤ãã©ã¼ã¢ã¼ãã®æ·±æ·µãè¦ãã¦ã¿ããã¨æãã¾ãã [2023.12.6]Docker Desktopã§ã®ãã¼ãéè¤ã¯ 4.26.0 ã§å¯¾å¿ã¨ãªã£ãããã§ãã Added support for WSL mirrored mode networking (requires WSL v2.0.4 and up). ãªãªã¼ã¹ãã¼ããã [2023.10.25] ãã©ã¼ã¢ã¼ãã¯ããããã¤ãã®æ°æ©è½ã¯Windows11 22H2é常çã«æ©è½éæ¾ããã¾ãããææ°ã®WindowsUpdateé©ç¨ã®ä¸ãã¹ãã¢çWSLãã¢ãããã¼ããããã¨ã«ãã以ä¸ã®ãªãã·ã§ã³ã.wslconfigã§ä½¿ããããã«ãªãã¾ãã Dockerã¤ã
$ sudo apt-get update Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease Ign:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease Ign:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
ããããæ°ãä»ãããWSLèªä½ãsystemdããµãã¼ããããããªã®ã§ãWSLã ãã§systemdãPID 1ã«ãã¦ã¿ãã®ã§ã¡ã¢ãã¦ããã¾ãã 詳ãããã¨ã¯å ¬å¼ããã°ãåç §ãã ããã è¨å®æé å ¬å¼ããã°ã«ããã¨ãWSLã®ãã¼ã¸ã§ã³ã0.67.6以ä¸ã§ä½¿ããã¨ã®ãã¨ã ãªããæå ã®WSLã®ãã¼ã¸ã§ã³ã確èªããã¨ãã§ã«1.0ã«ãªã£ã¦ããã®ã§ã ãã¶åãã使ãããã ãªãã¨ãã£ã¨æ©ãæ°ã¥ãããã£ãæ°æã¡ã§ãã£ã±ãã§ãã 確èªããããã®ã³ãã³ãã¯ä»¥ä¸ã®éãã powershell > wsl --version WSL ãã¼ã¸ã§ã³: 1.0.0.0 ã«ã¼ãã« ãã¼ã¸ã§ã³: 5.15.74.2 WSLg ãã¼ã¸ã§ã³: 1.0.47 MSRDC ãã¼ã¸ã§ã³: 1.2.3575 Direct3D ãã¼ã¸ã§ã³: 1.606.4 DXCore ãã¼ã¸ã§ã³: 10.0.25131.1002-220531-1700
wsl2ã®ãã¹ãåã£ã¦å¤ãããããã§ããï¼ ã¨ããæ¥ã å¾è¼©ã¡ãããwsl2ä¸ã§ä½æ¥ããã¨ãã«ããã¹ãåã«èªåã®ãã·ã³åã表示ãããã®å«ã ãªï½ã å¾è¼©ã¡ãããwsl2ã®ãã¹ãåã£ã¦å¤ããããªãã®ããªï½ã å¾è¼©ã¡ãããã»ãã»ããè¯ãé»ãç»é¢ã®ãã£ããã£ã¨ãæ®ããã¨å¤ããããªãã§ããï½ã ãããï¼ç¬ãè¨ããªï¼ ãããï¼ã¾ãé»ãç»é¢ã£ã¦è¨ã£ã¦ãã...ï¼ å¾è¼©ã¡ãããLinuxã®ãã¹ãåå¤æ´ã³ãã³ãã ã¨ä¸æããããªãã£ããï½ã å¾è¼©ã¡ãããå¤æ´æ¹æ³ç¥ã£ã¦ã人ããªãããªï½((ï¾ï¾ï¾ï¾ã ããããåãã£ãããæãããã£ï¼ï¼ï¼ã ã¨ãããã¨ã§ãwsl2ã®ãã¹ãåå¤æ´æé ã説æãããã¨ã«ãªã£ãã wsl2ã®ãã¹ãåå¤æ´æ¹æ³ ããããå¾è¼©ã¡ããã®è¨ãéããwslã§ã¯ä¸è¨ã®ãããªè¡¨ç¤ºã«ãªããã ãããããã·ã³åã®ã¨ããããä»»æã®ãã¹ãåã«å¤æ´ãããå ´åãã ãããã/etc/wsl.confã«è¨è¼ããã®ãæ
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}