Wednesday, February 7, 2024

Azure: Virtual Machines that support WSL

Azure Nested Virtualization Capable VMs

In order to run WSL and potentially Docker on an Azure Virtual Machine (VM) a VM's SKU Family must be hyper-threaded and be capable of running nested virtualization. The following link from Microsoft Learning, Azure compute unit (ACU), demarcates in a table all nested virtualization capable VMs by three asterisks: 

Azure WSL Capable VM Types

The Azure VM that are capable of supported WSL (a.k.a. capable of running nested virtualization) are as follow from Microsoft's article, Azure compute unit (ACU), provided that the vCPU: Core column contains three asterisks:



The following include several other VM types on which WSL can be installed:



Azure Subscription may not include WSL Capable VM Types

Be aware the not ever Microsoft subscription supports such Virtual Machines. For example the subscription that comes in a Visual Studio Subscription (the $150 free monthly Azure credit) might contain no virtual machines types that are nested virtualization capable.


Saturday, February 3, 2024

Docker: Fails on Windows Immediately After Install

Recently I installed Docker on a Windows 11 Pro laptop. Immediately after install I attempted to run a Docker image containing PowerShell. This image was run by invoking the following command from a PowerShell console:

docker run -it mcr.microsoft.com/powershell

The error returned by this command was:

docker: error during connect: this error may indicate that the docker daemon is not running: Post "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/create": open //./pipe/docker_engine: The system cannot find the file specified.
See 'docker run --help'.

The error above is clear "this error may indicate that the docker daemon is not running" which means I had forgotten to run Docker Desktop. Windows 11 Pro and Windows 10 Pro require Docket Desktop in order to run the Docker Engine.

I started Docker Desktop, reran the docker run command, and received a subsequent error:

docker: request returned Internal Server Error for API route and version http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/create, check if the server supports the requested API version.
See 'docker run --help'.

As engineers we all have our Home Simpson, "Duh" moments. When I actually looked at Docker Desktop, I saw the following:


I had failed to Accept the terms of service screen so the Docker Engine was not started. The lesson learned: After installing Docker Desktop on on Windows 10 Pro or Windows 11 Pro, run Docker Desktop and click on the Accept button.

I am very explicit about using Windows 11 Pro or previously Windows 10 Pro. The reason for this is that Windows 10 and Windows 11 can run Linux containers only with Docker installed. In order to run Windows containers, Windows 10 Pro or Windows 11 Pro is required.

In a previous blog, I noted a change I'd made (indirectly) to Docker's installation instructions for Docker Desktop on Windows, Install Docker Desktop on Windows. I created a PR in the documentation noting the importance of Windows Pro and the Docker documentation team added the following warning to their installation guide