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

Workspace folder is created inside root folder of the container. #5140

Closed
jiornojiovanni opened this issue Jun 4, 2021 · 6 comments
Closed
Assignees
Labels
containers Issue in vscode-remote containers info-needed Issue requires more information from poster

Comments

@jiornojiovanni
Copy link

  • VSCode Version: 1.56.2
  • Local OS Version: Fedora 34
  • Name of Dev Container Definition with Issue: i tried the NodeJS and the Go devcontainers.

When I open a devcontainer my project files aren't usable, as they are inside a workspace folder under the root of the container. So I can't access them and I can't create files.

Steps to Reproduce:

  1. Launch devcontainer.
  2. Can't read, write or create files inside the workspace.
    immagine
@Chuxel Chuxel transferred this issue from microsoft/vscode-dev-containers Jun 4, 2021
@Chuxel
Copy link
Member

Chuxel commented Jun 4, 2021

This is expected but the permissions should be correct on the /workspace folder and its sub contents. The only reason I can think of that might cause this is if you are using rootless docker with a non-root user in devcontainer.json. The problem here is that your user is mapped to root inside the container because of how rootless Docker works. So for the bind mount only root can access the files (it's an annoying problem) - and if we change them it will make your local copy of the files have the wrong user. Is that your situation?

Opening something in a container volume is not subject to the same problem. (The "clone repository in container volume" command.)

//cc: @chrmarti

@Chuxel Chuxel added containers Issue in vscode-remote containers info-needed Issue requires more information from poster labels Jun 4, 2021
@jiornojiovanni
Copy link
Author

jiornojiovanni commented Jun 4, 2021

I installed docker from the official repository and then added myself to the docker group (I followed the instructions given by the remote container extension).
I tried with both the default user and with root in devcontainers.json (It's the autogenerated one, I haven't touched it).

@jiornojiovanni
Copy link
Author

I edited my previous comment as I thought I was doing something wrong with the clone "repository in container" command, but yes it also doesn't work. It can't read the devcontainer.json inside it thanks to the insufficient permission.
immagine

@chrmarti
Copy link
Contributor

chrmarti commented Jun 4, 2021

What do you get for ls -la /workspaces?

@chrmarti chrmarti self-assigned this Jun 4, 2021
@jiornojiovanni
Copy link
Author

$ ls -la /workspaces/
total 0
drwxr-xr-x. 1 root   root    18 Jun  4 15:23 .
drwxr-xr-x. 1 root   root   188 Jun  4 15:23 ..
drwxr-xr-x. 1 vscode vscode  74 Jun  4 13:56 palma-IRC

When inside the project folder:
immagine

@chrmarti
Copy link
Contributor

chrmarti commented Jun 7, 2021

You seem to be using SELinux (going by the dot in the permissions). We are tracking this as #1333.

@chrmarti chrmarti closed this as completed Jun 7, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
containers Issue in vscode-remote containers info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants