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

Support shared home folder #10674

Open
scarf005 opened this issue Feb 1, 2025 · 4 comments
Open

Support shared home folder #10674

scarf005 opened this issue Feb 1, 2025 · 4 comments
Assignees
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality
Milestone

Comments

@scarf005
Copy link

scarf005 commented Feb 1, 2025

  • VSCode Version: 1.96.4
  • Local OS Version: Fedora 41 (Kinoite)
  • Remote OS Version: Ubuntu 24.04.1 LTS
  • Remote Extension/Connection Type: Dev Containers - VS Code Server
  • Logs: log.log

Steps to Reproduce:

encountered while following https://prismlauncher.org/wiki/development/build-instructions/linux/

  1. create ubuntu distrobox with distrobox create --image ubuntu:latest --name prism; distrobox enter prism
  2. run Dev Containers: Attach to Running Container and choose prism
[761 ms] Command in container failed: mkdir -p /home/scarf/.vscode-server/bin/cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba_1738434099427
[761 ms] mkdir: cannot create directory '/home/scarf/.vscode-server': File exists
scarf@fedora /r/m/h/s/r/e/o/PrismLauncher (develop)> lsd -alh ~/.vscode-server 
lrwxrwxrwx. scarf scarf 23 B 2024-09-28 토 00:20:36  /home/scarf/.vscode-server ⇒ /var/tmp/.vscode-server
scarf@fedora /r/m/h/s/r/e/o/PrismLauncher (develop)> lsd -alh /var/tmp/.vscode-server
lsd: /var/tmp/.vscode-server: No such file or directory (os error 2).

maybe it's because it's symlinked? what's weird is i was already attaching an existing distrobox with vscode and this is the second container where i get this error.

Does this issue occur when you try this locally?: No
Does this issue occur when you try this locally and all extensions are disabled?: Yes

@vs-code-engineering vs-code-engineering bot added the containers Issue in vscode-remote containers label Feb 1, 2025
@chrmarti
Copy link
Contributor

chrmarti commented Feb 3, 2025

This works for me with a regular distro when I create the symlink and the target folder myself.

Not sure I understand your setup: Is /var/tmp writable? Why didn't you create the target folder when you created the symlink? Does it work when you create the target folder?

@chrmarti chrmarti added the info-needed Issue requires more information from poster label Feb 3, 2025
@scarf005
Copy link
Author

scarf005 commented Feb 3, 2025

tl;dr: i think this is neither related to immutable distro or distrobox, but the extension being unable to attach to multiple running containers simultaneously. (e.g have one window connect to container A and another window connected to container B)

Is /var/tmp writable?

scarf@fedora /v/h/scarf> distrobox enter prism
📦[scarf@prism scarf]$ echo hi > /var/tmp/hi
📦[scarf@prism scarf]$ ls -alh /var/tmp/hi
-rw-r--r--. 1 scarf ubuntu 3  2월  3 19:05 /var/tmp/hi
📦[scarf@prism scarf]$ 

I think so.

Why didn't you create the target folder when you created the symlink? Does it work when you create the target folder?

are you referring to .vscode-server? i don't remember how it got generated but the symlink was there, i don't remember manually create it. after moving it to .vscode-server.bak, i was able to attach on running container.

scarf@fedora ~/r/e/o/prismlauncher.org (docs/update-linux-qt-deps)> lsd -alh ~/.vscode-server
drwxr-xr-x. 524288 524288  64 B  2025-02-03 월 19:09:20  .
drwx------. scarf  scarf  1.6 KB 2025-02-03 월 19:09:15  ..
drwxr-xr-x. 524288 524288  80 B  2025-02-03 월 19:09:17  bin
drwxr-xr-x. 524288 524288  84 B  2025-02-03 월 19:09:21  data
drwx------. 524288 524288 226 B  2025-02-03 월 19:09:25  extensions
drwxr-xr-x. 524288 524288 208 B  2025-02-03 월 19:09:25  extensionsCache

scarf@fedora ~/r/e/o/prismlauncher.org (docs/update-linux-qt-deps) [2]> sudo /bin/ls ~/.vscode-server/extensions/
extensions.json         github.copilot-chat-0.23.2
github.copilot-1.261.0  github.vscode-pull-request-github-0.103.2024121117
scarf@fedora ~/r/e/o/prismlauncher.org (docs/update-linux-qt-deps)> sudo /bin/ls -alh ~/.vscode-server/extensions/
합계 4.0K
drwx------. 1 524288 524288  226  2월  3일  19:09 .
drwxr-xr-x. 1 524288 524288   64  2월  3일  19:09 ..
-rw-r--r--. 1 524288 524288 2.0K  2월  3일  19:09 extensions.json
drwxr-xr-x. 1 524288 524288  144  2월  3일  19:09 github.copilot-1.261.0
drwxr-xr-x. 1 524288 524288  830  2월  3일  19:09 github.copilot-chat-0.23.2
drwxr-xr-x. 1 524288 524288  826  2월  3일  19:09 github.vscode-pull-request-github-0.103.2024121117
scarf@fedora ~/r/e/o/prismlauncher.org (docs/update-linux-qt-deps)> sudo /bin/ls ~/.vscode-server/bin
cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba
scarf@fedora ~/r/e/o/prismlauncher.org (docs/update-linux-qt-deps)> sudo /bin/ls -alh ~/.vscode-server/extensions/

however, now i'm unable to attach to existing session with following errors:

v/h/s/r/c/Cataclysm (feat/report-save-file-version)>  code --folder-uri vscode-remote://attached-container+$(printf "fedora" | xxd -p)/$(pwd)

[4013 ms] Start: Run in container: cat '/home/scarf/.vscode-server/data/Machine/.connection-token-cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba' 2>/dev/null || (umask 377 && echo '81d3d282-a360-49b8-83aa-01c07bd47017' >'/home/scarf/.vscode-server/data/Machine/.connection-token-cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba-4050301f-cd57-4b75-a989-7876e8d1e8be' && mv -n '/home/scarf/.vscode-server/data/Machine/.connection-token-cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba-4050301f-cd57-4b75-a989-7876e8d1e8be' '/home/scarf/.vscode-server/data/Machine/.connection-token-cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba' && rm -f '/home/scarf/.vscode-server/data/Machine/.connection-token-cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba-4050301f-cd57-4b75-a989-7876e8d1e8be' && cat '/home/scarf/.vscode-server/data/Machine/.connection-token-cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba')
[4016 ms] 
[4016 ms] /bin/sh: line 79: /home/scarf/.vscode-server/data/Machine/.connection-token-cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba-4050301f-cd57-4b75-a989-7876e8d1e8be: Permission denied
[4016 ms] Exit code 1
[4019 ms] Command in container failed: cat '/home/scarf/.vscode-server/data/Machine/.connection-token-cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba' 2>/dev/null || (umask 377 && echo '81d3d282-a360-49b8-83aa-01c07bd47017' >'/home/scarf/.vscode-server/data/Machine/.connection-token-cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba-4050301f-cd57-4b75-a989-7876e8d1e8be' && mv -n '/home/scarf/.vscode-server/data/Machine/.connection-token-cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba-4050301f-cd57-4b75-a989-7876e8d1e8be' '/home/scarf/.vscode-server/data/Machine/.connection-token-cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba' && rm -f '/home/scarf/.vscode-server/data/Machine/.connection-token-cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba-4050301f-cd57-4b75-a989-7876e8d1e8be' && cat '/home/scarf/.vscode-server/data/Machine/.connection-token-cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba')
[4019 ms] /bin/sh: line 79: /home/scarf/.vscode-server/data/Machine/.connection-token-cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba-4050301f-cd57-4b75-a989-7876e8d1e8be: Permission denied
[4019 ms] Exit code 1

it seems to be due to sessions created by Attach to running container not being namespaced; is it intentional that it's not possible to attach to multiple running container?

@chrmarti
Copy link
Contributor

chrmarti commented Feb 3, 2025

Is the home folder shared between containers? That currently doesn't work and could explain the permission error.

@scarf005 scarf005 changed the title Cannot attach to running container on immutable distro Cannot attach to multiple running containers Feb 3, 2025
@scarf005
Copy link
Author

scarf005 commented Feb 3, 2025

I see, thanks for the confirmation. I'm switching between multiple distrobox containers to encapsulate system packages but they share the same home directory, so i think that was the cause of the issue. Could the team consider this feature (shared home directory) in their future roadmap? This would make attaching multiple distrobox containers simultaneously possible. thanks for your time.

@chrmarti chrmarti changed the title Cannot attach to multiple running containers Support shared home folder Feb 3, 2025
@chrmarti chrmarti added feature-request Request for new features or functionality and removed info-needed Issue requires more information from poster labels Feb 3, 2025
@chrmarti chrmarti added this to the Backlog milestone Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants