PowerShell:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
PowerShell:
wsl --set-default-version 2
For example Ubuntu 18.04 LTS
For example VcXsrv.
Add to ~/.bashrc
(provide IP of your Windows host):
export DISPLAY=192.168.1.11:0
Download version 2.1.6.0 or search for latest.
Enable Enable the experimental WSL 2 based engine
on General
tab.
Enable your WSL distro on Resources
tab.
Bash:
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce
sudo gpasswd -a $USER docker
sudo mkdir /sys/fs/cgroup/systemd
sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd
sudo service docker start
Bash:
docker info
docker run hello-world
You can install systemd and snap on wsl2 and install docker for Linux as for native Linux os. See here: https://github.com/arkane-systems/genie
And here: https://forum.snapcraft.io/t/running-snaps-on-wsl2-insiders-only-for-now/13033