This is a cross-posting from WSL-2 issues
snapd shows up as unavailable inside WSL however snap appears to be working for me:
sudo snap install firefox
snap "firefox" is already installed, see 'snap help refresh'
mwoodpatrick@westie-k0s:~$ sudo snap refresh firefox
snap "firefox" has no updates available
systemctl says it’s running:
sudo systemctl status snapd
● snapd.service - Snap Daemon
Loaded: loaded (/lib/systemd/system/snapd.service; enabled; preset: enabled)
Active: active (running) since Sat 2023-02-25 06:49:52 PST; 35min ago
TriggeredBy: ● snapd.socket
Main PID: 323 (snapd)
Tasks: 22 (limit: 38340)
Memory: 93.1M
CGroup: /system.slice/snapd.service
└─323 /usr/lib/snapd/snapd
Feb 25 06:49:49 mlwphpenvy360 systemd[1]: Starting Snap Daemon...
Feb 25 06:49:51 mlwphpenvy360 snapd[323]: overlord.go:268: Acquiring state lock file
Feb 25 06:49:51 mlwphpenvy360 snapd[323]: overlord.go:273: Acquired state lock file
Feb 25 06:49:52 mlwphpenvy360 snapd[323]: daemon.go:247: started snapd/2.58.2 (series 16; classic; devmode; wsl) ubuntu/22.10 (amd>
Feb 25 06:49:52 mlwphpenvy360 snapd[323]: daemon.go:340: adjusting startup timeout by 1m5s (pessimistic estimate of 30s plus 5s pe>
Feb 25 06:49:52 mlwphpenvy360 snapd[323]: backends.go:58: AppArmor status: apparmor not enabled
Feb 25 06:49:52 mlwphpenvy360 systemd[1]: Started Snap Daemon.
Feb 25 07:20:30 mlwphpenvy360 snapd[323]: api_snaps.go:366: Installing snap "nvim" revision unset
Feb 25 07:22:26 mlwphpenvy360 snapd[323]: api_snaps.go:366: Installing snap "firefox" revision unset
Feb 25 07:23:06 mlwphpenvy360 snapd[323]: api_snaps.go:366: Installing snap "firefox" revision unset
However, I still see snap version reporting snapd is unavailable:
sudo snap version
snap 2.58.2
snapd unavailable
series 16
Windows Subsystem for Linux -
kernel 5.15.90.1-microsoft-standard-WSL2 (amd64)
My WSL version command reports:
wsl.exe --version
WSL version: 1.1.3.0
Kernel version: 5.15.90.1
WSLg version: 1.0.49
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22623.1325
When I try to create a snap I get the following error. Since I would really like to be able to create and use snaps on WSL-2 I would really like to understand what functionality is missing in WSL-2 to fix these issues
Support for ‘multipass’ needs to be set up. Would you like to do it now? [y/N]: y snapd is not logged in, snap install commands will use sudo multipass 1.11.0 from Canonical✓ installed Waiting for multipass… Launching a VM. warning: “–mem” long option will be deprecated in favour of “–memory” in a future release.Please update any scripts, etc. launch failed: multipass socket access denied Please check that you have read/write permissions to ‘/var/snap/multipass/common/multipass_socket’ An error occurred with the instance when trying to launch with ‘multipass’: returned exit code 2. Ensure that ‘multipass’ is setup correctly and try again. mwoodpatrick@westie-k0s:~/projects/git/westie-dev-pnpm/snaps/hello (13-nx-kubernetes)$ sudo snapcraft Running with ‘sudo’ may cause permission errors and is discouraged. Use ‘sudo’ when cleaning. Launching a VM. warning: “–mem” long option will be deprecated in favour of “–memory” in a future release.Please update any scripts, etc. [2023-02-25T08:21:28.988] [error] [dnsmasq] dnsmasq: failed to create inotify: Too many open files
[2023-02-25T08:21:28.990] [error] [dnsmasq] dnsmasq died: Process returned exit code: 5 [2023-02-25T08:21:28.990] [error] [dnsmasq] dnsmasq died: Process returned exit code: 5 [2023-02-25T08:21:28.990] [error] [dnsmasq] dnsmasq died: Process returned exit code: 5 launch failed: dnsmasq died: Process returned exit code: 5 An error occurred with the instance when trying to launch with ‘multipass’: returned exit code 2. Ensure that ‘multipass’ is setup correctly and try again.