Install Ubuntu on Windows subsystem using WSL2 technology
Install WSL2
Reference: Manual installation steps for older versions of WSL
Enabling the Windows subsystem for Linux
Open PowerShell as administrator (Start menu > PowerShell > right-click > Run as administrator) and enter the following command:
|
|
Start the virtual machine function
Open PowerShell as administrator and run:
|
|
Restart the computer
Download the Linux kernel update package and install it
Download address 1 (Microsoft official website download): Linux kernel update packages
Download address 2 (csdn download): Linux kernel update packages
Run the downloaded update package. (Double click to run - you will be prompted to elevate privileges, select “Yes” to approve this installation.)
Set WSL2 as the default version
Open PowerShell and run the following command to set WSL 2 as the default version when installing a new Linux distribution:
|
|
Install Ubuntu and install docker and docker-compose
Install Ubuntu Reference: https://docs.microsoft.com/en-us/windows/wsl/install-manual
Install Docker Reference: https://www.runoob.com/docker/ubuntu-docker-install.html
Install Docker-Compose Reference: https://linuxhostsupport.com/blog/how-to-install-and-configure-docker-compose-on-ubuntu-20-04/
Open the Microsoft Store and select the Ubuntu version to download
Wait for the automatic installation to succeed
Start Ubuntu and wait for it to install automatically
After setting the username and password, enter the Ubuntu system
Install Docker
Use th daocloud one-click installation command:
The installation command is as follows:
|
|
Wait for successful installation
Start the docker service command
|
|
Check if the installation is successful command
|
|
The installation of Ubuntu Docker is successful when the following is displayed
Install docker-compose
Update the apt-get command:
|
|
Install the docker-compose command:
|
|
Enter y in the middle to enter
Installation complete!