空白窗口VSCODE作为root

发布于 2025-01-24 02:32:59 字数 552 浏览 3 评论 0原文

我很长一段时间以这种命令(ubuntu 20.04.4 lts)将VSCODE作为root运行已有很长一段时间:

> sudo code --user-data-dir="~/.vscode-root"

今天,我使用相同的命令执行VSCODE作为root,但我没有相同的结果。 这次,我有一个空白的窗口。

我尝试将其删除 +删除 /$ home /code和.vscode文件夹 再次安装,但我有同样的问题, 我试图将同一命令与其他标志一起使用,而无需解决它。

Flags tried : --disable-gpu    ///  --disable-features=CalculateNativeWinOcclusion

有没有办法删除(软件包 +配置)和VSCODE的所有数据可以再次正确安装它?

屏幕截图

有什么想法吗? 谢谢祝你今天过得愉快

it's been a long time that i run vscode as root via this command (ubuntu 20.04.4 LTS) :

> sudo code --user-data-dir="~/.vscode-root"

Today, i used the same command to execute vscode as root, but i don't have the same result.
in this time, i have a blank window.

i tried to remove it + remove /$Home/Code and .vscode folder
install it again but i have the same problem,
i tried to use the same command with other flags without being able to solve it.

Flags tried : --disable-gpu    ///  --disable-features=CalculateNativeWinOcclusion

is there a way to delete (package + config) and all data of vscode to install it properly again ?

screen shot

Any idea ?
Thank you & have a nice day

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

强辩 2025-01-31 02:32:59

我在这里找到了一个解决方案:

nofollow noreferrer“二手:
- no-and-andbox -disable-gpu-sandbox -user-data-data-dir

例如:
sudo代码-NO-SANDBOX - DISABLE-GPU-SANDBOX -USER-DATA-DATA =/root/.vscode/.vscode/

I found a solution here:
https://github.com/microsoft/vscode/issues/151187

keys must be used:
--no-sandbox --disable-gpu-sandbox --user-data-dir

for example:
sudo code --no-sandbox --disable-gpu-sandbox --user-data-dir=/root/.vscode/

债姬 2025-01-31 02:32:59

这对我有用vscodium

sudo su -c "codium --user-data-dir="/root" --no-sandbox && sleep infinity"

出于某种原因,vscode不以sudo开始,但它与su -c -c平静地工作

ps:我不知道它是否可以更容易。我需要它与vscode中的git一起工作

That works for me on VSCodium:

sudo su -c "codium --user-data-dir="/root" --no-sandbox && sleep infinity"

For some reason, vscode does not start with sudo, but it works calmly with su -c

PS: I do not know if it can be done easier. I needed this to work with git in vscode

好菇凉咱不稀罕他 2025-01-31 02:32:59

如果您面临问题以打开 /root下存在的代码。

然后更好地添加权限为根。

例如:

chmod -r 755/root/

现在,您可以轻松地使用VSCODE打开root File

if you are facing the issue to open a code that is present under /root.

then better add permission to root.

For example:

chmod -R 755 /root/

Now, you can easily open the root file with vscode

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文