Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snapd shows up as unavailable inside WSL #330

Open
1 task
kgkoutis opened this issue Nov 30, 2022 · 6 comments
Open
1 task

snapd shows up as unavailable inside WSL #330

kgkoutis opened this issue Nov 30, 2022 · 6 comments

Comments

@kgkoutis
Copy link

kgkoutis commented Nov 30, 2022

cmd /c ver

Microsoft Windows [Version 10.0.22621.819]

wsl --status

Default Distribution: Ubuntu
Default Version: 2

Did the problem occur during installation?

  • Yes

What happened?

Just after installing the Ubuntu image and configuring wsl.conf to allow systemd=true on boot, and following the steps here snap version shows snapd as unavailable

What was expected?

snapd should be read as the version 2.57.5+git955.g8ac464e (beta version)

Steps to reproduce

  1. Enable systemd support on WSL2 /etc/wsl.conf
[boot]
systemd=true
  1. Run these steps
$ sudo apt -y remove snapd --purge # This is the destructive action
$ sudo apt install -y snapd=2.55.3+22.04
$ sudo snap install snapd --beta   # Should install snapd (beta) 2.57.5+git955.g8ac464e
$ sudo snap refresh                # Validation: should not print the same as before
$ sudo apt upgrade snapd          # No need to stay in old version
  1. Verify that the version is not shown by
sudo snap version

Additional information

wsl --version

WSL version: 1.0.0.0
Kernel version: 5.15.74.2
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.819

cat /etc/wsl.conf

[boot]
systemd=true

cat %HOMEPATH%\.wslconfig

[wsl2]
memory=2GB

Additional screenshot

image

@kgkoutis
Copy link
Author

@EduardGomezEscandell, as mentioned here, we can continue the discussion on this ticket.

@EduardGomezEscandell
Copy link
Contributor

For the sake of completion, this info is also relevant:

systemctl is-system-running shows degraded and systemctl --failed shows systemd-sysusers.service failing

-- from #299 (comment)

@EduardGomezEscandell
Copy link
Contributor

Not sure what may be happening here, so let's try some stuff:

First of all, I see you're trying to follow these steps here #299 (comment). This is no longer necessary or useful. Simply do:

sudo apt -y update
sudo apt -y upgrade

Then reoboot the distro from powershell:

wsl --terminate Ubuntu

Print some more info to see if it helps.

systemctl status snapd
journalctl -b 1 -xeu snapd --no-pager

Some snaps still don't work (we're working on this :P), it may be the case with microk8s. Try to install a simpler one such as nvim. This'll probably fail but let's make it sure.

snap install nvim
snap run nvim --version

If you want to give up, you also have that option. Make a backup of all files you want to keep and uninstall the distro with wsl --unregister Ubuntu. Then you can re-install with ubuntu.exe.

@kgkoutis
Copy link
Author

kgkoutis commented Dec 1, 2022

@EduardGomezEscandell as expected:

image

For systemctl status snapd
image

And for journalctl -b 1 -xeu snapd --no-pager
image

And finally for nvim
image

@elcf
Copy link

elcf commented Jan 8, 2023

I'm having the same issue as here, word for word. The only differences is on mine:
WSL version: 1.0.3.0
Kernel version: 5.15.79.1
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.963

No %HOMEPATH%.wslconfig file.

snap version returns:
snap 2.57.6
snapd unavailable
series 16
Windows Subsystem for Linux -
kernel 5.15.79.1-microsoft-standard-WSL2 (amd64)

EDIT:
After a sudo snap refresh, I was able to run sudo snap install firefox. However, snap version still shows snapd unavailable.

@mwoodpatrick
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants