mount error when installed using snap

On Ubuntu 16.04, I installed cloudcompare using snap following:

sudo snap install cloudcompare

However, I get the following error when trying to launch it:

$ sudo cloudcompare.CloudCompare 
cannot perform operation: mount --rbind /home /tmp/snap.rootfs_AUR1hM//home: Permission denied

How do I fix this?


Solution 1:

I had this exact problem and was able to fix it using a bind mount instead of a symlink. In my case I had a symlink for my home dir to /data/home. Remove the symlink, then create an empty directory for the mount point;

rm /home
mkdir /home

Then edit your /etc/fstab and add the line;

/data/home      /home   none    bind

Then reboot or enter the following command and /data/home will be mounted to /home.

mount /home

After that the snap applications will work.