Snapd installs but no snaps on ChromeOS with Linux

I’m using a Linux terminal on Chromebook and have apt-get install snapd without issue.
No snaps are installing though.

penguin:~$ sudo snap install hello-world
error: cannot perform the following tasks:
- Mount snap "core" (6673) ([start snap-core-6673.mount] failed with exit status 1: Job for snap-core-6673.mount failed.
See "systemctl status snap-core-6673.mount" and "journalctl -xe" for details.
)

Which yields

@penguin:~$ systemctl status snap-core-6673.mount
● snap-core-6673.mount - Mount unit for core
   Loaded: loaded (/etc/systemd/system/snap-core-6673.mount; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2019-04-03 01:42:52 UTC; 43s ago
    Where: /snap/core/6673
     What: /var/lib/snapd/snaps/core_6673.snap
  Process: 828 ExecMount=/bin/mount /var/lib/snapd/snaps/core_6673.snap /snap/core/6673 -t squashfs (code=exited, status=3

And also

@penguin:~$ sudo journalctl -xe
Apr 03 01:42:52 penguin systemd[1]: dbus.service: Failed to set invocation ID on control group /system.slice/dbus.service, ignoring: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: systemd-modules-load.service: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: systemd-modules-load.service: Failed to set invocation ID on control group /system.slice/systemd-modules-load.service, ignoring: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: opt-google-cros\x2dcontainers.mount: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: dev-lxd.mount: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: systemd-journald.service: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: systemd-journald.service: Failed to set invocation ID on control group /system.slice/systemd-journald.service, ignoring: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: unattended-upgrades.service: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: unattended-upgrades.service: Failed to set invocation ID on control group /system.slice/unattended-upgrades.service, ignoring: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: dev-full.mount: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: networking.service: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: networking.service: Failed to set invocation ID on control group /system.slice/networking.service, ignoring: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: cros-sftp.service: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: cros-sftp.service: Failed to set invocation ID on control group /system.slice/cros-sftp.service, ignoring: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: dev-.lxd\x2dmounts.mount: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:53 penguin /usr/lib/snapd/snapd[51]: task.go:303: DEBUG: 2019-04-03T01:42:53Z ERROR [start snap-core-6673.mount] failed with exit status 1: Job for snap-core-6673.mount failed.
                                                  See "systemctl status snap-core-6673.mount" and "journalctl -xe" for details.
Apr 03 01:42:52 penguin systemd[1]: dev-random.mount: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: polkit.service: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: polkit.service: Failed to set invocation ID on control group /system.slice/polkit.service, ignoring: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: dev-net-tun.mount: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: dev-.container_token.mount: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: mnt-chromeos.mount: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: systemd-resolved.service: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: Failed to set devices.allow on /system.slice/systemd-resolved.service: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: Failed to set devices.allow on /system.slice/systemd-resolved.service: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: Failed to set devices.allow on /system.slice/systemd-resolved.service: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: Failed to set devices.allow on /system.slice/systemd-resolved.service: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: Failed to set devices.allow on /system.slice/systemd-resolved.service: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: Failed to set devices.allow on /system.slice/systemd-resolved.service: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: Failed to set devices.allow on /system.slice/systemd-resolved.service: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: Couldn't stat device /run/systemd/inaccessible/chr
Apr 03 01:42:52 penguin systemd[1]: Couldn't stat device /run/systemd/inaccessible/blk
Apr 03 01:42:52 penguin systemd[1]: Failed to set devices.allow on /system.slice/systemd-resolved.service: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: systemd-resolved.service: Failed to set invocation ID on control group /system.slice/systemd-resolved.service, ignoring: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: dev-.ssh-ssh_authorized_keys.mount: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: systemd-tmpfiles-setup.service: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: systemd-tmpfiles-setup.service: Failed to set invocation ID on control group /system.slice/systemd-tmpfiles-setup.service, ignoring: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: systemd-journal-flush.service: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: systemd-journal-flush.service: Failed to set invocation ID on control group /system.slice/systemd-journal-flush.service, ignoring: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: dev-wl0.mount: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: dev-.ssh-sshd_config.mount: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: snapd.service: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: snapd.service: Failed to set invocation ID on control group /system.slice/snapd.service, ignoring: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: systemd-tmpfiles-setup-dev.service: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: systemd-tmpfiles-setup-dev.service: Failed to set invocation ID on control group /system.slice/systemd-tmpfiles-setup-dev.service, ignoring: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: packagekit.service: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: packagekit.service: Failed to set invocation ID on control group /system.slice/packagekit.service, ignoring: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: dev-tty.mount: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: systemd-remount-fs.service: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: systemd-remount-fs.service: Failed to set invocation ID on control group /system.slice/systemd-remount-fs.service, ignoring: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: dev-fuse.mount: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: systemd-sysctl.service: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: systemd-sysctl.service: Failed to set invocation ID on control group /system.slice/systemd-sysctl.service, ignoring: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: sys-fs-fuse-connections.mount: Failed to reset devices.list: Operation not permitted
Apr 03 01:42:52 penguin systemd[1]: snap-core-6673.mount: Mount process exited, code=exited status=32
Apr 03 01:42:52 penguin systemd[1]: Failed to mount Mount unit for core.
-- Subject: Unit snap-core-6673.mount has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit snap-core-6673.mount has failed.
-- 
-- The result is failed.
Apr 03 01:42:52 penguin systemd[1]: snap-core-6673.mount: Unit entered failed state.
Apr 03 01:42:53 penguin /usr/lib/snapd/snapd[51]: taskrunner.go:353: DEBUG: Running task 151 on Undo: Download snap "core" (6673) from channel "stable"
Apr 03 01:42:53 penguin sudo[769]: pam_unix(sudo:session): session closed for user root

Snapd depends on a working systemd and a recent enough Linux kernel, which is not available in ChromeOS.

Thanks for the response.

Is this not sufficient kernel?
@penguin:~$ uname -a
Linux penguin 4.19.16-02893-g2cf2c17c8a43 #1 SMP PREEMPT Sat Jan 19 09:52:07 PST 2019 x86_64 GNU/Linux

Run the snap debug sandbox-features command to verify if you have the all the kernel features snapd requires.

Also your systemd installation appears to be problematic, probably due to the implementation of the Linux compatibility layer of ChromeOS.

If the snap image is still around, can you try and mount it manually?

mount -t squashfs /var/lib/snapd/snaps/core_6673.snap /mnt

Hi. I have the same issue. I didn’t investigate much but here is the results of the suggested commands.

error: unknown command "debug", see "snap --help"

mount: /mnt: mount failed: Unknown error -1

I hope we can make this work. It would be super useful for a lot of people to be able to see the snap store on Crostini. I think many people are discovering Linux through it and the snap store seems to be a nice GUI to make the transition easier.

I just got this. Retrying the command manually also fails:

sudo /bin/mount /var/lib/snapd/snaps/core_7270.snap /snap/core/7270 -t squashfs
mount: /snap/core/7270: mount failed: Unknown error -1

strace shows it’s looking for loopback devices but not finding any:

uname({sysname="Linux", nodename="penguin", ...}) = 0
stat("/dev/loop-control", 0x7ffeed2b4510) = -1 ENOENT (No such file or directory)
stat("/var/lib/snapd/snaps/core_7270.snap", {st_mode=S_IFREG|0644, st_size=92778496, ...}) = 0
stat("/dev/loop", 0x7ffeed2b4600)       = -1 ENOENT (No such file or directory)
open("/sys/block", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
getdents(3, /* 12 entries */, 32768)    = 352
newfstatat(3, "loop1/loop/backing_file", 0x7ffeed2b4480, 0) = -1 ENOENT (No such file or directory)
newfstatat(3, "loop6/loop/backing_file", 0x7ffeed2b4480, 0) = -1 ENOENT (No such file or directory)
newfstatat(3, "loop4/loop/backing_file", 0x7ffeed2b4480, 0) = -1 ENOENT (No such file or directory)
newfstatat(3, "loop2/loop/backing_file", 0x7ffeed2b4480, 0) = -1 ENOENT (No such file or directory)
newfstatat(3, "loop0/loop/backing_file", 0x7ffeed2b4480, 0) = -1 ENOENT (No such file or directory)
newfstatat(3, "loop7/loop/backing_file", 0x7ffeed2b4480, 0) = -1 ENOENT (No such file or directory)
newfstatat(3, "loop5/loop/backing_file", 0x7ffeed2b4480, 0) = -1 ENOENT (No such file or directory)
newfstatat(3, "loop3/loop/backing_file", 0x7ffeed2b4480, 0) = -1 ENOENT (No such file or directory)
getdents(3, /* 0 entries */, 32768)     = 0
close(3)                                = 0
stat("/sys/block", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
stat("/dev/loop-control", 0x7ffeed2b4510) = -1 ENOENT (No such file or directory)
stat("/dev/loop", 0x7ffeed2b46c0)       = -1 ENOENT (No such file or directory)
stat("/dev/loop0", 0x7ffeed2b4650)      = -1 ENOENT (No such file or directory)
stat("/dev/loop1", 0x7ffeed2b4650)      = -1 ENOENT (No such file or directory)
stat("/dev/loop2", 0x7ffeed2b4650)      = -1 ENOENT (No such file or directory)
stat("/dev/loop3", 0x7ffeed2b4650)      = -1 ENOENT (No such file or directory)
stat("/dev/loop4", 0x7ffeed2b4650)      = -1 ENOENT (No such file or directory)
stat("/dev/loop5", 0x7ffeed2b4650)      = -1 ENOENT (No such file or directory)
stat("/dev/loop6", 0x7ffeed2b4650)      = -1 ENOENT (No such file or directory)
stat("/dev/loop7", 0x7ffeed2b4650)      = -1 ENOENT (No such file or directory)
open("/dev/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFDIR|0755, st_size=620, ...}) = 0
getdents(3, /* 31 entries */, 32768)    = 856
getdents(3, /* 0 entries */, 32768)     = 0
close(3)                                = 0
open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3