Snapd broken in LXD container on WSL2
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Fix Released
|
Undecided
|
Edu Gómez Escandell |
Bug Description
This was the report that made me investigate:
https:/
The issue is that snapd correctly identifies that it is running on WSL, but cannot detect it is running on WSL2 so it falls back to thinking it is running on WSL1. The issue happens here:
https:/
In particular, this happens because WSL2 is detected by finding when the root filesystem is of type ext, but on LXC it is btrfs.
Once snapd thinks it is running on WSL1, it refuses to perform any action:
# snap list
Interacting with snapd is not yet supported on Windows Subsystem for Linux 1.
This command has been left available for documentation purposes only.
description: | updated |
Changed in snapd: | |
assignee: | nobody → Edu Gómez Escandell (edugomez) |
description: | updated |
Changed in snapd: | |
status: | In Progress → Fix Committed |
Changed in snapd: | |
status: | Fix Committed → Fix Released |
In order to replicate, start a distro in Ubuntu WSL2 with systemd enabled:
$ sudo lxd init # if necessary
...
$ sudo lxc launch ubuntu:jammy testcontainer
...
$ sudo lxc exec testcontainer -- bash
...
# apt update && apt upgrade snapd
...
# snap list
Interacting with snapd is not yet supported on Windows Subsystem for Linux 1.
This command has been left available for documentation purposes only.