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

Out of the box Snap support #618

Closed
Hebilicious opened this issue Jul 10, 2020 · 20 comments
Closed

Out of the box Snap support #618

Hebilicious opened this issue Jul 10, 2020 · 20 comments
Labels
Implemented Been there. Done that.

Comments

@Hebilicious
Copy link

Hebilicious commented Jul 10, 2020

Is your feature request related to a problem? Please describe.
snap requires systemctl wich isn't working yet in wsl (wsl issue here).

Describe the solution you'd like
A more wsl-y solution will hopefully be provided my the wsl team soon. In the meantime it would be nice to have a workaround implemented in Pengwin.

Describe alternatives you've considered
There's some workarounds, check the WSL issues. An out of the box solution would be ideal.

Additional context
//

@crramirez
Copy link
Collaborator

Thank you for your suggestion we are working on something. But for Fedora Remix, so now we know that Pengwin users would like to have it also

@Hebilicious
Copy link
Author

@crramirez Thanks for the quick reply, do you have a rough timeline ?

@crramirez
Copy link
Collaborator

No more than the end of the year, probably in two months

@crramirez crramirez added the To Implement This is something we should implement. label Aug 6, 2020
@crramirez
Copy link
Collaborator

Hello,

I recommend you to assist WSLConf. Will be a talk about snaps in WSL

Regards

@Peredery
Copy link

Peredery commented Nov 4, 2020

Is it still in WIP?

@crramirez
Copy link
Collaborator

Hello @Peredery,

Yes, we are still working on that but it will take more time to release a beta.

Regards,
Carlos

@kotx
Copy link

kotx commented Jun 25, 2021

Any update on this?

@crramirez
Copy link
Collaborator

Hello @kotx,

Sadly no. But the fact that you ask for it, raises its priority.

Regards,
Carlos

@crramirez crramirez added Implemented Been there. Done that. and removed To Implement This is something we should implement. labels Nov 20, 2022
@crramirez
Copy link
Collaborator

Hello @kotx @Hebilicious @Peredery

The lastest version of Pengwin 22.11.4 includes an implementation of SystemD regardless you are in Windows 10 or 11. It can enabled via pengwin-setup

@flexchar
Copy link

I've tried installing snap using sudo apt install snapd. It went through. Then I wanted to snap install hugo but I get:

error: cannot communicate with server: Post "http://localhost/v2/snaps/hugo": dial unix /run/snapd.socket: connect: no such file or directory

I'm on

> lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Pengwin
Release:        11
Codename:       bullseye

Could someone clarify how I could use this feature? :)

@crramirez
Copy link
Collaborator

Hello @flexchar

Did you enabled systemd via pengwin-setup?

Regards

@flexchar
Copy link

flexchar commented Jan 2, 2023

Yep, I've just done it. And tried reinstalling snap but I'm sitting on the same error.

I can see it tried to create service but then it's not found.

lukas in ~ λ sudo apt install snapd
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
  zenity | kdialog
The following NEW packages will be installed:
  snapd
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 13.3 MB of archives.
After this operation, 56.5 MB of additional disk space will be used.
Get:1 https://deb.debian.org/debian bullseye/main amd64 snapd amd64 2.49-1+deb11u2 [13.3 MB]
Fetched 13.3 MB in 12s (1,155 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package snapd.
(Reading database ... 130377 files and directories currently installed.)
Preparing to unpack .../snapd_2.49-1+deb11u2_amd64.deb ...
Unpacking snapd (2.49-1+deb11u2) ...
Setting up snapd (2.49-1+deb11u2) ...
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.recovery-chooser-trigger.service → /lib/systemd/system/snapd.recovery-chooser-trigger.service.
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.seeded.service → /lib/systemd/system/snapd.seeded.service.
Created symlink /etc/systemd/system/cloud-final.service.wants/snapd.seeded.service → /lib/systemd/system/snapd.seeded.service.
Unit /lib/systemd/system/snapd.seeded.service is added as a dependency to a non-existent unit cloud-final.service.
Created symlink /etc/systemd/system/multi-user.target.wants/snapd.service → /lib/systemd/system/snapd.service.
Created symlink /etc/systemd/system/sockets.target.wants/snapd.socket → /lib/systemd/system/snapd.socket.
Processing triggers for man-db (2.10.1-1~bpo11+1) ...
Processing triggers for dbus (1.12.24-0+deb11u1) ...
Processing triggers for desktop-file-utils (0.26-1) ...
lukas in ~ λ service snap status
snap: unrecognized service
lukas in ~ λ service snapd status
snapd: unrecognized service
lukas in ~ λ service --status-all
 [ - ]  apparmor
 [ - ]  dbus
 [ ? ]  hwclock.sh
 [ - ]  procps
 [ - ]  rsync
 [ - ]  ssh
 [ - ]  sudo
 [ + ]  udev
 [ - ]  unattended-upgrades
 [ - ]  x11-common

@crramirez
Copy link
Collaborator

sudo systemctl enable --now snapd

@flexchar
Copy link

flexchar commented Jan 3, 2023

sudo systemctl enable --now snapd
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

I realized during pengwin-setup I get this:
image

If you want to start services in WSL1 you can use the "service" or the "wslsystemctl" commands.

that may give any clue.

Okay, I also ran wsl version:

lukas in ~ λ wsl.exe -v
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

I strongly believe I installed WSL 2 and I know for a fact that I'm running Win 11. I'm rather confused how these values exist since I've done a fresh WSL install after upgrading to Win 11... I guess I got some debug to do here

I'm confused. Any ideas? :)
image

@crramirez
Copy link
Collaborator

Somethung is completely wrong in your pengwin installation that the Interop is not running.

Anyway, to enable systemd add

[boot]
systemd=true

To your /etc/wsl.conf file then wsl --terminate WLinux

And try again to start snapd

@flexchar
Copy link

flexchar commented Jan 3, 2023

Damn, given your support, you should totally charge more for this distro. I appreciate it!!

That being said, still not going through. I've also shut off docker in case it was messing up and ran wsl --shutdown.

> sudo systemctl enable --now snapd
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

Meanwhile, to be respectful of your time, perhaps I should just dedicate time to wipe it all and do a fresh install. ;)

@crramirez
Copy link
Collaborator

crramirez commented Jan 3, 2023

You are very welcome! :-D

Considering the WSL version you sent, the systemd should already be working.

I you haven't wiped it all, could you please send me the content of your /etc/wsl.conf ?

Also, the content of $HOME/winhome/.wslconfig

@flexchar
Copy link

flexchar commented Jan 3, 2023

Absolutely!

lukas in ~ λ cat $HOME/winhome/.wslconfig
[wsl2]
memory=25GB
swap=0
localhostForwarding=true

[boot]
systemd=true
lukas in ~ λ cat /etc/wsl.conf
[automount]
enabled = true
options = "metadata,uid=1000,gid=1000,umask=0022,fmask=11,case=off"
mountFsTab = true
crossDistro = true

[network]
generateHosts = true
generateResolvConf = true

[filesystem]
umask = 0022

[user]
default=lukas

@crramirez
Copy link
Collaborator

Ok remove

[boot]
systemd=true

from $HOME/winhome/.wslconfig and add it to /etc/wsl.conf. Then terminate the distro, you should have systemd now.

I still don't see signals why pengwin-setup thinks that you are in WSL1. Could you please echo $WSL_INTEROP?

@flexchar
Copy link

flexchar commented Jan 3, 2023

It was the same. But since my vs code began hanging I decided to restart PC. It happens couple times a month. And after a reboot it worked. So it may have had worked all along if I've tried restarting it haha.

Oh, and I'll share all env variables with you:

lukas in ~ λ env | grep WSL
WSL2_GUI_APPS_ENABLED=1
WSLENV=WT_SESSION::WT_PROFILE_ID
WSL_INTEROP=/run/WSL/269_interop
WSL_DISTRO_NAME=WLinux
WSL_HOST_IP=172.19.224.1

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

No branches or pull requests

5 participants