Hyper-V socket connection issue while using Rancher Desktop with WSL2

I recently switched from Docker Desktop to Rancher Desktop, and I’m facing frequent connection issues. These errors occur when onboarding local images like Localstack, TIDB, or even after they’ve been successfully added.

The error I receive is:
Error response from daemon: failed to connect to the backend: could not dial Hyper-V socket: connect(cf98ec16-9817-4809-8c74-82b99fbe3532:016a6eb7-facb-11e6-bd58-64006a7986d3) failed: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

This issue can pop up at any time while I’m starting up multiple images or even after they’ve been loaded successfully.

Here’s a bit about my current setup:

  • Rancher Desktop 1.19.3
  • WSL2 with Ubuntu-24.04
  • Using dockerd for the container engine
  • Kubernetes is disabled
  • WebAssembly (Wasm) features are disabled

When checking the docker context, it displays:
NAME DESCRIPTION DOCKER ENDPOINT ERROR default * Current DOCKER_HOST based configuration npipe:////./pipe/docker_engine

In WSL, the status of my distributions is:
NAME STATE VERSION Ubuntu-24.04 Stopped 2 rancher-desktop-data Stopped 2 rancher-desktop Stopped 2

I’ve tried the following commands, but they haven’t resolved the issue:

  • dism.exe /online /enable-feature /featurename:Microsoft-Hyper-V-All /all /norestart
  • dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
  • dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Any thoughts on what could be causing this socket connection problem?

I had the same Hyper-V socket timeouts after switching to Rancher Desktop. Turns out Windows Defender was blocking the named pipe communications between WSL2 and Windows. Fixed it by adding exclusions for Rancher Desktop’s install folder and WSL2 VM files. Also helped to run wsl --shutdown then restart Rancher Desktop for a fresh connection. Since all your WSL distros show “Stopped,” the WSL service might be the issue - try wsl --update and make sure Windows is current. Older WSL2 kernels had problems with named pipes under heavy container loads.

interesting that all your wsl distros are stopped. are you running rancher desktop from windows or inside wsl? have you tried switching the backend from dockerd to containerd? sometimes the hyper-v socket gets confused when multiple container runtimes fight over the same pipes. what happens if you manually start ubuntu-24.04 first?

check for overlapping network configs between rancher and leftover docker desktop stuff. i switched recently and got the same socket errors until i cleaned out old docker configs in %appdata% and switched rancher to moby engine instead of dockerd. try running rancher as admin too - named pipe permissions often break on fresh installs.