Chromium snap doesn’t launch on symlink

Hi to all,

When I try to run chromium, it fails launching.
A dig in syslog gives:

2020/03/29 20:47:10.404170 cmd_run.go:529: WARNING: XAUTHORITY environment value is not a clean path: “/data/home/XXXXXXX/.Xauthority”
cannot create user data directory: /home/XXXXXXX/snap/chromium/1056: Not a directory

My $HOME directory is a soft link to a shared mounted remote location, i.e.: all $HOME directories are created this way on the fly.
The share mount is on /data and the $HOME are in /home, like this:

lrwxrwxrwx 1 root root 19 déc. 29 2016 XXXXXXX -> /data/home/XXXXXXX/
lrwxrwxrwx 1 root root 19 févr. 6 11:09 YYYYYYY -> /data/home/YYYYYYY/

I suppose this is the core reason.
Of course, “/home/XXXXXXX/snap/chromium/1056” is writable and is a directory.
What can I do please?

Oops, sorry, I failed to say that I’m under Ubuntu 19.10

Unfortunately using home directories that are not /home/ is not well supported in snapd. Please see Support for non /home homedirs. You can try bind mounting from somewhere else to /home/ instead.

It’s not a viable solution for my infrastructure.
Please correct this.

Is there a particular reason this wouldn’t be viable?

The bind mount solution would involve adding something like the following to your /etc/fstab:

/real/location/for/home  /home/username  none  defaults,bind  0  0

Rather than a symbolic link at /home/username, you’d place an empty directory for the bind mount. Your home directory content would still be available at the original location, but path based security policies that assume your home directory is under /home should work.

1 Like

We use a shared home directory on a multi-host environment, specifically to load balance apache. We use chromium (under snap) by apache (user www-data) to provide previews for clients.

We do NOT want www-data to be mounted on our shared /home drive. Instead we want it to remain as a per server /var/www home address.