You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ghcr.io/devcontainers/features/git:1 changes mode of /tmp to 755 causing "mkdir: cannot create directory ‘/tmp/.X11-unix’: Permission denied" #1480
Thank you for reporting this issue. I could see that you are using a very old dev container image as the base image for your dev container mcr.microsoft.com/vscode/devcontainers/python:0-3.11. That could very well be the reason behind this issue with git feature you reported.
Would you kindly use latest images such as mcr.microsoft.com/vscode/devcontainers/python:2-3.11 or mcr.microsoft.com/vscode/devcontainers/python:2-3.11-bullseye and see if the issue persists?
Would you kindly share the complete log for this scenario with both show container log and show previous log options? That would be help us a great deal to investigate this further.
Also you are using python pre-built dev container image which already includes the git feature in its dev container configuration. So you shouldn’t need to install it all over again.
What I have been doing since yesterday is to use @devcontainers/cli to go through multiple edit-build-test cycles. Instead of loading features from the web I copied a feature from the src tree of this repo and placed it in a subdirectory of the .devcontainer. I worked my way through stripping the install.sh of the "feature". The start situation is when the build container has a 1777 for /tmp. And finally ended up with an install.sh that led to a container with mode 755 for /tmp.
I can provide the output of the npx devcontainer up --workspace-folder .. There is no difference between the good and bad case, except if the install.sh writes something to stdout.
Let me know if you still want that log.
I'm digging about this issue with related issues that I found. I have noted that podman is a common factor between these issues, and specifically the podman above version 5.5.0, can you please confirm if that is your case?
Maybe this isn't related to podman at all, but I find pretty weird that this started happening to me in the latest versions of podman, specially since they changed /tmp behavior on 5.6.1 and 5.5.0
I'm digging about this issue with related issues that I found. I have noted that podman is a common factor between these issues, and specifically the podman above version 5.5.0, can you please confirm if that is your case?
Yes, correct. I'm using podman version 5.6.1 (on Fedora 42)
Maybe this isn't related to podman at all, but I find pretty weird that this started happening to me in the latest versions of podman, specially since they changed /tmp behavior on 5.6.1 and 5.5.0
I'm running into a similar issue as OP. My devcontainer.json:
// For format details, see https://aka.ms/devcontainer.json. For config options, see the// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "Node.js & TypeScript",
"image": "mcr.microsoft.com/devcontainers/typescript-node:4-22-bookworm",
"features": {
"ghcr.io/devcontainers-community/npm-features/prettier:1": {},
"ghcr.io/guiyomh/features/just:0": {}
},
"postCreateCommand": "npm install --legacy-peer-deps",
"forwardPorts": [3000]
}
Using podman version 5.7.1, I end up with similar permission error logs
[2026-03-07T02:10:30.228Z]
[2026-03-07T02:10:30.228Z] Stop (1 ms): Run in container: cat /home/node/.vscode-server/data/Machine/settings.json
[2026-03-07T02:10:30.231Z] Start: Run in container: test ! -f '/home/node/.vscode-server/data/Machine/.writeMachineMCPConfigMarker' && set -o noclobber && mkdir -p '/home/node/.vscode-server/data/Machine' && { > '/home/node/.vscode-server/data/Machine/.writeMachineMCPConfigMarker' ; } 2> /dev/null
[2026-03-07T02:10:30.232Z]
[2026-03-07T02:10:30.232Z]
[2026-03-07T02:10:30.232Z] Exit code 1
[2026-03-07T02:10:30.232Z] Stop (1 ms): Run in container: test ! -f '/home/node/.vscode-server/data/Machine/.writeMachineMCPConfigMarker' && set -o noclobber && mkdir -p '/home/node/.vscode-server/data/Machine' && { > '/home/node/.vscode-server/data/Machine/.writeMachineMCPConfigMarker' ; } 2> /dev/null
[2026-03-07T02:10:30.233Z] Start: Run in container: test -d '/home/node/.vscode-server/bin/072586267e68ece9a47aa43f8c108e0dcbf44622'
[2026-03-07T02:10:30.234Z]
[2026-03-07T02:10:30.234Z]
[2026-03-07T02:10:30.234Z] Stop (1 ms): Run in container: test -d '/home/node/.vscode-server/bin/072586267e68ece9a47aa43f8c108e0dcbf44622'
[2026-03-07T02:10:30.234Z] Start: Run in container: test -d '/vscode/vscode-server/bin/linux-x64/072586267e68ece9a47aa43f8c108e0dcbf44622'
[2026-03-07T02:10:30.235Z]
[2026-03-07T02:10:30.236Z]
[2026-03-07T02:10:30.236Z] Stop (2 ms): Run in container: test -d '/vscode/vscode-server/bin/linux-x64/072586267e68ece9a47aa43f8c108e0dcbf44622'
[2026-03-07T02:10:30.236Z] Start: Run in container: /bin/sh
[2026-03-07T02:10:30.241Z] Start: Run in container: test -x '/home/node/.vscode-server/bin/072586267e68ece9a47aa43f8c108e0dcbf44622/bin/helpers/check-requirements.sh'
[2026-03-07T02:10:30.241Z] Start: Run in container: touch '/vscode/vscode-server/bin/linux-x64/072586267e68ece9a47aa43f8c108e0dcbf44622'
[2026-03-07T02:10:30.242Z]
[2026-03-07T02:10:30.242Z]
[2026-03-07T02:10:30.242Z] Stop (1 ms): Run in container: test -x '/home/node/.vscode-server/bin/072586267e68ece9a47aa43f8c108e0dcbf44622/bin/helpers/check-requirements.sh'
[2026-03-07T02:10:30.242Z] Start: Run in container: '/home/node/.vscode-server/bin/072586267e68ece9a47aa43f8c108e0dcbf44622/bin/helpers/check-requirements.sh'
[2026-03-07T02:10:30.289Z]
[2026-03-07T02:10:30.289Z]
[2026-03-07T02:10:30.289Z] Stop (47 ms): Run in container: '/home/node/.vscode-server/bin/072586267e68ece9a47aa43f8c108e0dcbf44622/bin/helpers/check-requirements.sh'
[2026-03-07T02:10:30.290Z] Start: Launching Dev Containers helper.
[2026-03-07T02:10:30.291Z] ssh-agent: SSH_AUTH_SOCK in container (/tmp/vscode-ssh-auth-f32077b4-ff12-43b7-a0ab-a706bedc4e6f.sock) forwarded to local host (/run/user/1000/gcr/ssh).
[2026-03-07T02:10:30.291Z] Start: Run in container: test -e /tmp/.X11-unix/X0
[2026-03-07T02:10:30.292Z]
[2026-03-07T02:10:30.293Z]
[2026-03-07T02:10:30.293Z] Exit code 1
[2026-03-07T02:10:30.293Z] Stop (2 ms): Run in container: test -e /tmp/.X11-unix/X0
[2026-03-07T02:10:30.293Z] Start: Run in container: mkdir -p '/tmp/.X11-unix'
[2026-03-07T02:10:30.295Z]
[2026-03-07T02:10:30.296Z] mkdir: cannot create directory '/tmp/.X11-unix': Permission denied
[2026-03-07T02:10:30.296Z] Exit code 1
[2026-03-07T02:10:30.296Z] Stop (3 ms): Run in container: mkdir -p '/tmp/.X11-unix'
[2026-03-07T02:10:30.305Z] Command in container failed: mkdir -p '/tmp/.X11-unix'
[2026-03-07T02:10:30.305Z] mkdir: cannot create directory '/tmp/.X11-unix': Permission denied
[2026-03-07T02:10:30.305Z] Exit code 1
[2026-03-07T02:10:30.342Z]
[2026-03-07T02:10:30.344Z]
[2026-03-07T02:10:30.344Z] Stop (103 ms): Run in container: touch '/vscode/vscode-server/bin/linux-x64/072586267e68ece9a47aa43f8c108e0dcbf44622'
Hi! Thanks Kees Bakker (@keestux) for the great analysis!
The problem still persists today, with Podman 5.8.0 and VSCode 1.110.1.
In my case, the problem occurs when using the Debian 12 base image with the java feature (with only the Debian 12 base image it works):
I use mcr.microsoft.com/devcontainers/base:2-trixie as the base of my devcontainer and
I get the error when I add one of the following features in devcontainer.json. If I remove them the build runs fine
ghcr.io/devcontainers/features/common-utils:2
Note: this feature is part of my base image. Having it in features used to work but I probably should've removed it
ghcr.io/rails/devcontainer/features/ruby
Note: installs after common-utils
ghcr.io/devcontainers/features/git:1 works fine however
devcontainer.json
// For format details, see https://containers.dev/implementors/json_reference/.// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/ruby
{
"name": "ruby_2_5_1_rails_5_2_6_devcontainer",
"dockerComposeFile": "compose.yaml",
"service": "rails",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
// Features to add to the dev container. More info: https://containers.dev/features."features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": "true"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": "false"
},
"ghcr.io/rails/devcontainer/features/ruby": {
"version": "2.5.1",
"versionManager": "rbenv"
},
"ghcr.io/rails/devcontainer/features/activestorage": {},
"ghcr.io/rails/devcontainer/features/mysql-client": {}
},
"containerEnv": {
"CAPYBARA_SERVER_PORT": "45678",
"SELENIUM_HOST": "selenium",
"KAMAL_REGISTRY_PASSWORD": "$KAMAL_REGISTRY_PASSWORD",
"DATABASE_URL": "mysql2://mariadb",
"MAILCATCHER_ADDRESS": "mailcatcher"
},
// Use 'forwardPorts' to make a list of ports inside the container available locally."forwardPorts": [
3000
],
// Configure tool-specific properties.// "customizations": {},
// Uncomment to connect as root instead. More info: https://containers.dev/implementors/json_reference/#remoteUser.// "remoteUser": "root",// Use 'postCreateCommand' to run commands after the container is created."postCreateCommand": "fc-cache -fv && bin/setup --skip-server"}
Dockerfile
FROM mcr.microsoft.com/devcontainers/base:2-trixie
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8
# libxinerama1, libcups2 and libsm-dev are dependencies for libreoffice 6.4
# default-jre is also needed by libreoffice but not a dependency
RUN apt-get update -y && apt-get -y install --no-install-recommends \
default-jre \
imagemagick \
libxinerama1 \
libcups2 \
libsm-dev \
&& rm -rf /var/lib/apt/lists/*
# install libreoffice 6.4
RUN wget -P /tmp https://downloadarchive.documentfoundation.org/libreoffice/old/6.4.7.2/deb/x86_64/LibreOffice_6.4.7.2_Linux_x86-64_deb.tar.gz && \
tar -xvzf /tmp/LibreOffice_6.4.7.2_Linux_x86-64_deb.tar.gz -C /tmp && \
dpkg -i /tmp/LibreOffice_6.4.7.2_Linux_x86-64_deb/DEBS/*.deb && \
ln -n -s /opt/libreoffice6.4/ /usr/lib/libreoffice && \
ln -n -s /usr/lib/libreoffice/program/soffice /usr/bin/soffice && \
ln -n -s /usr/lib/libreoffice/program/soffice /usr/bin/libreoffice && \
rm /tmp/LibreOffice_6.4.7.2_Linux_x86-64_deb.tar.gz && \
rm -rf /tmp/LibreOffice_6.4.7.2_Linux_x86-64_deb
USER vscode
ENV BINDING="0.0.0.0"
compose.yaml
name: "ruby_2_5_1_rails_5_2_6_devcontainer"
services:
rails:
build:
context: ..
dockerfile: .devcontainer/Dockerfile
# Overrides default command so things don't shut down after the process ends.
command: sleep infinity
# Uncomment the next line to use a non-root user for all processes.
# user: vscode
depends_on:
- selenium
- mariadb
- mailcatcher
selenium:
image: selenium/standalone-chromium
restart: unless-stopped
mariadb:
image: mariadb:11.4.10
restart: unless-stopped
environment:
MARIADB_ROOT_PASSWORD: root # newer versions
MYSQL_ROOT_PASSWORD: root # older versions
volumes:
- mariadb-data:/var/lib/mysql
ports:
- "3306:3306"
mailcatcher:
restart: on-failure
image: sj26/mailcatcher:v0.10.0
ports:
- "1080:1080" # Web Interface
- "1025:1025" # SMTP Port
volumes:
mariadb-data:
I am hitting this issue too; it seems to be related to using features. When I am not using features, it seems to work. Without having checked, I assume the devcontainer CLI adjusts /tmp/ for Features in a way that causes privilege issues. If someone here is better at Typescript than I am, please quickly check https://github.com/devcontainers/cli to see whether something is being done with /tmp/.
Mounting a tmpfs as described in #1480 (comment) does indeed solve the issue for now, but I'd like to know what the actual culprit it so I don't have to supply such runArgs every time.
Activity
v-Kaniska244 commentedon Sep 17, 2025
Hello Kees Bakker (@keestux) ,
Thank you for reporting this issue. I could see that you are using a very old dev container image as the base image for your dev container
mcr.microsoft.com/vscode/devcontainers/python:0-3.11. That could very well be the reason behind this issue with git feature you reported.Would you kindly use latest images such as
mcr.microsoft.com/vscode/devcontainers/python:2-3.11ormcr.microsoft.com/vscode/devcontainers/python:2-3.11-bullseyeand see if the issue persists?keestux commentedon Sep 17, 2025
Unfortunately that didn't make a difference.
I must say, debugging this problem is extremely difficult, at least for me it is.
v-Kaniska244 commentedon Sep 18, 2025
Hello Kees Bakker (@keestux),
Would you kindly share the complete log for this scenario with both
show container logandshow previous log options? That would be help us a great deal to investigate this further.Also you are using python pre-built dev container image which already includes the git feature in its dev container configuration. So you shouldn’t need to install it all over again.
keestux commentedon Sep 18, 2025
Hey @Kaniska244
I cannot (yet) show you any logging, but hold on.
What I have been doing since yesterday is to use
@devcontainers/clito go through multiple edit-build-test cycles. Instead of loading features from the web I copied a feature from thesrctree of this repo and placed it in a subdirectory of the.devcontainer. I worked my way through stripping theinstall.shof the "feature". The start situation is when the build container has a1777for/tmp. And finally ended up with aninstall.shthat led to a container with mode755for/tmp.What I now have is this:
The files are really small, here they are
With this setup I did:
npm install @devcontainers/clinpx devcontainer up --workspace-folder .npx devcontainer exec --workspace-folder . /bin/bash -c 'ls -ld /tmp/'The output of the last command is:
Next, delete all commands from
install.shto getRebuild the container (first cleanup the previous images and container). Run the
lsagain. I then getkeestux commentedon Sep 18, 2025
In the
install.sh, anything written to/tmpseems to be sufficient to avoid the755mode. This works too:keestux commentedon Sep 18, 2025
I can provide the output of the
npx devcontainer up --workspace-folder .. There is no difference between the good and bad case, except if theinstall.shwrites something to stdout.Let me know if you still want that log.
Yokutto commentedon Sep 18, 2025
Hi Kees Bakker (@keestux),
I'm digging about this issue with related issues that I found. I have noted that
podmanis a common factor between these issues, and specifically the podman above version5.5.0, can you please confirm if that is your case?Maybe this isn't related to podman at all, but I find pretty weird that this started happening to me in the latest versions of podman, specially since they changed
/tmpbehavior on 5.6.1 and 5.5.0keestux commentedon Sep 19, 2025
Yes, correct. I'm using podman version 5.6.1 (on Fedora 42)
Ah, interesting.
keestux commentedon Sep 21, 2025
Where can I find the source code of devcontainers? Where can I report (podman) issues for devcontainers?
v-Kaniska244 commentedon Sep 22, 2025
Hello Kees Bakker (@keestux) ,
I am checking on this.Will try to update by end of this week.
v-Kaniska244 commentedon Sep 29, 2025
Updated in devcontainers/images#1556 (comment)
NahsiN commentedon Mar 7, 2026
I'm running into a similar issue as OP. My devcontainer.json:
Using podman version 5.7.1, I end up with similar permission error logs
I've also seen a similar issue posted on reddit
kafumanto commentedon Mar 9, 2026
Hi! Thanks Kees Bakker (@keestux) for the great analysis!
The problem still persists today, with Podman 5.8.0 and VSCode 1.110.1.
In my case, the problem occurs when using the Debian 12 base image with the java feature (with only the Debian 12 base image it works):
{ "name": "Debian + Java 21", "image": "mcr.microsoft.com/devcontainers/base:debian-12", "features": { "ghcr.io/devcontainers/features/java:1": { "version": "21" } } }The workaround (for me, and for the java feature) is to force
/tmpto be a tmpfs with mode 1777:{ // ... "runArgs": [ "--tmpfs=/tmp:rw,exec,nosuid,nodev,mode=1777" ] }sineme commentedon Apr 15, 2026
I am using docker and also have issues with
/tmpdocker version
error log excerpt
I use
mcr.microsoft.com/devcontainers/base:2-trixieas the base of my devcontainer andI get the error when I add one of the following features in
devcontainer.json. If I remove them the build runs fineghcr.io/devcontainers/features/common-utils:2featuresused to work but I probably should've removed itghcr.io/rails/devcontainer/features/rubycommon-utilsghcr.io/devcontainers/features/git:1works fine howeverdevcontainer.json
Dockerfile
compose.yaml
georglauterbach commentedon Jul 12, 2026
I am hitting this issue too; it seems to be related to using
features. When I am not usingfeatures, it seems to work. Without having checked, I assume the devcontainer CLI adjusts/tmp/for Features in a way that causes privilege issues. If someone here is better at Typescript than I am, please quickly check https://github.com/devcontainers/cli to see whether something is being done with/tmp/.Mounting a
tmpfsas described in #1480 (comment) does indeed solve the issue for now, but I'd like to know what the actual culprit it so I don't have to supply suchrunArgsevery time.chore: enable using Podman for Dev Container
chore: enable using Podman for Dev Container