Skip to content

Instantly share code, notes, and snippets.

@michalsen
Last active July 19, 2023 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michalsen/da9b227a0adb81dd4bcf1e3784e3456a to your computer and use it in GitHub Desktop.
Save michalsen/da9b227a0adb81dd4bcf1e3784e3456a to your computer and use it in GitHub Desktop.
Lando and Windows
# Installing Docker CE and Lando inside of WSL2
# This solution was found here: https://github.com/lando/lando/issues/1723
#=================================
# Install WSL2
#=================================
# Inside an Administrator session of PowerShell
wsl --install
# if the new install command does not prompt user creation:
sudo usermod -a -G sudo <username>
# change the default user
printf "\n[user]\ndefault=username\n" | sudo tee -a /etc/wsl.conf
# restart wsl from Windows PowerShell
wsl --shutdown
# WAIT AT LEAST 8 SECONDS
# then restart wsl and confirm the default user has changed
#=================================
# Install Docker CE inside of WSL2
#=================================
# Just Docker: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-22-04
# OR do what I did and install it along with ddev in one copy-paste command listed below (https://ddev.readthedocs.io/en/latest/users/install/ddev-installation/#wsl2-docker-ce-inside-install-script)
# From within PowerShell, run the following to install both DDEV and Docker CE inside of WSL2:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/ddev/ddev/master/scripts/install_ddev_wsl2_docker_inside.ps1'))
#=================================
# Download and Install Lando
#=================================
# Download the latest .deb release of Lando
https://github.com/lando/lando/releases
# If you don't already have access to Windows Downloads from within your WSL2, you can follow the steps here to add a command which, when run, will add the most recent download to your current directory in WSL2
https://superuser.com/a/1534333
# Run the following from within WSL2
# i.e. sudo dpkg -i --ignore-depends=docker-ce lando-x64-3.16.0.deb
sudo dpkg -i --ignore-depends=docker-ce lando-<version>.deb
# Check that it's installed
lando version
# If your computer fans start going crazy and vmmem is showing 95+% CPU usage, do the following:
# Open PowerShell as Administrator and run this command:
TASKKILL /IM "wslservice.exe" /F
# You're now safe to restart WSL2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment