- Creating an ubuntu VM in azure
- Installing a GUI and reconnecting via RDP
- Installing sys reqs for Docker Desktop
- Installing Docker Desktop
| # https://nickjanetakis.com/blog/install-docker-in-wsl-2-without-docker-desktop | |
| # Install Docker, you can ignore the warning from Docker about using WSL | |
| curl -fsSL https://get.docker.com -o get-docker.sh | |
| sudo sh get-docker.sh | |
| # Add your user to the Docker group | |
| sudo usermod -aG docker $USER | |
| # Install Docker Compose v2 |
Here's an easy method which allows you to install multiple instances of any Linux Distro in any location under WSL2.
** Click on each heading to reveal instructions **
If you HAVEN'T installed WSL2 prior to this, open up a Powershell terminal and execute the following commands:
| # | |
| # Automatically generated file; DO NOT EDIT. | |
| # Linux/arm64 5.15.90.1 Kernel Configuration | |
| # | |
| CONFIG_CC_VERSION_TEXT="gcc (GCC) 12.2.1 20221121 (Red Hat 12.2.1-4)" | |
| CONFIG_CC_IS_GCC=y | |
| CONFIG_GCC_VERSION=120201 | |
| CONFIG_CLANG_VERSION=0 | |
| CONFIG_AS_IS_GNU=y | |
| CONFIG_AS_VERSION=23800 |
| # start docker - this is a helper script created to start docker as wsl2 doesn't use systemd | |
| docker-start | |
| ping github.com | |
| # why a ping here? emperiically I've determined this has to occur | |
| # otherwise for me the docker daemon messes up dns. | |
| # don't know why, ymmv | |
| wget https://gist.githubusercontent.com/ArturKlauser/0f0293c62f5626df0261ac994d8a46af/raw/d5863dfc22e6d65fd912c9ec760dcdc86ea320cc/check-qemu-binfmt.sh | |
| chmod +x check-qemu-binfmt.sh |
Setup Docker to run on Windows 11 & Ubuntu WSL2 AND still be able to use Docker Desktop to monitor the lot!!
The goal here is to set up a container cluster using WSL2, Ubuntu Linux, and other Open Source packages. The secondary goal being to be able to use it from both Linux and Windows AND to be able to still use Docker Desktop under either Windows or Linux to manage things.
To do so, we need to setup WSL2, Ubuntu, dockerd and containterd, then build docker-cli for Windows and finally wire them all together so they can talk to each other.
First you need to set up Windows so that you can use virtualised containers, as well as WSL2. Type the following in a terminal:
| cp Microsoft/config-wsl .config | |
| sed -i 's/# CONFIG_KVM_GUEST is not set/CONFIG_KVM_GUEST=y/g' .config | |
| sed -i 's/# CONFIG_ARCH_CPUIDLE_HALTPOLL is not set/CONFIG_ARCH_CPUIDLE_HALTPOLL=y/g' .config | |
| sed -i 's/# CONFIG_HYPERV_IOMMU is not set/CONFIG_HYPERV_IOMMU=y/g' .config | |
| sed -i '/^# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set/a CONFIG_PARAVIRT_CLOCK=y' .config | |
| sed -i '/^# CONFIG_CPU_IDLE_GOV_TEO is not set/a CONFIG_CPU_IDLE_GOV_HALTPOLL=y' .config | |
| sed -i '/^CONFIG_CPU_IDLE_GOV_HALTPOLL=y/a CONFIG_HALTPOLL_CPUIDLE=y' .config | |
| sed -i 's/CONFIG_HAVE_ARCH_KCSAN=y/CONFIG_HAVE_ARCH_KCSAN=n/g' .config | |
| sed -i '/^CONFIG_HAVE_ARCH_KCSAN=n/a CONFIG_KCSAN=n' .config | |
| make -j 8 |
| # | |
| # Automatically generated file; DO NOT EDIT. | |
| # Linux 5.x Kernel Configuration | |
| # | |
| CONFIG_CC_VERSION_TEXT="aarch64-msft-linux-gcc (GCC) 9.3.0" | |
| CONFIG_CC_IS_GCC=y | |
| CONFIG_GCC_VERSION=90300 | |
| CONFIG_LD_VERSION=234000000 | |
| CONFIG_CLANG_VERSION=0 | |
| CONFIG_LLD_VERSION=0 |
| # Inside WSL... | |
| # Install virt-manager | |
| sudo apt install -y virt-manager | |
| # Add youself to kvm and libvirt group | |
| sudo usermod --append --groups kvm,libvirt "${USER}" | |
| # Fix-up permission to avoid "Could not access KVM kernel module: Permission denied" error | |
| sudo chown root:kvm /dev/kvm |