kali系统root账户启用vscode报错

本文介绍了在Kali Linux 2021.2中,当使用root用户启动Visual Studio Code(VScode)时遇到的问题及其解决方案。主要方法包括:通过命令行添加`--no-sandbox`和`--user-data-dir`参数启动,将命令别名写入`/etc/profile`配置文件,以及修改应用程序图标以允许root用户运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


前言

本篇记录kali系统2021.2安装vs code后,root用户启用vs code报错“--user-data-dir

一、命令行启用 VS code

  • 安装VS code后,shell下调用code报错。

    You are trying to start Visual Studio Code as a super user which isn't recommended. If this was intended, please specify an alternate user data directory using the–user-data-dirargument.

    在这里插入图片描述

二、解决方法

1.命令行添加参数 --no-sandbox --user-data-dir

code --no-sandbox --user-data-dir

在这里插入图片描述

2.别名写入配置文件 /etc/profile

vim /etc/profile
source /etc/profile # 刷新配置

在这里插入图片描述

vscode # 调用

在这里插入图片描述

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-jOK0GC4y-1628951755995)(C:\Users\StepTp\AppData\Roaming\Typora\typora-user-images\image-20210814223343340.png)]

3.修改 Applications 图标,使其可运行

cp /usr/share/applications/code.desktop /usr/share/applications/code.desktop.bak #备份

修改

点击可启动 vs code

在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值