snapd failing under WSL, suddenly
"Interacting with snapd is not yet supported on Windows Subsystem for Linux."
This happens under snapd 2.57.4, and it’s kind of a long story.
Way back when, snapd implemented a test to see if it was running under WSL, but that test, it turned out, had a bug which meant that it only detected WSL 1, so for a very long time, you were able to get snapd working under WSL 2 if you fixed the prerequisites that stopped it from doing so.
(I don't think any of us who got snapd working even noticed the test was there.)
Then along came snapcore/snapd#12135, which fixed the WSL detection bug so the test actually worked, and snapd stopped working.
The good news is that WSL detection post that PR works by looking for /proc/sys/fs/binfmt_misc/WSLInterop
, so you can enable snapd at the cost of disabling Windows interop. (Note: not using the /etc/wsl.conf
method, because that leaves the binfmt in place; rather, as root, run
echo -1 >> /proc/sys/fs/binfmt_misc/WSLInterop
which removes the binfmt handler. Then restart all snapd services.)
The better news is that there's a PR which acknowledges this stuff over at snapcore/snapd#12179, which has been merged, so we should be good once snapd 2.57.5 hits.
The even better news is that the fix is already out in the snapd beta channel, so installing or refreshing the snapd snap by using the workaround above, then using one of the commands:
sudo snap install snapd —beta
or
sudo snap refresh snapd —beta
will fix the problem such that you don’t need to use the workaround any more. Then you can revert to non-beta snapd once the non-beta release with the fix comes out.