Unable to start snap applications if user's home directory is not /home/$USER

Bug #1776800 reported by Omegamormegil
106
This bug affects 19 people
Affects Status Importance Assigned to Milestone
snapd
In Progress
High
Alberto Mardegan
chromium-browser (Ubuntu)
Confirmed
Undecided
Unassigned
firefox (Ubuntu)
Confirmed
Undecided
Unassigned
lxd (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Users with home directories in /home/$USER can run snap application, but users in /home/users/$USER can't.

nate@WorkstationC:~$ snap --version
snap 2.32.8+18.04
snapd 2.32.8+18.04
series 16
ubuntu 18.04
kernel 4.15.0-22-generic
nate@WorkstationC:~$ echo $HOME
/home/users/nate
nate@WorkstationC:~$ which hello-world
/snap/bin/hello-world
nate@WorkstationC:~$ hello-world
cannot create nate data directory: /home/users/nate/snap/hello-world/27: Permission denied

Revision history for this message
Omegamormegil (omegamormegil) wrote :
Revision history for this message
R_volkmann (r-volkmann) wrote :

Affects me too in /local/home/$USER

$ snap --version
snap 2.32.9
snapd 2.32.9
series 16
ubuntu 16.04
kernel 4.4.0-128-generic

Revision history for this message
Bryan Quigley (bryanquigley) wrote :
Michael Vogt (mvo)
Changed in snapd:
importance: Undecided → High
Changed in snapd:
status: New → Triaged
Revision history for this message
Aivars Lauzis [LV] (lauzis) wrote :

- have related issue...

have git hook, that logs all commits from all projects into one log file splitted by date.
this works fine with git, and gui interfaces that are installed via apt-get, but snap package in this case "Git Kraken" is trying to write in different path, looks like that $HOME for snap application is not users home.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

This is a known limitation. We have some plans on how to change that but this is not something we can commit to this ubuntu cycle.

This is also listed on https://forum.snapcraft.io/t/limitations-in-snapd/9718

Changed in snapd:
status: Triaged → Confirmed
Revision history for this message
Erik Lönroth (erik-lonroth) wrote :
Revision history for this message
Olivier Tilloy (osomon) wrote :

This is becoming very visible with the default browser in Ubuntu (firefox) becoming a snap in 22.04. Can the snapd team comment on whether this is (still) on the roadmap?

Revision history for this message
Stefan Fleischmann (sfleischmann) wrote :

How can this be sitting around here for 3 years unassigned with *high* priority? And then apparently it's not even considered a blocker for replacing Firefox in Ubuntu 22.04 with the snap. Is it really that hard to fix or is just nobody paying attention to it?

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in chromium-browser (Ubuntu):
status: New → Confirmed
Changed in firefox (Ubuntu):
status: New → Confirmed
Changed in lxd (Ubuntu):
status: New → Confirmed
Paul White (paulw2u)
tags: added: bionic focal jammy
Alberto Mardegan (mardy)
Changed in snapd:
assignee: nobody → Alberto Mardegan (mardy)
status: Confirmed → In Progress
Revision history for this message
C. Jeffery Small (loyhz2ay-jeff-h670zbts) wrote :

Just to make sure the note is here, my home directory is not in /home at all, but located under /u which is a mount point for an external volume on another disk. I experienced the same problem trying to run a snap. Whatever the solution, it should be generalized to any $HOME location.

Revision history for this message
Erik Meitner (eamuwmath) wrote :

Any solution needs to work with multiple home folder locations that can be located anywhere. We've got 540 users spread among four different folders: /fac/, /grad/, /staff/, /visitor/.

Revision history for this message
Alberto Mardegan (mardy) wrote :

Hi Jeffrey and Erik!
  You are being heard :-) But this is not an easy task, and the amount of work required to support the case of home directories nested somewhere deeper inside /home is very different (read: lower) than that required to support home directories located elsewhere in the system.

We are first tackling the first problem, and this bug will be closed once that part is fixed. The bug that best describe your use-case is https://bugs.launchpad.net/snappy/+bug/1620771, so I recommend you to subscribe to that one.

Revision history for this message
Stefan Fleischmann (sfleischmann) wrote :

Hi Alberto, I'm glad to hear that there is some progress. Happy to test patches if you need feedback on something.

Revision history for this message
jelka (jlk-mb) wrote :

I can add to this one, same problems with remote directories for "home" that is not mounted as /home.
Weird that snap is that rigid, that it requires users to be mounted in /home/$USER and even more weird that there was not made an alternative firefox version, that does not run inside snap container in Ubuntu 22.04 LTS???
Large multi-user setups mostly run on remote directories for home and it would be unwise to use /home, due to potential clash with default location of local users home.

Revision history for this message
Darko Veberic (darko-veberic-kit) wrote :

this is a major showstopper at our institute. we have 60+ ubuntu desktops with nfs-mounted homes and were postponing the switch from the last lts to this one for a while. but this cannot go on forever while availability of firefox is, obviously, crucial. i would classify this bug as "critical" and "urgent".

Revision history for this message
Gabriel Devenyi (ace-staticwave) wrote :

@Darko, we had the same blocking issues for an institutional deployment. We ended up removing snapd and making modifications similar to this to install a deb version https://www.omgubuntu.co.uk/2022/04/how-to-install-firefox-deb-apt-ubuntu-22-04

Revision history for this message
reetp (jcrisp) wrote :

> You are being heard :-)

Really?

> But this is not an easy task

Alberto, it's not our fault that Ubuntu are having problems solving it. Ubuntu created the problem, not us.

They should have got it right from the start, but I guess it was difficult so they just chose to ignore it instead.

And now they are defaulting apps to snaps that *we can't run* because of their bugs that they created. Ridiculous.

Fundamentally a duplicate of https://bugs.launchpad.net/snapd/+bug/1620771 which was opened in September 2016.

That's 6 years ago, and I guess demonstrates the Ubuntu priorities and willingness to fix things.

Clearly the rush to foist snaps on people is a higher priority than that of those who can't install them.

Revision history for this message
Klaus Jaensch (klausj) wrote (last edit ):

We are using Autofs/NFSv4 mounted homes on mountpoint /homes on 25+ multi-user client computers. We decided to use a separate mountpoint to be able to use both NFS mounted and local homes.
The bug blocks an update to 22.04 LTS on these computers.

Revision history for this message
Alberto Mardegan (mardy) wrote :

Small update: we have now merged a change that allows snaps to work on system where the users' home directories are not /home/<user>/ but /home/<some>/<path>/<user/

If you are running such a system, you are welcome to try out snapd from our edge channel:

    snap refresh --channel=latest/edge snapd

then configure the homedirs location using the command

    # Real homes are located in /home/users/tom, /home/losers/dick,...
    snap set system homedirs=/home/users,/home/losers

Please report back on your (mis)fortunes. :-)

If your home directories are located somewhere else (not under /home), please subscribe to https://bugs.launchpad.net/snapd/+bug/1620771 instead.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers