DamionGans / ubuntu-wsl2-systemd-script

[Does not work anymore!] Script to enable systemd support on current Ubuntu WSL2 images
1.56k stars 382 forks source link

snap gets broken after first run #48

Closed pablorq closed 3 years ago

pablorq commented 3 years ago

Snap is having a weird behavior. It works well the 1st time you run ubuntu-wsl2-systemd-script, but after reboot the distro it gets broken.

Steps to reproduce:

The error is

$ sudo snap install inkscape
error: cannot perform the following tasks:
- Run configure hook of "inkscape" snap if present (run hook "configure": cannot perform operation: mount --rbind /dev /tmp/snap.rootfs_7dlI1W//dev: No such file or directory)

All the steps described before are done without restart the Windows session.

You can delete de distribution and reinstall it, with the same result?

Any idea how to solve it?

pablorq commented 3 years ago

Detailed data:

First run after ubuntu-wsl2-systemd-script installed

>wsl
Sleeping for 1 second to let systemd settle
Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 4.19.128-microsoft-standard x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon Nov 30 10:04:21 CET 2020

  System load:  0.32               Processes:             34
  Usage of /:   0.5% of 250.98GB   Users logged in:       0
  Memory usage: 1%                 IPv4 address for eth0: 192.168.20.172
  Swap usage:   0%

14 updates can be installed immediately.
3 of these updates are security updates.
To see these additional updates run: apt list --upgradable

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

Processes running and mount output:

$ ps -ef
UID          PID    PPID  C STIME TTY          TIME CMD
root           1       0  3 10:04 ?        00:00:00 /lib/systemd/systemd --unit=basic.target
root          43       1  3 10:04 ?        00:00:00 /lib/systemd/systemd-journald
root          62       1  2 10:04 ?        00:00:00 /lib/systemd/systemd-udevd
systemd+      66       1  2 10:04 ?        00:00:00 /lib/systemd/systemd-networkd
message+     196       1  0 10:04 ?        00:00:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfil
root         197       0  0 10:04 pts/0    00:00:00 /bin/login -p -f         'HOSTTYPE=x86_64' 'PWD=/mnt/d/wsl/test/inst
root         267       1  1 10:04 ?        00:00:00 /lib/systemd/systemd-logind
[USER]      269       1  1 10:04 ?        00:00:00 /lib/systemd/systemd --user
[USER]      271     269  0 10:04 ?        00:00:00 (sd-pam)
[USER]      277     197  1 10:04 pts/0    00:00:00 -bash
[USER]      297     277  0 10:04 pts/0    00:00:00 ps -ef
$ mount
/dev/sdb on / type ext4 (rw,relatime,discard,errors=remount-ro,data=ordered)
tools on /init type 9p (ro,relatime,dirsync,aname=tools;fmask=022,loose,access=client,trans=fd,rfd=6,wfd=6)
none on /dev type devtmpfs (rw,nosuid,relatime,size=6492836k,nr_inodes=1623209,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,gid=5,mode=620,ptmxmode=000)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
cgroup on /sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_prio)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
none on /run type tmpfs (rw,nosuid,noexec,noatime,mode=755)
none on /run/lock type tmpfs (rw,nosuid,nodev,noexec,noatime)
none on /run/shm type tmpfs (rw,nosuid,nodev,noatime)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,noatime,mode=755)
tmpfs on /mnt/wsl type tmpfs (rw,relatime)
C:\ on /mnt/c type 9p (rw,noatime,dirsync,aname=drvfs;path=C:\;uid=1000;gid=1000;symlinkroot=/mnt/,mmap,access=client,msize=65536,trans=fd,rfd=8,wfd=8)
D:\ on /mnt/d type 9p (rw,noatime,dirsync,aname=drvfs;path=D:\;uid=1000;gid=1000;symlinkroot=/mnt/,mmap,access=client,msize=65536,trans=fd,rfd=8,wfd=8)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1299044k,mode=700,uid=1000,gid=1000)

Install a snap package:

$ sudo snap install inkscape
[sudo] password for [USER]:
error: too early for operation, device not yet seeded or device model not acknowledged

I don't know why...

Let's check again the processes and mountings:

$ ps -ef
UID          PID    PPID  C STIME TTY          TIME CMD
root           1       0  1 10:04 ?        00:00:01 /lib/systemd/systemd --unit=basic.target
root          43       1  0 10:04 ?        00:00:00 /lib/systemd/systemd-journald
root          62       1  0 10:04 ?        00:00:00 /lib/systemd/systemd-udevd
systemd+      66       1  0 10:04 ?        00:00:00 /lib/systemd/systemd-networkd
message+     196       1  0 10:04 ?        00:00:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfil
root         197       0  0 10:04 pts/0    00:00:00 /bin/login -p -f         'HOSTTYPE=x86_64' 'PWD=/mnt/d/wsl/test/inst
root         267       1  0 10:04 ?        00:00:00 /lib/systemd/systemd-logind
[USER]      269       1  0 10:04 ?        00:00:00 /lib/systemd/systemd --user
[USER]      271     269  0 10:04 ?        00:00:00 (sd-pam)
[USER]      277     197  0 10:04 pts/0    00:00:00 -bash
root         513       1  6 10:05 ?        00:00:00 snapfuse /var/lib/snapd/snaps/snapd_9721.snap /snap/snapd/9721 -o ro
root         612       1 22 10:05 ?        00:00:01 /usr/lib/snapd/snapd
root         725       1 12 10:05 ?        00:00:00 snapfuse /var/lib/snapd/snaps/core18_1932.snap /snap/core18/1932 -o
root         805       1  6 10:05 ?        00:00:00 snapfuse /var/lib/snapd/snaps/lxd_18150.snap /snap/lxd/18150 -o ro,n
[USER]     1295     277  0 10:05 pts/0    00:00:00 ps -ef
$ mount
/dev/sdb on / type ext4 (rw,relatime,discard,errors=remount-ro,data=ordered)
tools on /init type 9p (ro,relatime,dirsync,aname=tools;fmask=022,loose,access=client,trans=fd,rfd=6,wfd=6)
none on /dev type devtmpfs (rw,nosuid,relatime,size=6492836k,nr_inodes=1623209,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,gid=5,mode=620,ptmxmode=000)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
cgroup on /sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_prio)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
none on /run type tmpfs (rw,nosuid,noexec,noatime,mode=755)
none on /run/lock type tmpfs (rw,nosuid,nodev,noexec,noatime)
none on /run/shm type tmpfs (rw,nosuid,nodev,noatime)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,noatime,mode=755)
tmpfs on /mnt/wsl type tmpfs (rw,relatime)
C:\ on /mnt/c type 9p (rw,noatime,dirsync,aname=drvfs;path=C:\;uid=1000;gid=1000;symlinkroot=/mnt/,mmap,access=client,msize=65536,trans=fd,rfd=8,wfd=8)
D:\ on /mnt/d type 9p (rw,noatime,dirsync,aname=drvfs;path=D:\;uid=1000;gid=1000;symlinkroot=/mnt/,mmap,access=client,msize=65536,trans=fd,rfd=8,wfd=8)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1299044k,mode=700,uid=1000,gid=1000)
/dev/sdb on /snap type ext4 (rw,relatime,discard,errors=remount-ro,data=ordered)
snapfuse on /snap/snapd/9721 type fuse.snapfuse (ro,nodev,relatime,user_id=0,group_id=0,allow_other)
snapfuse on /snap/core18/1932 type fuse.snapfuse (ro,nodev,relatime,user_id=0,group_id=0,allow_other)
snapfuse on /snap/lxd/18150 type fuse.snapfuse (ro,nodev,relatime,user_id=0,group_id=0,allow_other)
none on /run/snapd/ns type tmpfs (rw,nosuid,noexec,noatime,mode=755)
nsfs on /run/snapd/ns/lxd.mnt type nsfs (rw)

Try it again:

$ sudo snap install inkscape
inkscape 1.0.1-0767f8302a-2020-10-17 from Inkscape Project (inkscape✓) installed

Success

Remove it and logout.

$ sudo snap remove inkscape
inkscape removed
$ logout

Let's try a second time Reboot distribution:

>wsl -t Ubuntu-20.04-02
>wsl
Sleeping for 1 second to let systemd settle
Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 4.19.128-microsoft-standard x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon Nov 30 10:09:07 CET 2020

  System load:  0.24               Processes:             35
  Usage of /:   0.7% of 250.98GB   Users logged in:       0
  Memory usage: 1%                 IPv4 address for eth0: 192.168.20.172
  Swap usage:   0%

14 updates can be installed immediately.
3 of these updates are security updates.
To see these additional updates run: apt list --upgradable

Last login: Mon Nov 30 10:08:00 CET 2020 on pts/0
$

Let's check again the processes and mountings:

$ ps -ef
UID          PID    PPID  C STIME TTY          TIME CMD
root           1       0  3 10:09 ?        00:00:00 /lib/systemd/systemd --unit=basic.target
root          43       1  3 10:09 ?        00:00:00 /lib/systemd/systemd-journald
root          60       1  2 10:09 ?        00:00:00 /lib/systemd/systemd-udevd
systemd+      64       1  2 10:09 ?        00:00:00 /lib/systemd/systemd-networkd
root         195       1  0 10:09 ?        00:00:00 snapfuse /var/lib/snapd/snaps/lxd_18150.snap /snap/lxd/18150 -o ro,n
message+     201       1  0 10:09 ?        00:00:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfil
root         202       0  0 10:09 pts/0    00:00:00 /bin/login -p -f         'HOSTTYPE=x86_64' 'PWD=/mnt/d/wsl/test/inst
root         255       1  1 10:09 ?        00:00:00 /lib/systemd/systemd-logind
[USER]      257       1  1 10:09 ?        00:00:00 /lib/systemd/systemd --user
[USER]      258     257  0 10:09 ?        00:00:00 (sd-pam)
[USER]      263     202  1 10:09 pts/0    00:00:00 -bash
[USER]      279     263  0 10:09 pts/0    00:00:00 ps -ef
$ mount
/dev/sdb on / type ext4 (rw,relatime,discard,errors=remount-ro,data=ordered)
tools on /init type 9p (ro,relatime,dirsync,aname=tools;fmask=022,loose,access=client,trans=fd,rfd=6,wfd=6)
none on /dev type devtmpfs (rw,nosuid,relatime,size=6492836k,nr_inodes=1623209,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,gid=5,mode=620,ptmxmode=000)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
cgroup on /sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_prio)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
none on /run type tmpfs (rw,nosuid,noexec,noatime,mode=755)
none on /run/lock type tmpfs (rw,nosuid,nodev,noexec,noatime)
none on /run/shm type tmpfs (rw,nosuid,nodev,noatime)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,noatime,mode=755)
tmpfs on /mnt/wsl type tmpfs (rw,relatime)
C:\ on /mnt/c type 9p (rw,noatime,dirsync,aname=drvfs;path=C:\;uid=1000;gid=1000;symlinkroot=/mnt/,mmap,access=client,msize=65536,trans=fd,rfd=8,wfd=8)
D:\ on /mnt/d type 9p (rw,noatime,dirsync,aname=drvfs;path=D:\;uid=1000;gid=1000;symlinkroot=/mnt/,mmap,access=client,msize=65536,trans=fd,rfd=8,wfd=8)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
/dev/sdb on /snap type ext4 (rw,relatime,discard,errors=remount-ro,data=ordered)
snapfuse on /snap/lxd/18150 type fuse.snapfuse (ro,nodev,relatime,user_id=0,group_id=0,allow_other)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1299044k,mode=700,uid=1000,gid=1000)
$

A new process is running:

root         195       1  0 10:09 ?        00:00:00 snapfuse /var/lib/snapd/snaps/lxd_18150.snap /snap/lxd/18150 -o ro,n

2 new mounted devices:

/dev/sdb on /snap type ext4 (rw,relatime,discard,errors=remount-ro,data=ordered)
snapfuse on /snap/lxd/18150 type fuse.snapfuse (ro,nodev,relatime,user_id=0,group_id=0,allow_other)

Install a snap package:

$ sudo snap install inkscape
[sudo] password for [USER]:
error: cannot perform the following tasks:
- Run configure hook of "inkscape" snap if present (run hook "configure": cannot perform operation: mount --rbind /dev /tmp/snap.rootfs_7dlI1W//dev: No such file or directory)
$
pablorq commented 3 years ago

More data.

It seems that snap starts ok the 1st time, but then it fails to start correctly.

Previous to run snap for the 1st time, there's no snap processes:

$ ps -ef
UID          PID    PPID  C STIME TTY          TIME CMD
root           1       0  1 11:35 ?        00:00:00 /lib/systemd/systemd --unit=basic.target
root          43       1  1 11:35 ?        00:00:00 /lib/systemd/systemd-journald
root          60       1  0 11:35 ?        00:00:00 /lib/systemd/systemd-udevd
systemd+      65       1  0 11:35 ?        00:00:00 /lib/systemd/systemd-networkd
root         161       0  0 11:35 pts/0    00:00:00 /bin/login -p -f         'HOSTTYPE=x86_64' 'PWD=/mnt/d/wsl/test/inst
message+     212       1  0 11:35 ?        00:00:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfil
root         250       1  0 11:35 ?        00:00:00 /lib/systemd/systemd-logind
[USER]      252       1  0 11:35 ?        00:00:00 /lib/systemd/systemd --user
[USER]      253     252  0 11:35 ?        00:00:00 (sd-pam)
[USER]      258     161  0 11:35 pts/0    00:00:00 -bash
[USER]      277     258  0 11:35 pts/0    00:00:00 ps -ef

When I said 1st run of snap, I mean to install a package or a simple snap version. Any of these has the same behavior.

After the 1st run of snap, 4 processes are added:

$ ps -ef
UID          PID    PPID  C STIME TTY          TIME CMD
root           1       0  3 11:35 ?        00:00:01 /lib/systemd/systemd --unit=basic.target
root          43       1  0 11:35 ?        00:00:00 /lib/systemd/systemd-journald
root          60       1  0 11:35 ?        00:00:00 /lib/systemd/systemd-udevd
systemd+      65       1  0 11:35 ?        00:00:00 /lib/systemd/systemd-networkd
root         161       0  0 11:35 pts/0    00:00:00 /bin/login -p -f         'HOSTTYPE=x86_64' 'PWD=/mnt/d/wsl/test/inst
message+     212       1  0 11:35 ?        00:00:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfil
root         250       1  0 11:35 ?        00:00:00 /lib/systemd/systemd-logind
[USER]      252       1  0 11:35 ?        00:00:00 /lib/systemd/systemd --user
[USER]      253     252  0 11:35 ?        00:00:00 (sd-pam)
[USER]      258     161  0 11:35 pts/0    00:00:00 -bash
root         489       1  7 11:35 ?        00:00:00 snapfuse /var/lib/snapd/snaps/snapd_9721.snap /snap/snapd/9721 -o ro
root         589       1 26 11:35 ?        00:00:02 /usr/lib/snapd/snapd
root         703       1 12 11:35 ?        00:00:00 snapfuse /var/lib/snapd/snaps/core18_1932.snap /snap/core18/1932 -o
root         783       1  7 11:35 ?        00:00:00 snapfuse /var/lib/snapd/snaps/lxd_18150.snap /snap/lxd/18150 -o ro,n
[USER]     1277     258  0 11:35 pts/0    00:00:00 ps -ef

The 4 new processes are:

root         489       1  7 11:35 ?        00:00:00 snapfuse /var/lib/snapd/snaps/snapd_9721.snap /snap/snapd/9721 -o ro
root         589       1 26 11:35 ?        00:00:02 /usr/lib/snapd/snapd
root         703       1 12 11:35 ?        00:00:00 snapfuse /var/lib/snapd/snaps/core18_1932.snap /snap/core18/1932 -o
root         783       1  7 11:35 ?        00:00:00 snapfuse /var/lib/snapd/snaps/lxd_18150.snap /snap/lxd/18150 -o ro,n

But after reboot WSL only 1 process is active:

$ ps -ef
UID          PID    PPID  C STIME TTY          TIME CMD
root           1       0  3 11:36 ?        00:00:00 /lib/systemd/systemd --unit=basic.target
root          43       1  3 11:36 ?        00:00:00 /lib/systemd/systemd-journald
root          60       1  2 11:36 ?        00:00:00 /lib/systemd/systemd-udevd
systemd+      68       1  2 11:36 ?        00:00:00 /lib/systemd/systemd-networkd
root         155       0  0 11:36 pts/0    00:00:00 /bin/login -p -f         'HOSTTYPE=x86_64' 'PWD=/mnt/d/wsl/test/inst
root         211       1  0 11:36 ?        00:00:00 snapfuse /var/lib/snapd/snaps/lxd_18150.snap /snap/lxd/18150 -o ro,n
message+     217       1  0 11:36 ?        00:00:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfil
root         255       1  1 11:37 ?        00:00:00 /lib/systemd/systemd-logind
[USER]      257       1  0 11:37 ?        00:00:00 /lib/systemd/systemd --user
[USER]      258     257  0 11:37 ?        00:00:00 (sd-pam)
[USER]      263     155  0 11:37 pts/0    00:00:00 -bash
[USER]      278     263  0 11:37 pts/0    00:00:00 ps -ef

This one:

root         211       1  0 11:36 ?        00:00:00 snapfuse /var/lib/snapd/snaps/lxd_18150.snap /snap/lxd/18150 -o ro,n```

I'm looking for start the other processes...

pablorq commented 3 years ago

[SOLVED]

I have continued with more tests and then I remember the issue #47 and thought that could be related.

And yes, it was related.

See the issue #47 for details.

Now snap is working fine without any more else (no custom kernel or another package)