csci530-os / vscode-remote-devcontainer

Basic container and instructions/procedures to set up VSCode Remote Dev Containers for assignments / labs
1 stars 0 forks source link

Permission Denied on MacOs for /workspaces folder #5

Open DerekHarter opened 2 years ago

DerekHarter commented 2 years ago

Steps to Reproduce

Student has cloned repository into the /home/user/Documents/repos directory. Everything looks reasonable until when opening up the workspace in the dev container. In the dev container, cannot see any files in the file explorer. If open up a terminal and try and do a

$ ls -alh assg00-assg-name
Permission denied

You will get permission denied errors, and even changing to root does not help, the directory appears not to be mounted correctly to be seen inside of the container.

Description

We have not confirmed, but MacOs does set permissions on certain directories in the host OS with specific restrictions. I believe the Documents directory all MacOS users has some permissions like this. It may be that any repository cloned in this directory, can be used on the host system, but permissions are not correct to mount this in the Docker remote DevContainer? This cause is just speculation, needs to be confirmed.

Fix

For the first student who seemed to have this issue, simply creating a repos directory in their /home/username home directory seems to resolve the issue. If the above description is correct, this directory has permissions that are fine for Docker to be able to mount it in the container by default.