Please refer to here : https://learn.microsoft.com/en-us/windows/wsl/setup/environment

Korean : https://learn.microsoft.com/ko-kr/windows/wsl/setup/environment

Docker Desktop Installation

  1. Download the Docker Desktop
  2. Set Intel Virtualization Technology or SVM Mode (AMD) into Enabled in the BIOS
  3. Press “Win + S” → Type “Windows Features” → Open it.
  4. Check the following options:
  5. Install and set WSL2 as default version
wsl --install --no-distribution
wsl --set-default-version 2
  1. Install VcXsrv

Run the Docker

  1. Open cmd

  2. Download the Ubuntu Image or use Docker Desktop GUI

    #Pure Ubuntu
    docker pull {ubuntu:version}
    #For ROS2
    docker pull osrf/ros:<ros_version>-desktop-full
    
  3. Install Windows terminal in Microsoft Store

  4. Create and run a container from the image

    docker run --gpus all -it --name {container_name} -e DISPLAY=host.docker.internal:0.0 {image} bash
    
  5. Check that GPU is linked in the container

    apt update
    apt install -y pciutils
    lspci | grep -i nvidia
    nvidia-smi
    

DO NOT INTALL OTHER NVIDIA DRIVERS!

You can start created container by this:

docker start -ai {container_name}

You can exit the terminal by this: