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

Not working on Ubuntu 20.04 on WSL2 #71

Open
tig opened this issue Oct 15, 2020 · 1 comment
Open

Not working on Ubuntu 20.04 on WSL2 #71

tig opened this issue Oct 15, 2020 · 1 comment

Comments

@tig
Copy link

tig commented Oct 15, 2020

sudo snap install powershell --classic
sudo snap install powershell-preview --classic

I just installed Ubuntu on WSL2 via the Windows Store and neither of these commands are working:

tig@valdez:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04
Codename:       focal
tig@valdez:~$ do-release-upgrade
Checking for a new Ubuntu release
There is no development version of an LTS available.
To upgrade to the latest non-LTS development release
set Prompt=normal in /etc/update-manager/release-upgrades.
tig@valdez:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
tig@valdez:~$ sudo snap install powershell --classic
error: cannot communicate with server: Post http://localhost/v2/snaps/powershell: dial unix /run/snapd.socket: connect: no such file or directory
tig@valdez:~$ sudo snap install powershell-preview --classic
error: cannot communicate with server: Post http://localhost/v2/snaps/powershell-preview: dial unix /run/snapd.socket: connect: no such file or directory

What am I missing?

@lucyllewy
Copy link

Hi, @tig

The out-of-the-box Ubuntu installation is unable to run snapd and therefore you are unable to issue snap commands to install or run Snap Packages. This is because WSL and WSL2 cannot run the snapd requirement of systemd due to Microsoft's init process being "in the way" (systemd requires to be executed as ProcessID 1 but the Microsoft init has that process ID). For WSL (not WSL2) that is the end of the story. However, on WSL2 you can hack it to run systemd inside a container, and therefore be able to use Snap Packages. I maintain one of several similar projects at https://github.com/diddledani/one-script-wsl2-systemd (I've also linked to other projects that I know about in the readme there).

Due to these issues being WSL itself as the problem I recommend that this ticket be closed without a fix.

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

2 participants