-
Notifications
You must be signed in to change notification settings - Fork 183
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
No write permissions when mounting local volumes with podman #251
Comments
I think this is a Podman issue (rootless mode?), Not a WSL2 issue. I encourage you to look for information about Podman. I have Docker Desktop for Windows installed and using |
Oh! The one variable I didn't test. Thanks a bunch @eitsupi ! I just installed the standard docker tool and can confirm that things seem to be working normally. Great! It's a shame that podman seems to be acting up in this rather strange way though. I did notice a similar error when I tried (accidentally) binding to the default path in which WSL opens on my system ( For the record, here are a bunch of threads discussing issues related to podman and rocker:
Lastly, in reply to @cboettig's question here: one of the motivations to use podman instead of docker is that the Docker Desktop app for Windows is no longer free to use in a commercial setting. While docker can still be installed natively in WSL without Docker Desktop, from my understanding it takes a bit more configuration to get it to work (i.e. there is no systemd, so you have to launch the service manually and keep it alive, create user groups yourself, etc.), whereas podman is a simple executable that can serve as a drop-in replacement for any (most?) docker commands. |
From my point of view, if you are not concerned with Podman, it seems better to install Docker CE on Ubuntu etc. on WSL2. https://www.docker.com/pricing/faq
|
Thanks for the info! Installing the engine on WSL2 is what I did now, but the caveats I mentioned above do apply. E.g. the service doesn't start automatically because there's no systemd, so you have to run |
Anyway, I think this issue is not specific to WSL2 but due to the handling of Podman's volume permissions. I recommend changing the title of the issue. With a little search, you may find out about those solutions like these. |
I'm trying to run a
rocker/rstudio:4.0.4
container in WSL2 Ubuntu 20.04 (usingpodman
as my container tool) while mounting a local directory (my WSL home directory) into the container using the following command:podman run -e PASSWORD=password -p 8787:8787 -v $(pwd):/home/rstudio/my-project rocker/rstudio:4.0.4
.I can launch the container just fine, but whenever I try to write a file (e.g. modifying an existing script, creating a new project, etc.) I encounter the following error:
30 Sep 2021 13:59:59 [rsession-rstudio] ERROR system error 2 (No such file or directory) [path: /home/rstudio/my-project/test-file.r]; OCCURRED AT rstudio::core::Error rstudio::core::FilePath::openForWrite(std::shared_ptr<std::basic_ostream<char> >&, bool) const src/cpp/shared_core/FilePath.cpp:1482; LOGGED FROM: rstudio::core::Error rstudio::core::{anonymous}::openFileForWritingWithRetry(const rstudio::core::FilePath&, bool, int, std::shared_ptr<std::basic_ostream<char> >*) src/cpp/core/FileSerializer.cpp:73
If I try to mount the rstudio home directory directly, I cannot log into RStudio at all:
podman run -e PASSWORD=password -p 8787:8787 -v $(pwd):/home/rstudio rocker/rstudio:4.0.4
. The GUI shows an error prompt reading: "RStudio initialization error, unable to connect to service", and my container CLI shows:30 Sep 2021 14:03:50 [rsession-rstudio] ERROR system error 13 (Permission denied) [path: /home/rstudio/.local/share/rstudio, target-dir: ]; OCCURRED AT rstudio::core::Error rstudio::core::FilePath::createDirectory(const string&) const src/cpp/shared_core/FilePath.cpp:809; LOGGED FROM: int main(int, char* const*) src/cpp/session/SessionMain.cpp:1961
.If I try to mount a normal Windows directory instead (
podman run -e PASSWORD=password -p 8787:8787 -v /mnt/c/Users/user/Documents/:/home/rstudio localhost/custom-rstudio-rocker
), everything seems to work fine.I've played around with adding the
root=TRUE
parameter (described here: https://www.rocker-project.org/use/managing_users/#custom-usernames-and-user-ids), but that didn't solve the issue either. I also tried adding thez
flag, as described by this SELinux issue, but that didn't help either. I don't think my Ubuntu WSL2 uses SELinux anyway?I've encountered some other issues between WSL's file system and RStudio (a native install on host machine) before, namely while trying to
knit
an R bookdown project. The reason for this seems to be that the WSL file system acts like a network drive (\\\\wsl$\Ubuntu-20.04\home\user
). I haven't been able to find a resolution to this problem either though, although if I recall correctly most discussions seemed to point topandoc
being the culprit, so I'm not sure if it's relevant at all here?Any help would be much appreciated!
The text was updated successfully, but these errors were encountered: