The specific error message—rpc error failed to ensure virtiofs plan9 mount bad address—is a bit of a “mismatched puzzle piece” error.
It usually pops up in containerized environments (like Kubernetes or Docker Desktop) or virtualization layers (WSL2, QEMU/KVM) when the system tries to bridge the host filesystem to a guest/container.
The core of the issue is usually a communication breakdown between the VirtioFS driver and the 9P (Plan 9) protocol.
Common Root Causes
-
Stale Mount Points: If a previous session crashed or didn’t unmount correctly, the “address” the RPC (Remote Procedure Call) is looking for is occupied or dead.
-
WSL2 Backend Issues: If you are using Docker Desktop on Windows, this often happens after a sleep/hibernate cycle where the WSL2 utility VM loses its connection to the Windows host drive.
-
Kernel/Driver Mismatch: The guest OS is trying to use
virtiofsbut the host or the VM configuration is falling back to9p, causing a protocol “bad address” conflict.
How to Fix It
1. The “Cold Boot” (Most Effective for Docker/WSL users)
If you are seeing this on Docker Desktop or WSL2, the internal bridge has likely hung.
-
Restart Docker Desktop: Right-click the tray icon and select “Restart.”
-
Restart WSL: Open PowerShell and run:
wsl --shutdownThen, relaunch your terminal or Docker. This forces the RPC addresses to re-register.
2. Check the Mount Path
The “bad address” can literally mean the path on your host machine no longer exists or permissions have changed.
-
Ensure the folder you are trying to mount (e.g.,
/Users/name/project) actually exists. -
If you recently moved the folder or renamed a parent directory, the RPC call will fail because the pointer is invalid.
3. Toggle the File Sharing Implementation
In Docker Desktop settings, you can often choose how files are shared. If one is failing, the other usually works:
-
Go to Settings > General (or Software Updates in some versions).
-
Switch between VirtioFS and gRPC FUSE.
-
Note: VirtioFS is faster, but gRPC FUSE is often more stable on older hardware or specific Windows builds.
4. Clear the Container Cache
If this is happening during a docker-compose up, the build cache might be holding onto a faulty mount configuration.
docker-compose down
docker system prune # Warning: this removes unused data
Why “Plan 9”?
For a bit of context: Plan 9 is an old network protocol used to share files between different operating systems. VirtioFS is the modern, faster successor. When you see both mentioned in one error, it means the system tried the new way, failed, tried to fallback to the old way, and finally gave up because it couldn’t find a valid communication socket (“Bad Address”).
Be the first to comment