Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External Drive --home-volume mounting: changing ownership of ... Operation not permitted #119

Open
jukrb0x opened this issue Oct 17, 2021 · 2 comments
Assignees
Labels

Comments

@jukrb0x
Copy link

jukrb0x commented Oct 17, 2021

Describe the bug
To mount an external drive to home volume by flagging --home-voluem=, the file permission chown will prompt Operation not permitted.

To Reproduce
Like doing as ususal

./docker-wine --home-volume=$HOME/buffers

this is so fine, however, due to the disk space usage of the volume, I manage the files to an external drive.

So I will do something like:

./docker-wine --home-volume=/Volumes/MyDrive/buffers

and then devil comes,

...
chown: changing ownership of '/Users/username/.local/share/mime/packages/._x-wine-extension-jfif.xml': Operation not permitted
chown: changing ownership of '/Users/username/.local/share/mime/packages/._x-wine-extension-lnk.xml': Operation not permitted
chown: changing ownership of '/Users/username/.local/share/mime/packages/._x-wine-extension-msp.xml': Operation not permitted
chown: changing ownership of '/Users/username/.local/share/mime/packages/._x-wine-extension-uv2.xml': Operation not permitted
...

To solve above, I have to do this with sudo :

sudo ./docker-wine --home-volume=/Volumes/MyDrive/buffers

but it is bad doing so because the wine will generate another profile under /root, and I hate typing password every time.

and USER_HOME belogs to root in this case, the wine config directory will be located into /root which is not what we expect.

image

The permission of each file is fine:

image

by the way, --as-root is not working, I have to do it with sudo prefix, so I would guess it's some problem related to Xauthority by looking at 5215ee4 .( I am not sure, another reason could be the user from host machine is responsible for user_home, but is not aware of the permission of external drive)

Workaround
1. Clean the existing volume,
2. Mount the external drive with --volume :

use flag --as-me and mount it in /home/myUsername to avoid create default user wineuser

./docker-wine --as-me --volume=/Volumes/MyDrive/wineuser:/home/myUsername

Notice that the wine root .wine will still be generated under the /Users/myUsername , after its initialization, move it to the external drive and softlink it to ~/.wine.

ln -s /path-to/.wine ~/.wine

Environment

  • OS: macOS 11.4 with Docker Desktop 4.1.1, Engine 20.10.8
@jukrb0x
Copy link
Author

jukrb0x commented Oct 17, 2021

Whatsoever, this causes some problem as if the $HOME directory is not under /home/myUsername. The wine will start to config under $HOME/.wine for example and then everything broken..

So the workaround above is not perfect.

Please add the feature for letting external drive be accessible as home directory to docker-wine, this project is extremely useful for me. Thanks a lot!

@scottyhardy scottyhardy self-assigned this Dec 19, 2021
@scottyhardy
Copy link
Owner

Hi @jukrb0x, thanks for reporting this bug. I've confirmed this is an issue with local bind-mounts on macOS. I haven't tested yet, but I'm pretty sure Docker is able to chown bind mounts in Linux. I'm working on a solution and will hopefully get it completed and merged a few days after Xmas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants