Skip to content

Unable to share files/directories in home directory #475

@jkitching

Description

@jkitching

When attempting to use --share on files or directories in the home directory, they are not shared. With the share target --share=$HOME/.local/share/gnome-shell/extensions, these lines are generated in containerrc:

   165	mkdir -p /home/linolium/.local/share/gnome-shell
   166	ln -s '/home.host/.local/share/gnome-shell/extensions' -T '/home/linolium/.local/share/gnome-shell'

This results in the error:

ln: failed to create symbolic link '/home/linolium/.local/share/gnome-shell': File exists

Based on ln's man page, seems like -T is for specifying the exact name of the symbolic link being created:

SYNOPSIS
       ln [OPTION]... [-T] TARGET LINK_NAME
DESCRIPTION
       In  the  1st form, create a link to TARGET with the name LINK_NAME. 

So I believe the correct command should be one of the following:

ln -s '/home.host/.local/share/gnome-shell/extensions' '/home/linolium/.local/share/gnome-shell'
ln -s '/home.host/.local/share/gnome-shell/extensions' -T '/home/linolium/.local/share/gnome-shell/extensions'

The -T flag was added in 514817f and a2a3a90 to deal with issue #384. Unless I'm missing something, the second commit is incorrect. The line in question should be changed to one of these two options:

                echo "ln -s '$Path' '$(dirname "$Line")'"
                echo "ln -s '$Path' -T '$Line'"

I'd choose the second option, since it is less ambiguous.

In the meantime, a workaround is using --runasuser, e.g.

--runasuser='ln -s /home.host/.local/share/gnome-shell/extensions ~/.local/share/gnome-shell'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions