-
Notifications
You must be signed in to change notification settings - Fork 821
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
WSL2- Ubuntu 20.04 Snap store doesn't work due to systemd dependency #5126
Comments
This is something that is being looked at. Implementing in a non-hacky way that can be supported long-term without a lot of secondary issues takes planning. There is a workaround to get snaps working. |
Is there any update about this issue available please? |
Here is the link to the scripted version of the workaround @sirredbeard mentioned: https://github.com/DamionGans/ubuntu-wsl2-systemd-script |
Running on same error when trying to run snaps to download heroku cli. Updates are welcome. |
any update on this? |
Still not working. When I run snap 2.42.1+18.04 |
just try: sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig snap version |
That worked for me :), but i don't understand why, can anyone explain please? |
Your script worked flawlessly, many thanks! |
see https://discourse.ubuntu.com/t/using-snapd-in-wsl2/12113 |
not working, always shows |
just login to your snap account/ ubuntu one account using |
I tried that on kali and it did not work. It basically kills the bash on the third command and I am back in the Powershell. |
Thanks! Works for me! ➜ ~ snap version
snap 2.46.1+20.04
snapd 2.46.1+20.04
series 16
ubuntu 20.04
kernel 5.8.3-microsoft-standard+ |
Works for me, too. But I get
Anyone knows why I get another kernel version (4.19.128-microsoft-standard instead 5.8.3-microsoft-standard+)? Using wsl2 on Windows 10 Home, 2004, Version 10.0.19041.508. |
@SamLowryMOI Oh, I compiled by myself to test BPF. |
@ethercflow Thanks! |
@mahfuzullah I had this problem. I executed |
I had the same problem in Pengwin under WSL2, but before it exits the shell, I get the following message:
However, running
When I run Any ideas? |
same problem |
Did you replace the placeholders with your values? You need to execute the first two commands. Then use top (or htop) to find out the PID of systemd and then use it to replace the $(pidof systemd) in the third command and replace $LOGNAME with your login name. |
@theofaron thanks for the Hack, |
Yes, I have tried it with the actual PID replacing the $(pidof systemd) and my username (rob) in place of the $LOGNAME. It had the same result. I also shutdown WSL 2 with |
I use this under Ubuntu 20.04.1 LTS. Maybe it doesn't work under Pengwin. Maybe you make a mistake. I'll show you my approach. Please reboot your pc to get a clean start point. I use the new terminal in windows. The first command shows some output, no errors, ends with 'done'. Ensure you use the right PID. After the second command use htop. Use F10 to filter the output. Type systemd. There are about eleven entries. Type a space (so you are filtering for 'systemd ', not for 'systemd'). Now there are only two entries. Use the pid for /lib/systemd/systemd. If you done it all right I can't help you, it seems to be a problem with Pengwin, sorry. |
https://github.com/arkane-systems/genie looks to be another workaround for this issue |
I have a strange problem, after running sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.targe my host name changed. It went from "TEST_server" to "TESTserver". What did I do wrong? |
The workaround doesn't work for me, I get stuck with the snap login, is there any solutions? |
I have
|
Looks like this is being discussed here: ubuntu/WSL#299 |
basically just to to the services registry and restart the LXSS |
For anyone having this issue, an official fix is out: |
Hi, I've use the way you mentioned in the link, but I still got the error:
what I have done:
I'm using windows 10 22H2 19045.2006 and ubuntu version is 20.04 LTS here is some info if needed: snap -info
snap version
|
I may be wrong, but as far as I understand it, this only works on Windows 11. |
Snap needs |
You need the store WSL version and you should use ubuntu 22.04 which works out of the box |
Hello,what you mean store WSL version ? here is the
|
Did you read this? |
oops, it seems that I need to upgrade to windows 11 after I read that post . thanks anyway |
Note that Ubuntu 22.04 still requires the whole |
When I tried to execute this command, [process exited with code 127 (0x0000007f)] |
Systemd support is now available in WSL! I followed the simple instruction in the above article, and My
|
can confirm this works! |
For what it's worth, I'm using Windows 10, build 19044.2364, and I was able to install Firefox via Snap after doing |
Confirming this works on Windows 10 :) |
Only thing that worked for me!! thanks! |
March 2023 - Still works like a charm! Thanks! |
works! Thx a lot! |
It works, thanks a lot ❤️ |
Exited wsl and ran |
@mmiric-endava Do you have more info about |
Yes, there are some details displayed by Update your WSL version to the latest version. Options include:
Essentially your wsl package is updated to the latest version. |
Important: |
I went through all the steps outlined on this article Systemd support is now available in WSL! and it did not work. However I was doing this from a VSCode terminal running WSL. I opened a "normal" wsl window and it worked like a charm (Windows 10). |
Hi everyone I try install k9s on WSL in that way: |
I also tried most of the solutions documented here. ^THIS prompted me, in a not very hopeful way, to try switching from |
I just reinstalled ubuntu on WSL2 from scratch in order to upgrade to 20.04 with a clean slate. The main issue I've noticed has to do with a lot of packages moving to snap rather than being maintained on apt, which is how I imagine most people here install their packages.
In fact it seems like Ubuntu 20.04 LTS replaced the ubuntu software with snapcraft entirely. So it's obvious snap is becoming the 'default' of the distro.
The issue is that snap doesn't currently seem to work on wsl2 due to it's reliance on systemd. If I understand it correctly, the snapd service should be running in the background for it to work, which snapd already comes preinstalled, however snapd can't start due to WSL2 not having systemd.
So if I run the command
snap find node
for example, it gives me the following error message:error: cannot communicate with server: Post http://localhost/v2/snaps/hello-world: dial unix /run/snapd.socket: connect: no such file or directory
Running the command
sudo service snapd start
simply responds with:snapd: unrecognized service
However snapd is already installed.
Is there any plan to get this working in the future, or is it something that is in progress?
In my development flow, I like to use the chromium-browser on WSL2 with the X410 server in order to test my web apps in both Windows and Linux browsers, since they can reveal some bugs, like say, when uploading csv files files from a Windows browser, React can't really tell since Windows changes the MIME Type of the file, whereas Linux and Mac keep it the same and so it's easy to handle.
Now I can't really use chromium though, since I can't install it without snap anymore.
EDIT: After several hours of trying to fix it I came across several other issues from about 8-10 months ago, with the most popular solution being this, which seems to make some changed to PIDs to make it work, but it just seems so hacky, and it's not a permanent solution, as a restart will remove it.
The text was updated successfully, but these errors were encountered: