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

VS Code 1.79.0 use root user can not open with cmd --no-sandbox --user-data-dir #184687

Closed
sjwyz opened this issue Jun 9, 2023 · 42 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release insiders-released Patch has been released in VS Code Insiders linux Issues with VS Code on Linux macos Issues with VS Code on MAC/OS X sandbox Running VSCode in a node-free environment verified Verification succeeded windows VS Code on Windows issues workbench-cli VS Code Command line issues

Comments

@sjwyz
Copy link

sjwyz commented Jun 9, 2023

Type: Bug

  • VS Code Version: 1.79.0
  • OS Version: rockylinux9.2

Steps to Reproduce:

  1. use root user
  2. code --no-sandbox --user-data-dir=/home/vscode #Display an empty window
  3. vim /var/log/messages #show some err msg
    Jun 9 15:27:06 R9 systemd[1]: systemd-coredump@610-6281-0.service: Deactivated successfully.
    Jun 9 15:27:06 R9 systemd[1]: Started Process Core Dump (PID 6287/UID 0).
    Jun 9 15:27:06 R9 systemd-coredump[6288]: Resource limits disable core dumping for process 6286 (code).
    Jun 9 15:27:06 R9 systemd-coredump[6288]: Process 6286 (code) of user 0 dumped core.
    Jun 9 15:27:06 R9 systemd[1]: systemd-coredump@611-6287-0.service: Deactivated successfully.
    Jun 9 15:27:06 R9 systemd[1]: Started Process Core Dump (PID 6293/UID 0).
    Jun 9 15:27:06 R9 systemd-coredump[6294]: Resource limits disable core dumping for process 6292 (code).
    Jun 9 15:27:06 R9 systemd-coredump[6294]: Process 6292 (code) of user 0 dumped core.
    Jun 9 15:27:06 R9 systemd[1]: systemd-coredump@612-6293-0.service: Deactivated successfully.
    Jun 9 15:27:06 R9 systemd[1]: Started Process Core Dump (PID 6299/UID 0).
    Jun 9 15:27:06 R9 systemd-coredump[6300]: Resource limits disable core dumping for process 6298 (code).
    Jun 9 15:27:06 R9 systemd-coredump[6300]: Process 6298 (code) of user 0 dumped core.
    Jun 9 15:27:06 R9 systemd[1]: systemd-coredump@613-6299-0.service: Deactivated successfully.
    Jun 9 15:27:06 R9 systemd[1]: Started Process Core Dump (PID 6305/UID 0).
    Jun 9 15:27:06 R9 systemd-coredump[6306]: Resource limits disable core dumping for process 6304 (code).
    Jun 9 15:27:06 R9 systemd-coredump[6306]: Process 6304 (code) of user 0 dumped core.
    Jun 9 15:27:06 R9 systemd[1]: systemd-coredump@614-6305-0.service: Deactivated successfully.
    Jun 9 15:27:06 R9 systemd[1]: Started Process Core Dump (PID 6311/UID 0).
    Jun 9 15:27:06 R9 systemd-coredump[6313]: Resource limits disable core dumping for process 6310 (code).
    Jun 9 15:27:06 R9 systemd-coredump[6313]: Process 6310 (code) of user 0 dumped core.
    Jun 9 15:27:06 R9 systemd[1]: systemd-coredump@615-6311-0.service: Deactivated successfully.
    Jun 9 15:27:32 R9 systemd[1]: virtqemud.service: Deactivated successfully.
    Jun 9 15:27:44 R9 systemd[1]: Crash recovery kernel arming was skipped because of an unmet condition check (ConditionKernelCommandLine=crashkernel).
    Jun 9 15:27:49 R9 kernel: show_signal: 30 callbacks suppressed
    Jun 9 15:27:49 R9 kernel: traps: code[6431] trap int3 ip:56500835a0de sp:7ffee17641e0 error:0 in code[565005131000+70a8000]
    Jun 9 15:27:49 R9 systemd[1]: Started Process Core Dump (PID 6432/UID 0).
    Jun 9 15:27:49 R9 systemd-coredump[6433]: Resource limits disable core dumping for process 6431 (code).
    Jun 9 15:27:49 R9 systemd-coredump[6433]: Process 6431 (code) of user 0 dumped core.
    Jun 9 15:27:49 R9 systemd[1]: systemd-coredump@616-6432-0.service: Deactivated successfully.
    Jun 9 15:27:49 R9 kernel: traps: code[6439] trap int3 ip:55fc8b24f0de sp:7ffdc2d3cd70 error:0 in code[55fc88026000+70a8000]
    Jun 9 15:27:49 R9 systemd[1]: Started Process Core Dump (PID 6441/UID 0).
    Jun 9 15:27:49 R9 systemd-coredump[6442]: Resource limits disable core dumping for process 6439 (code).
    Jun 9 15:27:49 R9 systemd-coredump[6442]: Process 6439 (code) of user 0 dumped core.
    Jun 9 15:27:49 R9 systemd[1]: systemd-coredump@617-6441-0.service: Deactivated successfully.
    Jun 9 15:27:49 R9 kernel: traps: code[6464] trap int3 ip:564e6e8100de sp:7ffe4a79e980 error:0 in code[564e6b5e7000+70a8000]
    Jun 9 15:27:49 R9 systemd[1]: Started Process Core Dump (PID 6465/UID 0).
    Jun 9 15:27:49 R9 systemd-coredump[6466]: Resource limits disable core dumping for process 6464 (code).
    Jun 9 15:27:49 R9 systemd-coredump[6466]: Process 6464 (code) of user 0 dumped core.
    Jun 9 15:27:49 R9 systemd[1]: systemd-coredump@618-6465-0.service: Deactivated successfully.
    Jun 9 15:27:49 R9 kernel: traps: code[6470] trap int3 ip:55953e5650de sp:7ffd8aa79710 error:0 in code[55953b33c000+70a8000]
    Jun 9 15:27:49 R9 systemd[1]: Started Process Core Dump (PID 6471/UID 0).
    Jun 9 15:27:49 R9 systemd-coredump[6472]: Resource limits disable core dumping for process 6470 (code).
    Jun 9 15:27:49 R9 systemd-coredump[6472]: Process 6470 (code) of user 0 dumped core.
    Jun 9 15:27:49 R9 systemd[1]: systemd-coredump@619-6471-0.service: Deactivated successfully.
    Jun 9 15:27:49 R9 kernel: traps: code[6476] trap int3 ip:5641a50f00de sp:7ffc1ea51e40 error:0 in code[5641a1ec7000+70a8000]
    Jun 9 15:27:49 R9 systemd[1]: Started Process Core Dump (PID 6477/UID 0).
    Jun 9 15:27:49 R9 systemd-coredump[6478]: Resource limits disable core dumping for process 6476 (code).

VS Code version: Code - Insiders 1.79.0-insider (b380da4, 2023-06-07T14:26:54.152Z)
OS version: Windows_NT x64 10.0.22621
Modes:

@Arko109
Copy link

Arko109 commented Jun 9, 2023

Same issue after updating to 1.79.0 on Windows 10 (19045.2965) and trying to launch Code as admin with --no-sandbox --disable-gpu-sandbox

Logs [main 2023-06-09T08:46:43.113Z] IPC Object URL: Registered new channel vscode:aba3ed2f-13a2-43fe-8cd1-7c38f6cb798b. [main 2023-06-09T08:46:43.113Z] window#validateWindowState: validating window state on 2 display(s) { mode: 0, x: 2381, y: 0, width: 1459, height: 846 } [main 2023-06-09T08:46:43.113Z] window#validateWindowState: multi-monitor working area { x: 1920, y: 0, width: 1920, height: 1040 } [main 2023-06-09T08:46:43.113Z] window#ctor: using window state { mode: 0, x: 2381, y: 0, width: 1459, height: 846 } [main 2023-06-09T08:46:43.158Z] window#load: attempt to load window (id: 1) [main 2023-06-09T08:46:43.172Z] windowsManager#open used window count 1 (workspacesToOpen: 0, foldersToOpen: 0, emptyToRestore: 1, emptyToOpen: 0) [main 2023-06-09T08:46:43.172Z] lifecycle (main): phase changed (value: 3) [main 2023-06-09T08:46:43.177Z] resolveShellEnv(): skipped (Windows) [main 2023-06-09T08:46:43.177Z] update#setState idle Renderer process launch-failed - see https://www.electronjs.org/docs/tutorial/application-debugging for potential debugging information. [main 2023-06-09T08:46:43.194Z] CodeWindow: renderer process gone (reason: launch-failed, code: 18) [33572:0609/104643.231:INFO:electron_api_web_frame_main.cc(235)] Attempt to setup WebFrameMain connection while render frame is disposed [main 2023-06-09T08:46:43.227Z] [File Watcher (node.js)] Started watching: 'c:\Users\grinenkoa\AppData\Roaming\Code\User' Renderer process launch-failed - see https://www.electronjs.org/docs/tutorial/application-debugging for potential debugging information. [main 2023-06-09T08:46:43.230Z] CodeWindow: renderer process gone (reason: launch-failed, code: 18)

@bpasero bpasero assigned deepak1556 and unassigned aeschli Jun 9, 2023
@bpasero bpasero added the sandbox Running VSCode in a node-free environment label Jun 9, 2023
@deepak1556
Copy link
Collaborator

@sjwyz can you start with --no-sandbox --disable-gpu-sandbox --user-data-dir=/tmp/vscode on your linux setup and see if the issue persists.

@Arko109 thanks for the logs, exit code 18 is generic process launch error from the chromium sandbox layer https://source.chromium.org/chromium/chromium/src/+/refs/heads/main:sandbox/win/src/target_process.cc;l=181-191 so looks like sandbox did not get disabled in your case. To which executable did you pass the flags ? Maybe a screen recording would help.

@deepak1556 deepak1556 added the info-needed Issue requires more information from poster label Jun 9, 2023
@sjwyz
Copy link
Author

sjwyz commented Jun 9, 2023

@deepak1556 use arguments --no-sandbox --disable-gpu-sandbox --user-data-dir=/tmp/vscode and the problem still exists.
There are some changes in the phenomenon.Previously, the window remained on the desktop,add arguments --disable-gpu-sandbox, the window flickered and disappeared.

@sjwyz
Copy link
Author

sjwyz commented Jun 9, 2023

@deepak1556 And my Rockylinux9.2 is installed on Windows version vmware Workstation 17

@Arko109
Copy link

Arko109 commented Jun 9, 2023

@deepak1556 I have a shortcut that points to "C:\Program Files\Microsoft VS Code\Code.exe" --no-sandbox --disable-gpu-sandbox, but I also tried running Code --no-sandbox --disable-gpu-sandbox in PowerShell, same results. Here's a video recording:

Videos
2023-06-09-131537.mp4
2023-06-09-133359.mp4

@ITAxReal
Copy link

ITAxReal commented Jun 9, 2023

Same issue on Kubuntu 22.04.2. Terminal logs with '--verbose' tells that VSCode ignoring --no-sandbox flag (startup args contains 'no-sandbox': false), then spamming with "Running under root without --no-sandbox flag is not supported"
And I have noticed that VSCode from snap can't use newest Radeon drivers due to outdated libstdc++9 version in snap (3.4.28 presented in /snap/core20 but required 3.4.29)

@tiagomacarios
Copy link
Member

Microsoft Office developers are experiencing this issue as well.

Things tried:

1 - --no-sandbox --disable-gpu-sandbox
Issue persists.

2 - I tried creating a dump, but it only creates a dat file.

D:\dumps>code --crash-reporter-directory D:\dumps\

D:\dumps>tree /F
Folder PATH listing for volume Storage space
Volume serial number is DED7-F5BA
D:.
│   settings.dat
│
├───attachments
└───reports

3 - I have recorded time travel traces of the different processes.

D:\dumps>C:\debuggers\TTD\tttracer.exe -parent * -onlaunch code.exe -out D:\dumps
Microsoft (R) TTTracer 1.01.10
Release: 1.10.71.0
Copyright (C) Microsoft Corporation. All rights reserved.

Recording process Code.exe(46564)        From parent process cmd.exe(55072)
    Recording process (PID:46564) on trace file: D:\dumps\Code01.run
Recording process Code.exe(21876)        From parent process Code.exe(46564)
    Recording process (PID:21876) on trace file: D:\dumps\Code02.run
(x64) (PID:46564): Process exited with exit code 0 after 13890ms
  Full trace dumped to D:\dumps\Code01.run
Recording process Code.exe(42108)        From parent process Code.exe(21876)
    Recording process (PID:42108) on trace file: D:\dumps\Code03.run
Recording process Code.exe(29728)        From parent process Code.exe(21876)
    Recording process (PID:29728) on trace file: D:\dumps\Code04.run
Recording process Code.exe(24444)        From parent process Code.exe(21876)
    Recording process (PID:24444) on trace file: D:\dumps\Code05.run
(x64) (PID:24444): Process exited with exit code 0 after 14891ms
  Full trace dumped to D:\dumps\Code05.run
(x64) (PID:29728): Process exited with exit code 0 after 20156ms
  Full trace dumped to D:\dumps\Code04.run
(x64) (PID:21876): Process exited with exit code 0 after 31422ms
  Full trace dumped to D:\dumps\Code02.run
(x64) (PID:42108): Process exited with exit code 0 after 21656ms
  Full trace dumped to D:\dumps\Code03.run

@ITAxReal
Copy link

ITAxReal commented Jun 9, 2023

Things tried:
1 - --no-sandbox --disable-gpu-sandbox Issue persists.
2 - I tried creating a dump, but it only creates a dat file.
3 - I have recorded time travel traces of the different processes.

I have some feeling that update has broke argument parsing/saving on no-sandbox flag because I have this output:

Verbose output `# code --user-data-dir="/root/.vscode" --no-sandbox --verbose [102303:0610/020244.034319:WARNING:bluez_dbus_manager.cc(247)] Floss manager not present, cannot set Floss enable/disable. [main 2023-06-09T23:02:44.176Z] [File Watcher (node.js)] Request to start watching: /root/.vscode/User (excludes: , includes: ),/root/.vscode/User/settings.json (excludes: , includes: ) [0610/020244.198923:FATAL:electron_main_delegate.cc(304)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180. [main 2023-06-09T23:02:44.201Z] Starting VS Code [main 2023-06-09T23:02:44.201Z] from: /usr/share/code/resources/app [main 2023-06-09T23:02:44.202Z] args: { _: [], diff: false, merge: false, add: false, goto: false, 'new-window': false, 'reuse-window': false, wait: false, 'user-data-dir': '/root/.vscode', help: false, 'list-extensions': false, 'show-versions': false, 'pre-release': false, version: false, verbose: true, status: false, 'prof-startup': false, 'no-cached-data': false, 'prof-v8-extensions': false, 'disable-extensions': false, 'disable-gpu': false, 'ms-enable-electron-run-as-node': false, telemetry: false, debugRenderer: false, 'enable-smoke-test-driver': false, logExtensionHostCommunication: false, 'skip-release-notes': false, 'skip-welcome': false, 'disable-telemetry': false, 'disable-updates': false, 'disable-keytar': false, 'disable-workspace-trust': false, 'disable-crash-reporter': false, 'crash-reporter-id': 'd3f810e8-d4bf-4c6c-b47c-cef319bf1b60', 'skip-add-to-recently-opened': false, 'unity-launch': false, 'open-url': false, 'file-write': false, 'file-chmod': false, force: false, 'do-not-sync': false, trace: false, 'force-user-env': false, 'force-disable-user-env': false, 'open-devtools': false, 'disable-gpu-sandbox': false, '__enable-file-policy': false, 'enable-coi': false, 'no-proxy-server': false, 'no-sandbox': false, nolazy: false, 'force-renderer-accessibility': false, 'ignore-certificate-errors': false, 'allow-insecure-localhost': false, 'disable-dev-shm-usage': false, 'profile-temp': false, logsPath: '/root/.vscode/logs/20230610T020244' } [main 2023-06-09T23:02:44.206Z] Resolving machine identifier... [main 2023-06-09T23:02:44.206Z] Resolved machine identifier: 9ca044ac56a200b25f97a24709fdad525caa02c9d29e3134ef3c2c0e8e50f74f [main 2023-06-09T23:02:44.206Z] Main->SharedProcess#connect [main 2023-06-09T23:02:44.211Z] [File Watcher (node.js)] Started watching: '/root/.vscode/User' [main 2023-06-09T23:02:44.213Z] [File Watcher (node.js)] Started watching: '/root/.vscode/User/settings.json' [main 2023-06-09T23:02:44.216Z] StorageMainService: creating application storage [main 2023-06-09T23:02:44.225Z] ElectronURLListener: waiting for window to be ready to handle URLs... [main 2023-06-09T23:02:44.225Z] lifecycle (main): phase changed (value: 2) [main 2023-06-09T23:02:44.226Z] windowsManager#open [102333:0610/020244.226525:WARNING:sandbox_linux.cc(380)] InitializeSandbox() called with multiple threads in process gpu-process. [main 2023-06-09T23:02:44.226Z] windowsManager#open pathsToOpen [ { backupPath: '/root/.vscode/Backups/1686313915326', remoteAuthority: undefined } ] [main 2023-06-09T23:02:44.227Z] windowsManager#doOpenEmpty { restore: true, remoteAuthority: undefined, filesToOpen: undefined, forceNewWindow: true } [main 2023-06-09T23:02:44.229Z] IPC Object URL: Registered new channel vscode:254a97f4-1783-438f-b576-add0d3e00854. [main 2023-06-09T23:02:44.230Z] window#validateWindowState: validating window state on 1 display(s) { mode: 0, x: 0, y: 29, width: 1920, height: 1011 } [main 2023-06-09T23:02:44.230Z] window#validateWindowState: 1 monitor working area { x: 0, y: 0, width: 1920, height: 1040 } [main 2023-06-09T23:02:44.231Z] window#ctor: using window state { mode: 0, x: 0, y: 29, width: 1920, height: 1011 } [main 2023-06-09T23:02:44.320Z] window#load: attempt to load window (id: 1) [main 2023-06-09T23:02:44.337Z] windowsManager#open used window count 1 (workspacesToOpen: 0, foldersToOpen: 0, emptyToRestore: 1, emptyToOpen: 0) [main 2023-06-09T23:02:44.337Z] lifecycle (main): phase changed (value: 3) [main 2023-06-09T23:02:44.337Z] resolveShellEnv(): skipped (VSCODE_CLI is set) [main 2023-06-09T23:02:44.338Z] update#setState idle [102303:0610/020244.444472:ERROR:network_service_instance_impl.cc(521)] Network service crashed, restarting service. [0610/020244.486842:FATAL:electron_main_delegate.cc(304)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180. [102303:0610/020244.673278:ERROR:network_service_instance_impl.cc(521)] Network service crashed, restarting service. [0610/020244.707520:FATAL:electron_main_delegate.cc(304)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180. [102303:0610/020244.878822:ERROR:network_service_instance_impl.cc(521)] Network service crashed, restarting service. [0610/020244.909962:FATAL:electron_main_delegate.cc(304)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180. [102303:0610/020245.105310:ERROR:network_service_instance_impl.cc(521)] Network service crashed, restarting service. [0610/020245.139476:FATAL:electron_main_delegate.cc(304)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180. [102303:0610/020245.311264:ERROR:network_service_instance_impl.cc(521)] Network service crashed, restarting service. [0610/020245.345518:FATAL:electron_main_delegate.cc(304)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180. [102303:0610/020245.528944:ERROR:network_service_instance_impl.cc(521)] Network service crashed, restarting service. [0610/020245.560666:FATAL:electron_main_delegate.cc(304)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180. [102303:0610/020245.750638:ERROR:network_service_instance_impl.cc(521)] Network service crashed, restarting service. [0610/020245.797133:FATAL:electron_main_delegate.cc(304)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180. [102303:0610/020245.914979:ERROR:network_service_instance_impl.cc(521)] Network service crashed, restarting service. [0610/020245.938484:FATAL:electron_main_delegate.cc(304)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180. [102303:0610/020246.108599:ERROR:network_service_instance_impl.cc(521)] Network service crashed, restarting service. [0610/020246.148474:FATAL:electron_main_delegate.cc(304)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180. [102303:0610/020246.182080:ERROR:service_worker_storage.cc(1933)] Failed to delete the database: Database IO error [102303:0610/020246.279736:ERROR:network_service_instance_impl.cc(521)] Network service crashed, restarting service. [0610/020246.316049:FATAL:electron_main_delegate.cc(304)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180. [102303:0610/020246.507002:ERROR:network_service_instance_impl.cc(521)] Network service crashed, restarting service. [0610/020246.552562:FATAL:electron_main_delegate.cc(304)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.`

Look at no-sandbox element in args dict, it has false value, but --no-sandbox flag presented in run command. Also there are a lot of FATAL messages on not presented --no-sandbox flag

@connor4312
Copy link
Member

This seems to break quite a few people's CI's, as in the referenced issue: microsoft/vscode-test#221

@msvinth-work
Copy link

msvinth-work commented Jun 10, 2023

Seeing the same thing on Windows Server 2019 as @Arko109

@ext
Copy link

ext commented Jun 11, 2023

Getting the same issue when using @vscode/test-electron to run test-cases for an extension.

@anandbibek
Copy link

My headless CI tests works with 1.78.2 , but as soon as I use .79, it starts crashing continuously with below messages repeated.

[0608/193640.183415:FATAL:electron_main_delegate.cc(304)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
[454:0608/193640.247475:ERROR:network_service_instance_impl.cc(521)] Network service crashed, restarting service.

@deepak1556 deepak1556 added bug Issue identified by VS Code Team member as probable bug macos Issues with VS Code on MAC/OS X linux Issues with VS Code on Linux candidate Issue identified as probable candidate for fixing in the next release windows VS Code on Windows issues workbench-cli VS Code Command line issues and removed info-needed Issue requires more information from poster labels Jun 12, 2023
@deepak1556
Copy link
Collaborator

Nope not possible currently, it is a limitation from the chromium runtime https://bugs.chromium.org/p/chromium/issues/detail?id=740132 and I am tracking it in #122951. Edge de-elevates the application under these scenarios, so it might be potential fix for this issue.

@ITAxReal
Copy link

ITAxReal commented Jun 14, 2023

@deepak1556
Yeah, yesterday version of insiders vscode is working on Linux under root user with --no-sandbox flag.
Thanks a lot

@sjwyz
Copy link
Author

sjwyz commented Jun 15, 2023

@deepak1556
I use cmd code-insiders --no-sandbox --user-data-dir=/home/lzl/vscodeii
Now the program seems to be running normally,but in cmd ps aux|grep sandbox , --enable-sandbox still exists
code-insiders-1.80.0-1686734455.el7.x86_64.rpm
ps_cmd

@deepak1556
Copy link
Collaborator

@sjwyz thanks for confirming, you can ignore the --enable-sandbox. The runtime process sandbox will be disabled with the presence of --no-sandbox

@reukiodo
Copy link

reukiodo commented Jun 16, 2023

2023-06-16 10:53:23 root@control-tower:~# apt -y install ./code-insiders_1.80.0-1686909910_amd64.deb 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'code-insiders' instead of './code-insiders_1.80.0-1686909910_amd64.deb'
The following NEW packages will be installed:
  code-insiders
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/95.7 MB of archives.
After this operation, 375 MB of additional disk space will be used.
Get:1 /root/code-insiders_1.80.0-1686909910_amd64.deb code-insiders amd64 1.80.0-1686909910 [95.7 MB]
Selecting previously unselected package code-insiders.
(Reading database ... 127565 files and directories currently installed.)
Preparing to unpack .../code-insiders_1.80.0-1686909910_amd64.deb ...
Unpacking code-insiders (1.80.0-1686909910) ...
Setting up code-insiders (1.80.0-1686909910) ...
Processing triggers for mailcap (3.70+nmu1) ...
Processing triggers for desktop-file-utils (0.26-1) ...
Processing triggers for shared-mime-info (2.2-1) ...
N: Download is performed unsandboxed as root as file '/root/code-insiders_1.80.0-1686909910_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
2023-06-16 10:54:05 root@control-tower:~# code-insiders --no-sandbox --user-data-dir=~
2023-06-16 10:54:47 root@control-tower:~# cat /proc/version 
Linux version 6.1.0-9-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian 6.1.27-1 (2023-05-08)
2023-06-16 11:13:31 root@control-tower:~# cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
2023-06-16 11:13:35 root@control-tower:~# 
image

insider works again! Is this a fix that will get backported to 1.79.x release or will I need to wait for the official 1.80.x release?

@haugerbr
Copy link
Member

@reukiodo it's in 1.79.2

@Satya-Sidhu
Copy link

Hi,
I have VSCode 1.79.2 running on Ubuntu 20.04 which I installed using snap. When I try to start VSCode as root using the following command:
sudo code --verbose --user-data-dir=/root/.config/Code --no-sandbox

I just get a blank dialog as shown in the attachment below. I am also attaching my logs. Any help would be extremely grateful.
Thank you.

BlankDialog
Logs
VerboseLogs1.txt

@deepak1556
Copy link
Collaborator

@Satya-Sidhu are you able to launch the application without sudo ?

@Satya-Sidhu
Copy link

As a non-root user I can launch it without sudo. But cannot launch it with sudo as a non-root user. Also cannot launch it if I switch over to root account.

@Satya-Sidhu
Copy link

As you can see below, without sudo everything seems to startup successfully.

Dialog
VerboseLogs
VerboseLogsNonRoot.txt

@deepak1556
Copy link
Collaborator

@Satya-Sidhu thanks for confirming, in your previous comment #184687 (comment) I missed that you are not launching with --disable-gpu-sandbox, does the issue happen when you add this flag as well sudo code --user-data-dir=/root/.config/Code --no-sandbox --disable-gpu-sandbox ?

@Satya-Sidhu
Copy link

Hi @deepak1556, this
sudo code --user-data-dir=/root/.config/Code --no-sandbox --disable-gpu-sandbox
did work for me.

Thank you very much for your help.

@tiagomacarios
Copy link
Member

@deepak1556 Is there a way to persist --no-sandbox --disable-gpu-sandbox ? registry key or config file?
Our development environment runs elevated and engineers now need to start adding these flags to all their commands...

@Satya-Sidhu
Copy link

I use a shell script to start VSCode as I have to do a lot of configurations before.
Below is what I do to start VSCode.

image

@deepak1556
Copy link
Collaborator

@tiagomacarios we will provide a setting to persist this option with 1.80 release.

@ITAxReal
Copy link

ITAxReal commented Jun 23, 2023

@tiagomacarios In linux I can use 'alias' command like alias code='code --no-sandbox'
In win I think you can override it with bat script with same name placed in folder that placed in path. Note that you should use absolute path of 'code' in bat script.

@ppgovekar
Copy link

What is the equivalent of disable-gpu-sandbox for settings.json in windows?

@deepak1556
Copy link
Collaborator

@ppgovekar please refer to https://code.visualstudio.com/updates/v1_80#_disable-chromium-sandbox

@github-actions github-actions bot locked and limited conversation to collaborators Jul 29, 2023
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 candidate Issue identified as probable candidate for fixing in the next release insiders-released Patch has been released in VS Code Insiders linux Issues with VS Code on Linux macos Issues with VS Code on MAC/OS X sandbox Running VSCode in a node-free environment verified Verification succeeded windows VS Code on Windows issues workbench-cli VS Code Command line issues
Projects
Archived in project
Development

No branches or pull requests