vscode
vscode copied to clipboard
argv.json "disable-chromium-sandbox": true not enough to start code as root
Type: Bug
2023-07-07 10:09:34 root@control-tower:~# apt reinstall -y code
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
linux-image-5.10.0-22-amd64
Use 'apt autoremove' to remove it.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/96.1 MB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 134763 files and directories currently installed.)
Preparing to unpack .../code_1.80.0-1688479026_amd64.deb ...
Unpacking code (1.80.0-1688479026) over (1.80.0-1688479026) ...
Setting up code (1.80.0-1688479026) ...
Processing triggers for shared-mime-info (2.2-1) ...
Processing triggers for mailcap (3.70+nmu1) ...
Processing triggers for desktop-file-utils (0.26-1) ...
2023-07-07 10:09:57 root@control-tower:~# cat .vscode/argv.json
// This configuration file allows you to pass permanent command line arguments to VS Code.
// Only a subset of arguments is currently supported to reduce the likelihood of breaking
// the installation.
//
// PLEASE DO NOT CHANGE WITHOUT UNDERSTANDING THE IMPACT
//
// NOTE: Changing this file requires a restart of VS Code.
{
// Use software rendering instead of hardware accelerated rendering.
// This can help in cases where you see rendering issues in VS Code.
// "disable-hardware-acceleration": true,
// Allows to disable crash reporting.
// Should restart the app if the value is changed.
"enable-crash-reporter": true,
// Unique id used for correlating crash reports sent from this instance.
// Do not edit this value.
"crash-reporter-id": "ca156306-80fb-4128-b138-a1ba333ba686",
"disable-chromium-sandbox": true
}2023-07-07 10:10:03 root@control-tower:~# code
You are trying to start Visual Studio Code as a super user which isn't recommended. If this was intended, please add the argument `--no-sandbox` and specify an alternate user data directory using the `--user-data-dir` argument.
2023-07-07 10:10:18 root@control-tower:~# code --disable-chromium-sandbox
You are trying to start Visual Studio Code as a super user which isn't recommended. If this was intended, please add the argument `--no-sandbox` and specify an alternate user data directory using the `--user-data-dir` argument.
2023-07-07 10:12:43 root@control-tower:~#
VS Code version: Code 1.80.0 (660393deaaa6d1996740ff4880f1bad43768c814, 2023-07-04T13:39:48.236Z) OS version: Linux x64 6.1.0-9-amd64 Modes:
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz (16 x 2499) |
| GPU Status | 2d_canvas: unavailable_software canvas_oop_rasterization: disabled_off direct_rendering_display_compositor: disabled_off_ok gpu_compositing: disabled_software multiple_raster_threads: enabled_on opengl: disabled_off rasterization: disabled_software raw_draw: disabled_off_ok video_decode: disabled_software video_encode: disabled_software vulkan: disabled_off webgl: unavailable_software webgl2: unavailable_software webgpu: disabled_off |
| Load (avg) | 2, 2, 1 |
| Memory (System) | 31.34GB (22.79GB free) |
| Process Argv | --no-sandbox --user-data-dir=~ --crash-reporter-id ca156306-80fb-4128-b138-a1ba333ba686 |
| Screen Reader | no |
| VM | 100% |
| DESKTOP_SESSION | xfce |
| XDG_CURRENT_DESKTOP | XFCE |
| XDG_SESSION_DESKTOP | undefined |
| XDG_SESSION_TYPE | x11 |
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
vscaac:30438847
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
3biah626:30602489
pyind779:30671433
89544117:30613380
pythonsymbol12:30671437
a9j8j154:30646983
showlangstatbar:30737416
vsctsb:30748421
pythonms35:30701012
a2ce3375:30757347
pythonfmttext:30731395
pythoncmv:30756943
fixshowwlkth:30771522
pythongtdpath:30769146
i26e3531:30780429
pythonnosmt12:30779714
pythonidxpt:30784022
pythonnoceb:30776495
cmakestatusbarv2:30779594
additional info if it is helpful:
2023-07-07 10:18:12 root@control-tower:~# cat /proc/version
Linux version 6.1.0-9-amd64 ([email protected]) (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-07-07 10:18:20 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-07-07 10:18:25 root@control-tower:~#
--disable-chromium-sandbox only disables the runtime sandbox, to launch as root you would need to provide a custom --user-data-dir as mentioned by the error log.
code --disable-chromium-sandbox --user-data-dir=/tmp/vscode