Unable to install lxd 3.0.0 via snaps

I get an error when trying to install it on one of our servers. I reported this on the snaps bug tracking site too but I don’t know if its an snap or lxd issue.

root@dev ~ # snap install lxd
error: cannot perform the following tasks:
Run configure hook of “lxd” snap if present (run hook “configure”: cannot perform operation: mount --rbind /var/tmp /tmp/snap.rootfs_P4gpkD//var/tmp: Permission denied)
root@dev ~ # snap refresh core --beta
core (beta) 16-2.32.6 from ‘canonical’ refreshed

the tmp directory is a mounted file (for security reasons):
/var/tmpmount /tmp ext4 loop,rw,noexec,nosuid,nodev 0 0

But even when using the filesystem for /tmp the error is still the same.

Installing lxd 3.0.0 on another server (with same Ubuntu version, etc) with snap did not give me this error.

How can I fix this?

I’m pretty sure this is a snapd bug, we’ve had another user report similar problems caused by /var/tmp being a symlink to /tmp.

I’d recommend opening a forum topic at https://forum.snapcraft.io including the error above and showing your /tmp and /var/tmp setup, that should help them sort this out.

Thanks that helped fixing it! I had an link from /var/tmp to /tmp. But it should be two seperate directories. The /var/tmp on normal disk and /tmp on a mounted, noexec, file. After fixing that I could install lxd 3.0.0 without further issues.