GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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 #5126

New issue
Copy link
New issue
Copy link
Closed
Closed
WSL2- Ubuntu 20.04 Snap store doesn't work due to systemd dependency#5126
Copy link
Labels
featuresystemd

Description

@penavincent
Vincent Pena (penavincent)
opened on Apr 24, 2020
Issue body actions

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.

  • 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

Activity

Next
  1. sirredbeard commented on Apr 24, 2020

    @sirredbeard
    Hayden Barnes (sirredbeard)
    on Apr 24, 2020
    Contributor
    More actions

    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
  2. jmoeyersons commented on Jun 2, 2020

    @jmoeyersons
    Jerico Moeyersons (jmoeyersons)
    on Jun 2, 2020
    More actions

    Is there any update about this issue available please?

  3. blackliner commented on Jun 6, 2020

    @blackliner
    Florian Berchtold (blackliner)
    on Jun 6, 2020
    More actions

    Here is the link to the scripted version of the workaround Hayden Barnes (@sirredbeard) mentioned: https://github.com/DamionGans/ubuntu-wsl2-systemd-script

    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
  4. jramiresbrito commented on Jun 8, 2020

    @jramiresbrito
    João Victor Ramires Guimarães Brito (jramiresbrito)
    on Jun 8, 2020
    More actions

    Running on same error when trying to run snaps to download heroku cli.

    Updates are welcome.

  5. fenris commented on Jun 17, 2020

    @fenris
    KHAIRUL AIZAT KAMARUDZZAMAN (fenris)
    on Jun 17, 2020
    More actions

    any update on this?

  6. mdtalhachy commented on Jul 3, 2020

    @mdtalhachy
    Talha Chowdhury (mdtalhachy)
    on Jul 3, 2020
    More actions

    Still not working. When I run snap version, this appears:

    snap 2.42.1+18.04
    snapd unavailable
    series -

  7. sunliusi commented on Jul 4, 2020

    @sunliusi
    sunliusi
    on Jul 4, 2020
    More actions

    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
  8. obeyda commented on Jul 17, 2020

    @obeyda
    Obeyda Djeffal (obeyda)
    on Jul 17, 2020
    More actions

    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
  9. adv27 commented on Aug 14, 2020

    @adv27
    Dinh-Anh Vu (adv27)
    on Aug 14, 2020
    More actions

    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
  10. troseman commented on Aug 14, 2020

    @troseman
    Todd Roseman (troseman)
    on Aug 14, 2020
    More actions

    That worked for me :), but i don't understand why, can anyone explain please?

    see https://discourse.ubuntu.com/t/using-snapd-in-wsl2/12113

    Reacted by Obeyda Djeffal, Yuming Feng, Bryan Hoang, Tadashi, Char2s茶兔司 (Charles), Valentyn Shtronda, Josias Leonardo Junior, Aleksandr and j_guo
  11. manuelvizir commented on Aug 26, 2020

    @manuelvizir
    Manuel Bertelli (manuelvizir)
    on Aug 26, 2020
    More actions

    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
  12. mahfuzullah commented on Sep 15, 2020

    @mahfuzullah
    mahfuzullah
    on Sep 15, 2020
    More actions

    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
  13. ride4sun commented on Sep 30, 2020

    @ride4sun
    ride4sun
    on Sep 30, 2020
    More actions

    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
  14. ethercflow commented on Oct 1, 2020

    @ethercflow
    Wenbo Zhang (ethercflow)
    on Oct 1, 2020
    More actions

    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
  15. SamLowryMOI commented on Oct 1, 2020

    @SamLowryMOI
    SamLowryMOI
    on Oct 1, 2020
    More actions

    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.

  16. 137 remaining items

  17. zstadler commented on Dec 10, 2022

    @zstadler
    zstadler
    on Dec 10, 2022
    More actions

    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:

    [boot]
    systemd=true
    
    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
  18. ArthurKun21 commented on Dec 13, 2022

    @ArthurKun21
    ArthurKun (ArthurKun21)
    on Dec 13, 2022
    More actions

    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:

    [boot]
    systemd=true
    

    can confirm this works!

    Reacted by linglongm, Marco Lazzarotto, Roland Leitenberger, Tony Lee, Cyberpie, Philip Sabri and Jason Jan Ngo
  19. LeCyberDucky commented on Dec 28, 2022

    @LeCyberDucky
    Andy (LeCyberDucky)
    on Dec 28, 2022
    More actions

    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
  20. faribauc commented on Dec 29, 2022

    @faribauc
    Christophe Faribault (faribauc)
    on Dec 29, 2022
    More actions

    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
  21. VaderFuntime commented on Jan 26, 2023

    @VaderFuntime
    Roey Kelner (VaderFuntime)
    on Jan 26, 2023
    More actions

    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:

    [boot]
    systemd=true
    

    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
  22. mustafa-guner commented on Mar 15, 2023

    @mustafa-guner
    Mustafa Guner (mustafa-guner)
    on Mar 15, 2023
    More actions

    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:

    [boot]
    systemd=true
    

    March 2023 - Still works like a charm! Thanks!

    Reacted by Feng
  23. zpeng2022 commented on Mar 27, 2023

    @zpeng2022
    zpeng2022
    on Mar 27, 2023
    More actions

    works! Thx a lot!

  24. fengzjin commented on Apr 1, 2023

    @fengzjin
    Feng (fengzjin)
    on Apr 1, 2023
    More actions

    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:

    [boot]
    systemd=true
    

    March 2023 - Still works like a charm! Thanks!

    It works, thanks a lot ❤️

  25. mmiric-endava commented on Apr 25, 2023

    @mmiric-endava
    Milos Miric (mmiric-endava)
    on Apr 25, 2023
    More actions

    Exited wsl and ran wsl --update in Powershell. Docker installed with snap after that with no issues.

    Reacted by shounendev
  26. krave1986 commented on Apr 26, 2023

    @krave1986
    krave1986
    on Apr 26, 2023
    More actions

    Milos Miric (@mmiric-endava) Do you have more info about wsl --update? Any docs maybe.

  27. mmiric-endava commented on Apr 26, 2023

    @mmiric-endava
    Milos Miric (mmiric-endava)
    on Apr 26, 2023
    More actions

    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
  28. mickdewald commented on May 7, 2023

    @mickdewald
    Michael Dewald (mickdewald)
    on May 7, 2023
    More actions

    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
  29. cbouwense commented on Jun 19, 2023

    @cbouwense
    Christian Bouwense (cbouwense)
    on Jun 19, 2023
    More actions

    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
  30. gal-dahan commented on Aug 11, 2023

    @gal-dahan
    Gal Dahan (gal-dahan)
    on Aug 11, 2023
    More actions

    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

  31. Diom commented on May 9, 2024

    @Diom
    Diom
    on May 9, 2024
    More actions

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featuresystemd

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.