For the time being, I will leave what I did roughly
--Windows update --Installing Ubuntu from Microsoft Store --Upgrade to WLS2 --Installing Docker for Windows
Enter ** run **, ** winver ** in [Win + R] At this stage, ** Docker for Windows cannot be installed if the version is ** 19018 or lower **. ** **
That's why I will update Windows itself. Windows 10 May 2020 Update
** Download the update from the [Update now] ** button.
The ** Windows10Upgrade9252.exe ** file will be downloaded, click it to launch it.
I forgot to capture the progress on the way, but it will be completed in about 30 minutes after starting, and you will be asked to restart.
When I checked the version after rebooting, it became ** 19041 **
Originally I haven't used WSL properly after a long time using Windows, so even if I try to start wsl, it will be as follows.
So, install Linux (Ubuntu) from the Microsoft Store.
Start the Microsoft Store.
Select Ubuntu 20.04.LTS. It's okay to have your favorite Linux here.
Click Install.
Click the launch button when the installation is complete.
When you start it, a terminal will open, so set the username and password.
This is the end of Ubuntu settings.
Start PowerShell as ** Administrator **.
You can check the function of Windows with the following command
dism.exe /online /get-features
Check if the following two are ** enabled ** when executing the command
Function name: Microsoft-Windows-Subsystem-Linux
Status:Effectiveness
Function name: VirtualMachinePlatform
Status:Effectiveness
If not, enable it with the following command
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Check your installed Linux distribution.
wsl --list --verbose
NAME STATE VERSION
* Ubuntu-20.04 Running 1
Since it is Version 1 now, I will raise it to Version 2 with a command, but if I do it as it is ** Kernel component updates are required to run WSL 2 ** I will be told, so I will update the Linux cannel.
Access the following page to download the package. Update WSL 2 Linux Kernel
The ** wsl_update_x64 ** file will be downloaded, click it to launch it.
Press [Next]
Press [Finishi] to complete.
Update Ubuntu to WSL2 with the following command
wsl --set-version Ubuntu-20.04 2
Check the distribution.
wsl --list --verbose
NAME STATE VERSION
* Ubuntu-20.04 Running 2
It has changed.
Change the default version from WSL to WSL2
wsl --set-default-version 2
Originally I wanted to do this. It's been a detour, but it's coming to install.
The ** Docker Desktop Installer ** file will be downloaded, click it to launch it.
** [OK] ** to proceed
Installation will proceed
Done, log out with ** [Close and log out] ** At this time, it will take a reboot
After restarting, it was the setting screen of Docker for windows, but honestly I only use Docker commands, so I skipped it.
For the time being, it is resident in the following location during startup, and the screen can be opened from the Dashboard.
It was long anyway. I've heard that Docker for Windows is annoying, but so far ... However, I think it's better that Docker's execution environment is Ubuntu after WSL2.
So, I will do what I really wanted to do.
I'm surprised that there are more people who have seen it than I expected. Thank you for the rough content I will add something that I was a little worried about while using it.
There are quite a few timings to restart. For example, the time of launching ** Ubuntu may be quite different. ** ** This is already on the Issue, so it will be cured soon.
There are various ways to fix this time lag, but the quickest way is to restart, so here is the restart command.
wsl.exe --shutdown
** Run with elevated Powershell. ** **
As you can see in the task manager, a task called ** Vmmem ** eats up memory. This issue also has Issue.
I think it will be fixed soon, but Issue has suggested a workaround now.
For the time being, 1 is omitted, and the certainty is high. Use the other two at ** just to try and see **.
*** Create a file called *** .wslconfig
in the Windows user directory (C: \ Users \
[wsl2]
memory=2GB
swap=16GB
localhostForwarding=true
hisayuki@DESKTOP:~/develop/annowork_devlop$ free -h
total used free shared buff/cache available
Mem: 1.9Gi 1.7Gi 63Mi 0.0Ki 169Mi 92Mi
Swap: 16Gi 326Mi 15Gi
The effect is quite sparse when looking at the Issue, but this is also a solid effect. This time it is suppressed by 2G, and the task manager side is not at the moment more than 2G.
Use the following command to clear unnecessary cache and free memory.
echo "sync && echo 3 > /proc/sys/vm/drop_caches" | sudo sh
This is also a feeling, so there is no definite factor. In addition, if you run Docker for windows on Ubuntu or actually run Container, it will increase after all.
Recommended Posts