Install Docker Desktop WSL2 and VS Code on Windows 11
Setup Windows 11: WSL2, Docker Desktop and VS Code
Goal
A Windows 11 laptop that can build and run the whole lab — with GUI simulation — without installing ROS2 natively.
What You Will Build
A working toolchain: WSL2 + Ubuntu 22.04 + Docker Desktop (WSL2 backend) + VS Code with the WSL and Dev Containers extensions.
Why This Matters
Most students run Windows. The WSL2 + Docker workflow is not a compromise: it is the same containerized workflow used in professional robotics development and in the Module 9 Jetson deployment. Learning it is course content, not setup tax.
Architecture Layer
Environment / tooling.
Files You Will Touch
- docs/windows_wsl2_setup.md — the full guide this lesson follows.
Files You Should Not Touch Yet
Everything else.
Commands
# PowerShell (Administrator)
wsl --install -d Ubuntu-22.04
wsl --version
wsl -l -v
# Inside the Ubuntu (WSL) terminal, after installing Docker Desktop
docker --version
docker compose version
docker run --rm hello-world
Step-by-Step Instructions
- Install WSL2 + Ubuntu 22.04 (
wsl --install -d Ubuntu-22.04), reboot if asked, create your Linux user. - Verify
wsl -l -vshows Ubuntu-22.04 as VERSION 2 (if 1:wsl --set-version Ubuntu-22.04 2). - Install Docker Desktop → Settings: enable WSL 2 based engine and WSL integration for Ubuntu-22.04.
- In the Ubuntu terminal run the three docker verification commands above.
- Install VS Code on Windows + extensions WSL and Dev Containers.
- From the Ubuntu terminal, run
code .once so VS Code installs its WSL server.
What You Should See
-
wsl --versionlists WSLg (that is your GUI pipeline — no X server to install). -
docker run --rm hello-worldprints "Hello from Docker!". - VS Code opens with a green "WSL: Ubuntu-22.04" badge in the corner.
How to Modify This for Your Own Application
This exact stack runs any ROS2 project. For your own future projects, the only thing you will swap is the repository you clone in Lesson 7 — keep this setup.
Common Mistakes
- Cloning repositories under
/mnt/c/...later — Lesson 7 will insist: clone inside the WSL filesystem (~). Slow builds and permission chaos live on/mnt/c. - Docker Desktop installed but WSL integration toggle off →
dockernot found inside Ubuntu. - Corporate laptops: virtualization disabled in BIOS/UEFI → WSL2 will not start; enable VT-x/AMD-V.
Checkpoint
All three docker commands succeed inside the Ubuntu terminal; VS Code connects to WSL.
Expected Output
A ready toolchain. Nothing lab-specific yet.
Next Step
07_clone_the_repo_and_run_lab_doctor.md
If you have any problem here remember that you have the full guide inside the repository: docs/windows_wsl2_setup.md
0 comments