Vscode 在 ParrotOS 上:ERR_INTERNET_DISCONNECTED

Vscode on ParrotOS : ERR_INTERNET_DISCONNECTED

我刚刚安装 ParrotOS and installed VSCODE from the documentation :

curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > 
microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt-get update
sudo apt-get install code

但是我无法加载任何扩展。如果我打开开发人员工具,我会看到以下错误:

ERR net::ERR_INTERNET_DISCONNECTED: Error: net::ERR_INTERNET_DISCONNECTED

如何授权 vscode 连接?

安装VSCode时可以看到最后两行是:

Configuring sandbox profiles...
Sandbox profiles updated!

来自 Parrot 3.9 there is the sandbox feature using firejail. This system creates a profile file under /etc/firejail for every installation. The file contains rules to protect your application, such as Networking rules.

如您在文档中所见:

–net=none creates a network namespace unconnected to the real network. The sandbox looks like a computer without any network interfaces.

所以你必须评论(或删除)在/etc/firejail/code.profile

net none

您的 VSCode 将立即加载扩展列表! (我有同样的问题)

编辑: 注意更新,因为Firejail配置文件被覆盖了,在配置文件中可以看到:

# This file is overwritten after every install/update

例如,如果您 update/upgrade 您的系统,请检查如下内容:

 Configuration file '/etc/firejail/code.profile'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** code.profile (Y/I/N/O/D/Z) [default=N] ? 

更新:vscode 已经添加到官方仓库很长一段时间了,可以用通常的方式安装: apt update && apt dist-upgrade && apt install code

你总是想使用 dist-upgrade 来保持你的软件包和谐。

您应该可以 运行 它:
firejail --noprofile
但您不应该将回购添加到 PARROTOS
ParrotOS 是一个滚动发行版,您 破坏您的系统。

https://community.parrotsec.org/t/apt-add-repository-error/1517/2

强烈建议您为此类事情使用虚拟机(ParrotOS 附带 VirtualBox 以及适用于 VirtualBox 的适当 firejail 配置文件)。
https://wiki.debian.org/DontBreakDebian

在 parrotsec os 中,most 应用程序从启动器(GUI 菜单)启动 sandboxed.If 您希望启动一个不受沙盒限制的应用程序 pos ed 就像这样从终端启动它们

/usr/bin/<appname>