microsoft / microsoft/vscode-remote-release
Podman: .vscode-server directory creation in wrong place when remoteUser is defined
@chrmarti is already working on this.
Since Feb 15, 2021.
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 470
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
- VSCode Version: 1.53.0
- Local OS Version: Fedora 33
- Remote OS Version: Python 3 container
- Remote Extension/Connection Type: SSH/Docker/WSL: Podman (version 2.2.1)
- Remote Containers Version: 0.158.0
Steps to Reproduce:
- Clone project and add development container files (I used the Python 3 environment type)
- Ensure a "remoteUser" is defined in the devcontainer.json file (I left it at the default of "vscode")
- Rebuild and reopen the project in container
When the container runs it tests for the existence of and then tries to create the .vscode-server in the root users directory (i.e. /root/.vscode-server) instead of in the directory home directory of the remoteUser (i.e. vscode)
[TRUNCATED]
[2021-02-08T22:24:16.878Z] [PID 35757] [2114 ms] Start: Run in container: uname -m
[2021-02-08T22:24:17.017Z] [PID 35757] [2253 ms] x86_64
[2021-02-08T22:24:17.017Z] [PID 35757] [2253 ms]
[2021-02-08T22:24:17.017Z] [PID 35757] [2253 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
[2021-02-08T22:24:17.019Z] [PID 35757] [2255 ms] PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
[2021-02-08T22:24:17.020Z] [PID 35757] [2256 ms]
[2021-02-08T22:24:17.020Z] [PID 35757] [2256 ms] Start: Run in container: cat /etc/passwd
[2021-02-08T22:24:17.022Z] [PID 35757] [2258 ms] Start: Updating configuration state
[2021-02-08T22:24:17.024Z] [PID 35757] [2260 ms] Start: Setup shutdown monitor
[2021-02-08T22:24:17.025Z] [PID 35757] [2261 ms] Forking shutdown monitor: /home/bevans/.vscode/extensions/ms-vscode-remote.remote-containers-0.158.0/dist/shutdownMonitorProcess /run/user/4400/vscode-remote-containers-8df5c00fb5f95cd5a12ff80b44893507117f10a9.sock singleContainer Info /home/bevans/.config/Code/logs/20210208T112310/exthost7/ms-vscode-remote.remote-containers 1612823054764
[2021-02-08T22:24:17.030Z] [PID 35757] [2266 ms] Start: Run in container: test -d /root/.vscode-server
[2021-02-08T22:24:17.031Z] [PID 35757] [2267 ms]
[2021-02-08T22:24:17.031Z] [PID 35757] [2267 ms]
[2021-02-08T22:24:17.031Z] [PID 35757] [2267 ms] Exit code 1
[2021-02-08T22:24:17.031Z] [PID 35757] [2267 ms] Start: Run in container: test -d /root/.vscode-remote
[2021-02-08T22:24:17.032Z] [PID 35757] [2268 ms]
[2021-02-08T22:24:17.032Z] [PID 35757] [2268 ms]
[2021-02-08T22:24:17.032Z] [PID 35757] [2268 ms] Exit code 1
[2021-02-08T22:24:17.032Z] [PID 35757] [2268 ms] Start: Run in container: set -o noclobber ; mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null
[2021-02-08T22:24:17.036Z] [PID 35757] [2272 ms]
[2021-02-08T22:24:17.036Z] [PID 35757] [2272 ms] mkdir: cannot create directory ‘/root’: Permission denied
[2021-02-08T22:24:17.036Z] [PID 35757] [2272 ms] Exit code 1
[2021-02-08T22:24:17.036Z] [PID 35757] [2272 ms] Start: Run in container: cat /root/.vscode-server/data/Machine/settings.json
[2021-02-08T22:24:17.039Z] [PID 35757] [2275 ms]
[2021-02-08T22:24:17.039Z] [PID 35757] [2275 ms] cat: /root/.vscode-server/data/Machine/settings.json: Permission denied
[2021-02-08T22:24:17.039Z] [PID 35757] [2275 ms] Exit code 1
[2021-02-08T22:24:17.039Z] [PID 35757] [2275 ms] Start: Run in container: test -d /root/.vscode-server/bin/8490d3dde47c57ba65ec40dd192d014fd2113496
[2021-02-08T22:24:17.040Z] [PID 35757] [2276 ms]
[2021-02-08T22:24:17.040Z] [PID 35757] [2276 ms]
[2021-02-08T22:24:17.040Z] [PID 35757] [2276 ms] Exit code 1
[2021-02-08T22:24:17.040Z] [PID 35757] [2276 ms] Start: Run in container: test -d /vscode/vscode-server/bin/x64/8490d3dde47c57ba65ec40dd192d014fd2113496
[2021-02-08T22:24:17.040Z] [PID 35757] [2276 ms]
[2021-02-08T22:24:17.040Z] [PID 35757] [2276 ms]
[2021-02-08T22:24:17.040Z] [PID 35757] [2276 ms] Start: Run in container: mkdir -p '/root/.vscode-server/bin' && ln -s '/vscode/vscode-server/bin/x64/8490d3dde47c57ba65ec40dd192d014fd2113496' '/root/.vscode-server/bin/8490d3dde47c57ba65ec40dd192d014fd2113496'
[2021-02-08T22:24:17.043Z] [PID 35757] [2279 ms]
[2021-02-08T22:24:17.044Z] [PID 35757] [2280 ms] mkdir: cannot create directory ‘/root’: Permission denied
[2021-02-08T22:24:17.044Z] [PID 35757] [2280 ms] Exit code 1
[2021-02-08T22:24:17.047Z] [PID 35757] [2283 ms] Command in container failed: mkdir -p '/root/.vscode-server/bin' && ln -s '/vscode/vscode-server/bin/x64/8490d3dde47c57ba65ec40dd192d014fd2113496' '/root/.vscode-server/bin/8490d3dde47c57ba65ec40dd192d014fd2113496'
devcontainer.json
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.158.0/containers/python-3
{
"name": "Python 3",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
// Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9
"VARIANT": "3",
// Options
"INSTALL_NODE": "false",
"NODE_VERSION": "lts/*"
}
},
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"python.pythonPath": "/usr/local/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip3 install --user -r requirements.txt",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
NOTE: If I comment out the remoteUser variable in the devcontainer.json so that the container uses the root user, opening the project in the container is successful.
Does this issue occur when you try this locally?: No
Does this issue occur when you try this locally and all extensions are disabled?: No
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.