-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Windows: improve wording when running as admin fails #169572
Comments
@Treit @JunielKatarn do you work in an environment where Applocker is enabled on Windows? And where VS Code is blocked for your normal user, so you run as Admin? Bottom line: the sandbox option will soon be default with no way to disable it and then this scenario is no longer supported. But the wording should probably contain a button to more information about the Bitlocker problem. //cc @deepak1556 |
I do not work in an environment where Applocker is enabled. However, I sometimes need to work from a terminal window that is running as administrator as certain folders I work in require administrative privileges. Not being able to launch vscode from such a terminal window means I have to resort to other editors instead, which have no problem running from such a window. Why would there not be a way to disable this in the future? If I have to go out of my way to change the default behavior and run non-sandboxed, that should be my choice as the developer who knows my own risk tolerance. |
@deepak1556 I might need you here to better understand what environment the user is in. The above message will only appear based on this condition:
Which I had thought to be AppLocker only. |
I wasn't aware of any AppLocker policies, but I double-checked with Get-AppLockerPolicy -Effective -Xml and our corporate IT (this is at Microsoft) does appear to have some policies enabled. I don't see anything that looks related to VSCode though. Do you know what that would look like? |
@bpasero VSCode is not explicitly blocked to run either as normal user nor admin on my machine.
(Did you mean AppLocker instead of BitLocker?) |
The sandbox option is nothing a user will be able to disable, see https://code.visualstudio.com/blogs/2022/11/28/vscode-sandbox for motivations. It is currently behind a setting only to test it. It will be the default soon. Given you found AppLocker policies, this issue is a duplicate of #122951 and related to #112538. Please refer to these issues for more details. I still think we can improve the wording of the message though, maybe even point to some docs on our end. |
Given we are now working on the docs, can people try to
Does it work then? |
Type: Bug
Recently when I attempted to launch vscode from a terminal window running as administrator on Windows, I received the following error:
It was completely unclear why I was suddenly no longer able to run a vscode instance as administrator. The error message here is unhelpful as it does not provide any hints as to why this restriction is happening.
After several days of trying to track this down, I was able to compare my installation with that of another user who was able to run as admin just fine, using the same vscode version. I noticed in the Help | About dialog that mine said "Sandboxed: yes" and theirs said "Sandboxed: no"
This lead me to the "window.experimental.useSandbox": true setting, which I set to false to fix the issue.
The error message should say something like "Running as administrator is not supported when useSandbox is set to true" or something like that to make it much more apparent that VSCode is running in a restricted sandbox.
I don't know how that setting got enabled, but I wasted quite a bit of time trying to understand what was going on.
VS Code version: Code 1.74.1 (1ad8d51, 2022-12-14T10:30:51.966Z)
OS version: Windows_NT x64 10.0.25272
Modes:
Sandboxed: Yes
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Extensions (35)
(5 theme extensions excluded)
A/B Experiments
The text was updated successfully, but these errors were encountered: