Support for non /home homedirs

Yes, my home directory is automatically mounted from some server, but why?

If /home is already used by the automounter (nfs) by ldap users it is not possible to add local user to /home via bind mount.

I had the same issue. Following these instructions fixed the issue. Make sure to do those instructions for your user AND the root user as well if you are using sudo. Kept failing even after I changed /home/$USER. The problem was /root was also set up on an iSCSI store. Once I did it for /home/$USER and /root, it worked.

There is a PR which should solve this:

This limitation is so extremely annoying and Ubuntu forcing everyone to use a packaging system with this flaw is even more annoying. It is exactly things like these who give Linux a bad reputation and the image of needing endless fiddling around to get it to work. This is stealing an incredible amount of user’s time and effort and causes a lot of frustrations among (Ubuntu) users who simply want to use e.g. Firefox and are forced to jump though loops simply because their home directory is not where some silly software expects it to be.

1 Like

Don’t want to stop you ranting, but did you see a fix was merged half a year ago? The link is posted in the post before yours. Just a few centimeters above it actually. Just click it. It is a link.

If that is not possible, here is the important info: snapd from 2.59 onward has a homedirs system option; so lets say your homedir is in /my/home you can do the following

snap set system homedirs=/my/home/

If your snapd version is below 2.59 I am afraid you need to use bind-mounts

The fix is still quite buggy. I’m on Ubuntu 22.04 with snapd 2.60.

cskama@node1:~$ sudo snap set system homedirs=/users error: cannot perform the following tasks:

  • Run configure hook of “core” snap (run hook “configure”: path “/users/” unsupported: must start with one of: /home/)

It seems there is a circular dependency where it will pull the core snap before setting the configuration.

yeah that looks quite wrong. The error message seems also quite weird/way off. I just tried on my system (snap 2.60.4) and it works for me. (tried with both /users and /users/). I also see nothing in the documentation which indicates circumstances where this should not work.

What is your setup (snap --version, operating system (ubuntu xx.yy?? ubuntu core??), is this running in a container/VM/bare metal, is /users/ on the same filesystem (if not, what kind of FS and is it local or remote) )

Anyway if you are on snap>=2.59 think this is a valid bug, so please file a bug report.

since it says “homedirs”, I assume that means it can set multiple home directories?

I think “homedirs” is the place where all the home directories are located (e.g. /xxx/user1, /xxx/user2, /xxx/happyuser,…)

documentation also indicates that only a single supports extra folder (besides the /home/ folder, which is still valid)

sudo snap set system homedirs=<destination-directory>

if you have a more complex use case, bind mounts are the way

Just tried, and this is not working with 2.60.4 If I configure homedirs with another location, then /home located homedirs are not working anymore.

Hi, I am using Ubuntu 22.04.3 LTS and xrdp - but none of the above solutions work for me.

My home directory is /home/xrdp and I have tried typing ‘snap set system homedirs=/home/xrdp’

The Firefox install directs me to come to this page ‘Sorry, home directories outside of /home needs configuration. See Support for non /home homedirs for details’

Please help? What would be the commands to mount the home directory

Just to be sure - your username is ‘xrdp’? So if your home dir is /home/xdrp then your homedirs should be /home - which also is the default place for home dirs. So better just unset that homedirs (side note; not sure what username the xdrp service uses; but this sounds a bit confusing/-ed)

Description:

On Fedora Sliverblue, this is $HOME

$ df -Th /var/home /home
Filesystem     Type   Size  Used Avail Use% Mounted on
/dev/nvme0n1p3 btrfs  953G  8.8G  941G   1% /var/home
/dev/nvme0n1p3 btrfs  953G  8.8G  941G   1% /var/home
$ ls -ld /home /var/home
lrwxrwxrwx. 3 root root 8 Feb 21 11:52 /home -> var/home
drwxr-xr-x. 1 root root 8 Feb 21 12:07 /var/home

This is what I get:

$ type hello-world
hello-world is hashed (/var/lib/snapd/snap/bin/hello-world)

$ hello-world
Sorry, home directories outside of /home needs configuration.
See https://forum.snapcraft.io/t/11209 for details.

I want to run syncthing-arubislander and I hope I don’t end up running syncthing outside of snap.

$ snap list
Name                    Version           Rev    Tracking       Publisher      Notes
bare                    1.0               5      latest/stable  canonical✓     base
core                    16-2.61.1         16574  latest/stable  canonical✓     core
core20                  20240111          2182   latest/stable  canonical✓     base
core22                  20240111          1122   latest/stable  canonical✓     base
gnome-42-2204           0+git.ff35a85     141    latest/stable  canonical✓     -
gtk-common-themes       0.1-81-g442e511   1535   latest/stable  canonical✓     -
hello-world             6.4               29     latest/stable  canonical✓     -
snap-store              41.3-71-g709398e  959    latest/stable  canonical✓     -
snapd                   2.61.1            20671  latest/stable  canonical✓     snapd
syncthing-arubislander  1.24.0            33     latest/stable  arub-islander  -

Any ideas?

I just did an early upgrade on one of our workstations to Ubuntu 24.04 to check the status of this. First attempt without any configuration:

$ hello-world
Sorry, home directories outside of /home needs configuration.
See https://forum.snapcraft.io/t/11209 for details.

# snap set system homedirs=/nfshome

$ hello-world
Hello World!

Also tested with something more advanced (LXD), seems to work fine. Thanks for finally making this work :slightly_smiling_face:

PS: just for completeness, another thing probably necessary that we’re doing when installing a new system, dpkg-reconfigure apparmor and enter /nfshome/ in the dialogue. Well to be precise we do this with Ansible, but dpkg-reconfigure is the manual way to do it.

PPS: I don’t recommend an early upgrade, since it fails due to bug #2054716. I was just curious if this will work when 24.04 is released.

More improvements available in snapd 2.62.

Test feedback always appreciated

1 Like

I am still seeing the same error with snapd 2.62

$ hello-world
Sorry, home directories outside of /home needs configuration.
See https://forum.snapcraft.io/t/11209 for details.

$ sudo snap get system 
Key       Value
homedirs  /mnt/homes-vol/ipn
refresh   {...}
seed      {...}
system    {...}

$ snap list
Name               Version          Rev    Tracking       Publisher   Notes
bare               1.0              5      latest/stable  canonical✓  base
core               16-2.61.2        16928  latest/stable  canonical✓  core
core20             20240227         2264   latest/stable  canonical✓  base
core22             20240408         1380   latest/stable  canonical✓  base
firefox            125.0.3-1        4209   latest/stable  mozilla✓    -
gnome-42-2204      0+git.510a601    176    latest/stable  canonical✓  -
gtk-common-themes  0.1-81-g442e511  1535   latest/stable  canonical✓  -
hello-world        6.4              29     latest/stable  canonical✓  -
lxd                5.21.1-d46c406   28460  5.21/stable    canonical✓  -
snapd              2.62             21465  latest/stable  canonical✓  snapd

I’m afraid johann-petrak is correct on this one. Why would any system that hopes to be taken seriously assume that home directories are all going to be under a single folder?

In any event, the fixes still aren’t working for me on version 2.63:

$ sudo snap get system
Key       Value
homedirs  /hshare
refresh   {...}
seed      {...}
system    {...}
$ maas login $USER $MAAS_URL
2024/05/28 17:06:29.941909 cmd_run.go:452: restoring default SELinux context of /hshare/brmitaklaassen/snap
Sorry, home directories outside of /home needs configuration.
See https://forum.snapcraft.io/t/11209 for details.

Why would any system that hopes to be taken seriously assume that home directories are all going to be under a single folder?

Why would any IT person that hopes to be taken seriously assume that a system which started out for tightly controlled phones/embedded devices to support all use cases of desktop users?

anyway, lets see if i can be helpful. Dont think this is the problem, but worth a shot: I am not sure if the config change gets picked up instantly, so did you try restarting? it looks you are running SELinux; does your configuration prevents snap from access there? I think that snap by itself does not support SELinux, so you/your distribution needs to provide the necessary policies. what OS are you running? what kind of kernel? what kind of filesystems is /hshare on ?

Also note i googled your SELinux message and found this one: Selinux warning when running lxc - #14 by aplatypus

depending on the support for SELinux: LSM stacking is not mainlined for apparmor/SELinux ; the usual sandbox features will not work, so be careful what snaps you run (e.g. run use a browser)

I was in a grumpy mood yesterday - lots of swearing in my own notes - so apologies for coming in hard. I’m not familiar with anything about Snaps other than that I’m trying to use it for MAAS for render farm deployment.

I hadn’t tried that, trying it now.

“systemctl restart snapd” resulted in the same failure.

Rebooting the machine…worked! (Now I have a whole new set of errors to figure out, but they appear to be more MAAS related than Snap related.)

I had tried both creating an SELinux policy and turning off SELinux; both resulted in the same failure.

Rocky 9.3, kernel 5.14.0-427.16.1.el9_4.x86_64.

/hshare is a directory on the local xfs root filesystem. The home directory under it is an automounted NFSv3 share from an Isilon file server.

Would you happen to know if there’s a way other than “systemctl restart snapd” to restart the snap stuff that’ll reload the configuration so that a reboot isn’t required?

Thanks.