NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.6k stars 13.76k forks source link

VS Code 1.92.2 doesn't start in nix-shell #340553

Open connectedblue opened 3 weeks ago

connectedblue commented 3 weeks ago

Describe the bug

code . does not start the IDE window from inside a nix-shell. The command just exits. If you run with the verbose flag then you get the message below.

However code serve-web does and can be accessed in a local browser.

Steps To Reproduce

Steps to reproduce the behavior:

  1. nix-shell -p vscode
  2. code --verbose .
  3. message says:
[138591:0908/175051.634234:FATAL:setuid_sandbox_host.cc(158)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /nix/store/49bikavxb70qyymsnblgmp3ddcmxy81x-vscode-1.92.2/lib/vscode/chrome-sandbox is owned by root and has mode 4755.
  1. If you do a sudo chmod 4755 ... as per the instructions, then code . works as normal

    Expected behavior

    A clear and concise description of what you expected to happen.

It should have worked without me having to do the intermediate chmod command.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Notify maintainers

@eadwu @synthetica @bobby285271 @Enzime

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
this path will be fetched (0.00 MiB download, 0.00 MiB unpacked):
  /nix/store/sk98av0x2sv83yjn6wkr26wmyb7hirva-nix-info
copying path '/nix/store/sk98av0x2sv83yjn6wkr26wmyb7hirva-nix-info' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 6.8.0-41-generic, Ubuntu, 24.04.1 LTS (Noble Numbat), nobuild`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.24.5`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

Add a :+1: reaction to issues you find important.

RapidPencil commented 3 weeks ago

This appears to happen to Ubuntu 24.04 users for multiple electron apps.

This resolves it for me (but this is obviously not a proper fix):

sysctl -w kernel.apparmor_restrict_unprivileged_userns=0