GeezerVison is showing github.com — WSL2- Ubuntu 20.04 Snap store doesn't work due to systemd dependency · Issue #5126 · microsoft/WSL
WSL2- Ubuntu 20.04 Snap store doesn't work due to systemd dependency #5126DescriptionI 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.
- Windows Version: 10.0.19613.1000
- Ubuntu 20.04 WSL2
Reacted by bluesir, Van Tian, Daniel Kmak, Max Holmark, Ikiru Yoshizaki, Greg Dlugoszewski, John, Jerico Moeyersons, Eric Esquibel, Rene Vallecillo V and 306 more Reacted by jescoop, yapith and Jayce Reacted by Hassan DRAGA and Philip Orlando Activitysirredbeard commented on Apr 24, 2020 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. Reacted by Maciek Bryński, codebymikey, Hiroaki Nakamura, Matthieu S., Stiaan (Chris) Nel, dvghm, Ricardo Silva, kyongmin.noh, Arnav, Patrick Pissurno and 14 more jmoeyersons commented on Jun 2, 2020 Is there any update about this issue available please? blackliner commented on Jun 6, 2020 Reacted by Abhishek Srivastava, Kristian Pedersen, Mateusz Łoskot, Eze Campos, Simon Debbarma, Arpit-Gole, Hayden Barnes, ljiaxi, Daniel Stoyanoff, Kundan Baliga and 57 more Reacted by Matt, greg0r0, Eugene Bykov, Clay Dunston, utkuokur, kseshadri-crestron, Jonathan Hartman, Benoît Vinot, Leonardo Natera, Stefan Helmer and 4 more Reacted by Stiaan (Chris) Nel, Abhishek Srivastava, Mateusz Łoskot, Simon Debbarma, 西西吉, juniroc, Pablo Trindade (Mica), William Alexzander, franzonistefano, Manjeet Pardeshi and 2 more Reacted by Abhishek Srivastava, Simon Debbarma, Arpit-Gole, ljiaxi, Kundan Baliga, Riday ♡, Kersten, 西西吉, Chelsea Whipkey, Pranav Manoj and 16 more jramiresbrito commented on Jun 8, 2020 Running on same error when trying to run snaps to download heroku cli.
Updates are welcome. fenris commented on Jun 17, 2020 mdtalhachy commented on Jul 3, 2020 Still not working. When I run snap version, this appears:
snap 2.42.1+18.04
snapd unavailable
series - sunliusi commented on Jul 4, 2020 just try:
sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME
snap version Reacted by Obeyda Djeffal, Cody (Xuecheng) Zhang, Javier Villalba, Roxas King, Delon Wong Her Laang, AbstractFruitFactory, Robin Finkbeiner, Tyler Baur, Axel David Espinosa Meneses, Jingchao Hu and 720 more Reacted by wangxiao, John, Tobu-cloud9 [KamisakaKyota], DanielViglione, Artemiy Schukin, Cristian Hernandez, chenlexuan, Enzo Sanchez Croce, Carl Z, Laércio and 18 more Reacted by Alex Gathua, Grace Nikole , Ntokozo, Caihua Ye, Benjamin Saljooghi, Phan Dung Tri, Evgeny Rumyantsev, Pablo Trindade (Mica), ZKX, chronicideas and 38 more Reacted by AbstractFruitFactory, Manuel Zavala, AKBisMemory, memob0x, Isaiah Smith, Ankit Thakur, John Petitte, Mateusz Łoskot, Luciano Paciornick, Соснин Алексей and 138 more Reacted by Mehdi Hadeli, Hayden, HoangNguyen679, Rami-K-Youssef, Edgar Quintero, Noman Gul, Diego Leite, andreykonenkov, Ntokozo, haze. and 28 more Reacted by UFYLORD, Соснин Алексей, Naveen Narayanan, MZ, anoriqq, Kyle Awayan, Jonatan Orozco, Islam Jawhar, hddev, kinglionsz and 155 more Reacted by egcmi, Eder Ribeiro, Edgar Quintero, Steven Brix, Arthur, Diego Leite, Franck Adil Koumba, Michael Engel, Grace Nikole , Ntokozo and 76 more Reacted by KUMAKI Toshio, GJoe2, Ethan, fermicheung, Edgar Quintero, Diego Leite, Agustin Genes, Grace Nikole , Ntokozo, Benjamin Saljooghi and 39 more obeyda commented on Jul 17, 2020
just try:
sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME
snap version
That worked for me :), but i don't understand why, can anyone explain please? Reacted by Соснин Алексей, Bernhard Maier, 0x104, ngx3, Bjorn Runaker, Parth Gohil, ismailova-n, Franck Adil Koumba, Ahn Wooseon, Black Dragon and 39 more Reacted by Brian Horakh Reacted by furopi Reacted by furopi and HJ Hang Reacted by furopi and rintaroTakahashi Reacted by Isaiah Smith, Parth Gohil, Grace Nikole , Scott Beeker, Saúl de León Guerrero, Codegigi, furopi, Julis TAFITA, Guilherme Doval and José Francisco Antunes adv27 commented on Aug 14, 2020
just try:
sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME
snap version
Your script worked flawlessly, many thanks! Reacted by Gordon Moore, stubble2018, Bryan Hoang, yihe87, Gheorghe Avram, HJ Hang, SCP-079-Gleb, berlinfog, SayaAEP, mrmark-69 and 6 more troseman commented on Aug 14, 2020 Reacted by Obeyda Djeffal, Yuming Feng, Bryan Hoang, Tadashi, Char2s茶兔司 (Charles), Valentyn Shtronda, Josias Leonardo Junior, Aleksandr and j_guo manuelvizir commented on Aug 26, 2020 not working, always shows error: access denied (see 'snap help login') when trying to install or login Reacted by Renato Dinhani, Max Krou, Jorge Villada, Muhammad Ragib Hasin, lschulth, ALFonso6371, Saeed Zarinfam, gocs, Christopher (Cris) Fuhrman, Kundan Baliga and 28 more mahfuzullah commented on Sep 15, 2020
not working, always shows error: access denied (see 'snap help login') when trying to install or login
just login to your snap account/ ubuntu one account using snap login [email protected] command Reacted by Manuel Bertelli and Keith Harvey Reacted by lschulth, gocs, Kundan Baliga, Elias Soto, Johannes Kvamme, Robbie, Marcelo Augusto, Alyson, Marius Bosler, Chris Hamstead and 16 more Reacted by Kundan Baliga, Elias Soto, Marius Bosler, William Droz, Erwann Bernier, Kyoosik Lee and Xavier Belanche Alonso Reacted by mahfuzullah ride4sun commented on Sep 30, 2020
just try:
sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME
snap version
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.
Is there an official ETA to really fix that? Reacted by Rob Bernstein, kimc530, Kakit Law, Marius Bosler, Tamrat Belayneh, HoangHuy, John Nyingi, Anindya Vijayvargeeya, c01dc0ffee, Dario Thornhill and 13 more ethercflow commented on Oct 1, 2020
just try:
sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME
snap version
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+ Reacted by Cristian Hernandez, dvshin and shankari SamLowryMOI commented on Oct 1, 2020 Works for me, too. But I get
snap version
snap 2.46.1+20.04
snapd 2.46.1+20.04
series 16
ubuntu 20.04
kernel 4.19.128-microsoft-standard
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. zstadler commented on Dec 10, 2022 Reacted by Tony Lee, Roey Kelner, Aleksandr, Bobrokus, PiqueYo, Bechma, Artur Malinin, lego290, Johnathan Brown, NyanRus and 1 more Reacted by Aleksandr, Bobrokus, Gee, Jan Hoon, Johnathan Brown and NyanRus ArthurKun21 commented on Dec 13, 2022
Systemd support is now available in WSL!
I followed the simple instruction in the above article, and sudo snap install firefox worked like charm!
My /etc/wsl.conf file includes just 2 lines:
can confirm this works! Reacted by linglongm, Marco Lazzarotto, Roland Leitenberger, Tony Lee, Cyberpie, Philip Sabri and Jason Jan Ngo LeCyberDucky commented on Dec 28, 2022 For what it's worth, I'm using Windows 10, build 19044.2364, and I was able to install Firefox via Snap after doing wsl --update. Reacted by Thanush Krishna faribauc commented on Dec 29, 2022
For what it's worth, I'm using Windows 10, build 19044.2364, and I was able to install Firefox via Snap after doing wsl --update.
Confirming this works on Windows 10 :) Reacted by Andy, A Watkins, ookeowomartech and Thanush Krishna VaderFuntime commented on Jan 26, 2023
Systemd support is now available in WSL!
I followed the simple instruction in the above article, and sudo snap install firefox worked like charm!
My /etc/wsl.conf file includes just 2 lines:
Only thing that worked for me!! thanks! Reacted by GRadziejewski, Shaul Fridman, Kevin BERTRAND, Alison Jo, minoseah629, Mustafa Guner, Matt Rice, Andreas Opferkuch, Diego Oliveira, FyiurAmron and 1 more mustafa-guner commented on Mar 15, 2023
Systemd support is now available in WSL!
I followed the simple instruction in the above article, and sudo snap install firefox worked like charm!
My /etc/wsl.conf file includes just 2 lines:
March 2023 - Still works like a charm! Thanks! zpeng2022 commented on Mar 27, 2023 fengzjin commented on Apr 1, 2023
Systemd support is now available in WSL!
I followed the simple instruction in the above article, and sudo snap install firefox worked like charm!
My /etc/wsl.conf file includes just 2 lines:
March 2023 - Still works like a charm! Thanks!
It works, thanks a lot ❤️ mmiric-endava commented on Apr 25, 2023 Exited wsl and ran wsl --update in Powershell. Docker installed with snap after that with no issues. krave1986 commented on Apr 26, 2023 mmiric-endava commented on Apr 26, 2023
Milos Miric (@mmiric-endava) Do you have more info about wsl --update? Any docs maybe.
Yes, there are some details displayed by wsl --help and on Microsoft docs as well:
Update your WSL version to the latest version. Options include:
--web-download: Download the latest update from the GitHub rather than the Microsoft Store.
Essentially your wsl package is updated to the latest version. Reacted by krave1986 Reacted by krave1986 mickdewald commented on May 7, 2023 Important:
Do not forget to exit wsl via wsl --shutdown after editing /etc/wsl.conf
Just exiting wsl via exit and entering via wsl is not enough Reacted by Shawn Z, Diom, Carl-Erik Kopseng and Param Siddharth cbouwense commented on Jun 19, 2023 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). Reacted by Diom and Param Siddharth gal-dahan commented on Aug 11, 2023 Hi everyone I try install k9s on WSL in that way:
curl -LO https://github.com/derailed/k9s/releases/latest/download/k9s_Linux_x86_64
I go to /etc/wsl.conf and i have
[boot] systemd=true
after that, I do the command
k9s
and I get:
/usr/local/bin/k9s: 1: Not: not found Diom commented on May 9, 2024
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).
I also tried most of the solutions documented here. ^THIS prompted me, in a not very hopeful way, to try switching from Windows Terminal + Pwsh + wsl to use the WSL console.... and it worked. I am not sure how I feel about it.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|