Installing Chromium in LXD/ LXC container fails

In the past, I have been able to install Chromium (I believe it used Snap when it did ‘sudo apt install chromium-browser’) in the LXC container that is managed by LXD.

On the Ubuntu host machine this very same Snap package installs fine but it fails with below error when executed in the LXD/ LXC container.

LXD version: 4.6

Steps to reproduce:

ubuntu@container1:~$ lxc launch ubuntu:20.04 --profile default container1

ubuntu@container1:~$ lxc exec container1 -- sudo --user ubuntu --login

ubuntu@container1:~$ sudo snap install chromium
error: cannot perform the following tasks:
- Mount snap "chromium" (1328) ([start snap-chromium-1328.mount] failed with exit status 1: Job failed. See "journalctl -xe" for details.
)


ubuntu@container1:~$ journalctl -xe
-- 
-- A start job for unit snap-gtk\x2dcommon\x2dthemes-1506.mount has finished successfully.
-- 
-- The job identifier is 574.
Oct 07 00:24:12 container1 systemd[1]: Reloading.
Oct 07 00:24:12 container1 systemd[1]: /lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus>
Oct 07 00:24:12 container1 systemd[1]: Mounting Mount unit for chromium, revision 1328...
-- Subject: A start job for unit snap-chromium-1328.mount has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit snap-chromium-1328.mount has begun execution.
-- 
-- The job identifier is 580.
Oct 07 00:24:12 container1 mount[6114]: Squashfs image uses lzo compression, this version supports only xz, zlib.
Oct 07 00:24:12 container1 systemd[1]: snap-chromium-1328.mount: Mount process exited, code=exited, status=255/EXCEPTION
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- An n/a= process belonging to unit snap-chromium-1328.mount has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 255.
Oct 07 00:24:12 container1 systemd[1]: snap-chromium-1328.mount: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit snap-chromium-1328.mount has entered the 'failed' state with result 'exit-code'.
Oct 07 00:24:12 container1 systemd[1]: Failed to mount Mount unit for chromium, revision 1328.
-- Subject: A start job for unit snap-chromium-1328.mount has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit snap-chromium-1328.mount has finished with a failure.
-- 
-- The job identifier is 580 and the job result is failed.
Oct 07 00:24:12 container1 systemd[1]: Cannot find unit for notify message of PID 6111, ignoring.
Oct 07 00:24:12 container1 systemd[1]: Reloading.
Oct 07 00:24:13 container1 systemd[1]: /lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus>
Oct 07 00:24:13 container1 snapd[521]: taskrunner.go:271: [change 3 "Mount snap \"chromium\" (1328)" task] failed: [start snap-chromium-1328.mount] failed with exit status 1>
Oct 07 00:24:13 container1 systemd[1]: Cannot find unit for notify message of PID 6145, ignoring.
Oct 07 00:24:14 container1 snapd[521]: handlers.go:495: Reported install problem for "chromium" as Crash report successfully submitted.
Oct 07 00:24:14 container1 sudo[5887]: pam_unix(sudo:session): session closed for user root

Hi, thanks for reporting, we have a PR open fixing this open @ https://github.com/snapcore/snapd/pull/9470 which I hope is landed tomorrow and should be in the edge channel of snapd sometime tomorrow. After that it will be a while before it gets into the stable channel of snapd due to QA, etc.

@oSoMoN I don’t recall if you decided to revert the revision of chromium in the stable channel to one without lzo but if you could comment that would be great.

1 Like

I reverted the LZO change, and chromium snaps are currently rebuilding (a rebuild is required because several changes to the snap were released in between).

1 Like

A follow-up: now that snapd 2.47.1 is available in {xenial,bionic,focal}-updates and in groovy, I have re-enabled LZO compression for the chromium snap. Updated builds have already been promoted to stable for amd64 and i386, and are ongoing for armhf and arm64.