【问题标题】:How to run visual studio code in linux如何在 Linux 中运行 Visual Studio 代码
【发布时间】:2020-03-28 04:28:28
【问题描述】:

我是Linux操作系统的新手,我从微软官网的visual studio code中下载了rpm包。这是机器

CentOS Linux release 7.6.1810 (Core)

我运行了命令

rpm -qpi code-1.40.2-1574694258.el7.x86_64.rpm

Output of the command

Name        : code
Version     : 1.40.2
Release     : 1574694258.el7
Architecture: x86_64
Install Date: (not installed)
Group       : Development/Tools
Size        : 235084185
License     : Multiple, see https://code.visualstudio.com/license
Signature   : (none)
Source RPM  : code-1.40.2-1574694258.el7.src.rpm
Build Date  : Mon 25 Nov 2019 10:04:31 AM EST
Build Host  : 2114565cfb42
Relocations : (not relocatable)
Packager    : Visual Studio Code Team <vscode-linux@microsoft.com>
Vendor      : Microsoft Corporation
URL         : https://code.visualstudio.com/
Summary     : Code editing. Redefined.
Description :
Visual Studio Code is a new choice of tool that combines the simplicity of a code editor with what developers need for the core edit-build-debug cycle. See https://code.visualstudio.com/docs/setup/linux for installation instructions and FAQ.

现在我想在 Windows 机器上运行 Visual Studio 代码。我如何做到这一点?

注意我只有 ssh 连接到 linux 机器。

【问题讨论】:

    标签: linux centos redhat rpm


    【解决方案1】:

    如果您想通过 ssh 运行基于 gui 的工具,则需要传递启用 X11 转发的-X(大写)参数,
    ssh -X remoteHostIP
    请参阅以下内容 http://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/ssh.1

    【讨论】:

      【解决方案2】:

      你不能通过 ssh 运行它,你需要在 Linux shell 之上的一些 GUI。 您只能使用命令行编辑器,例如; “纳米”、“vim”等

      编辑:

      替代方案您可以在本地计算机上运行 VScode,并通过 ssh 将其连接到远程计算机。 https://code.visualstudio.com/docs/remote/ssh

      【讨论】:

      • 我正在使用mobaxterm,我现在可以看到UI了
      【解决方案3】:

      VSCode 是一个基于 gui 的工具。如果您只有 ssh 访问权限,您可以尝试通过x11 forwarding 运行它,或者设置VNC connection 来远程控制另一台机器。但正如 Leon.fon 提到的,ssh 通常是基于命令行的。

      【讨论】:

        【解决方案4】:

        您应该从安装软件包开始。您只需查询软件包,要安装它,您必须(作为超级用户)运行:

        rpm --install code-1.40.2-1574694258.el7.x86_64.rpm
        

        安装后,您将能够通过启动命令来启动程序:

        code
        

        正如@Leon.fon 所说,如果您只有ssh 连接,您将无法启动 GUI,但导出显示可能会起作用:

        ssh -X ...
        

        【讨论】:

        • 嗨,克里斯,这正在工作:),如果 rpm 类似于 windows 中的 .zip,我一定在同一目录中看到了解压缩文件,但除了 rpm 之外我没有任何其他文件
        • rpm 不仅仅是一个 zip 文件;它是一个包管理器...安装rpm 就像在ubuntu 上安装deb 或在Windows 上安装msi
        猜你喜欢
        • 1970-01-01
        • 2022-06-17
        • 2022-09-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-12-15
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多