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

Wayland socket not accessible inside vscode (snap) #95384

Closed
christianrauch opened this issue Apr 15, 2020 · 3 comments
Closed

Wayland socket not accessible inside vscode (snap) #95384

christianrauch opened this issue Apr 15, 2020 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities linux Issues with VS Code on Linux snap Issues related to the snap package wont-fix
Milestone

Comments

@christianrauch
Copy link

  • VSCode Version: 1.44.1 (snap)
  • OS Version: Ubuntu 18.04

This is a continuation of #80936. I am unable to comment on the original issue and will, therefore, give more details in this new issue.

Steps to Reproduce:

  1. install the snap version of vscode: snap install code --classic
  2. open code in a Wayland session (via Xwayland)
  3. open integrated terminal via Ctrl+`
  4. run weston-terminal

Does this issue occur when all extensions are disabled?: Yes

Details:
Wayland clients connect via a socket to the server. The default socket is $XDG_RUNTIME_DIR/wayland-0, where XDG_RUNTIME_DIR will point to /run/user/$UID in a normal environment.

In gnome-terminal or xterm, this socket is accessible: file $XDG_RUNTIME_DIR/wayland-0 will provide /run/user/1000/wayland-0: socket.

In the snap version of code, this socket is not accessible: /run/user/1000/snap.code/wayland-0: cannot open '/run/user/1000/snap.code/wayland-0' (No such file or directory). One will notice that XDG_RUNTIME_DIR is now pointing to the non-existing subdirectory snap.code inside /run/user/$UID.

The Debian package offered on https://code.visualstudio.com does not show this issue. I presume that this is therefore caused by the snap confinement, and not by vscode per se.

@joaomoreno joaomoreno added bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities linux Issues with VS Code on Linux snap Issues related to the snap package labels Apr 17, 2020
@joaomoreno joaomoreno added this to the Backlog milestone Apr 17, 2020
@tim-rex
Copy link

tim-rex commented May 27, 2020

I've just encountered exactly this issue, installed via snap on Fedora 32

Version: 1.45.1
Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:27:22.494Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Linux x64 5.6.6-300.fc32.x86_64 snap

Workaround for the moment is to configure an override in launch.json

           "environment": [            
                {
                    "name": "XDG_RUNTIME_DIR",
                    "value": "/run/user/1000"
                }

@joaomoreno
Copy link
Member

One will notice that XDG_RUNTIME_DIR is now pointing to the non-existing subdirectory snap.code inside /run/user/$UID.

The directory does exist. But wayland won't be there unfortunately. Closing it as won't fix, given @tim-rex's workaround.

@christianrauch
Copy link
Author

Can this not be fixed with the snap 'desktop-helpers'? See https://discourse.ubuntu.com/t/snaps-and-sharing-mirs-wayland-socket/7539 section 'The existing “wayland” interface':

But inside a snap, $XDG_RUNTIME_DIR is a randomly generated subdirectory of the form: /run/user/$UID/XXXXXX - and AppArmor rules are used to confine snaps inside this directory.
The wayland interface has an exception to allow a snap to access /run/user/$UID/wayland-0 - and nothing else in that directory.
[...]
Those using the “desktop-helpers” project have this done automatically for them, [...].

I think this is a packaging issue and should not require workarounds on the user's side.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities linux Issues with VS Code on Linux snap Issues related to the snap package wont-fix
Projects
None yet
Development

No branches or pull requests

3 participants