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.

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