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

"Permission Denied Error when Running Non-Root Podman Development Container: mkdir: cannot create directory ‘/root’" #268

Open
mimowen opened this issue Jul 7, 2024 · 1 comment

Comments

@mimowen
Copy link

mimowen commented Jul 7, 2024

I find an issue with the VSCode Dev Container template image trying to create files in the /root directory within the container using the vscode username. Here's the error I received:

[16535 ms] Exit code 1
[16535 ms] Start: Run in container: test -d '/vscode/vscode-server/bin/linux-x64/ea1445cc7016315d0f5728f8e8b12a45dc0a7286'
[16579 ms]
[16579 ms]
[16579 ms] Start: Run in container: mkdir -p '/root/.vscode-server/bin' && ln -snf '/vscode/vscode-server/bin/linux-x64/ea1445cc7016315d0f5728f8e8b12a45dc0a7286' '/root/.vscode-server/bin/ea1445cc7016315d0f5728f8e8b12a45dc0a7286'
[16623 ms]
[16623 ms] mkdir: cannot create directory ‘/root’: Permission denied
[16623 ms] Exit code 1
[16624 ms] Start: Run: podman rm -f 16650b67a2fdcc48a91885454e657b9caecf1c6511e7c774d8d0526108239cb9
[16627 ms] Command in container failed: mkdir -p '/root/.vscode-server/bin' && ln -snf '/vscode/vscode-server/bin/linux-x64/ea1445cc7016315d0f5728f8e8b12a45dc0a7286' '/root/.vscode-server/bin/ea1445cc7016315d0f5728f8e8b12a45dc0a7286'
[16628 ms] mkdir: cannot create directory ‘/root’: Permission denied
[16628 ms] Exit code 1

The /root directory has default permissions set to 700 in Ubuntu 22.04.4 LTS, which caused this error.

After modifying the /root directory permissions, I found that the Dev Container extension is able to create the /root/.vscode-server directory within the container. Everything works fine now, and I can happily use the Dev Container extension.

image

So I want to know why this happened ?what caused this?

Environment Information

VSCode Version:

  • Version: 1.91.0 (system setup)
  • Commit: ea1445cc7016315d0f5728f8e8b12a45dc0a7286
  • Date: 2024-07-01T18:52:22.949Z
  • Electron: 29.4.0
  • Chromium: 122.0.6261.156
  • Node.js: 20.9.0
  • OS: Windows_NT x64 10.0.22631

Host:

  • Ubuntu 22.04.4 LTS

Podman Version:

  • Version: 3.4.4
  • API Version: 3.4.4
  • Go Version: go1.18.1
  • Built: Thu Jan 1 00:00:00 1970
  • OS/Arch: linux/amd64

Test Docker Templates Image Mirror Address:

@samruddhikhandale
Copy link
Member

@gauravsaini04 / @prathameshzarkar9 Can either of you help investigate the issue? thanks!

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

No branches or pull requests

2 participants