下载、安装和设置 Linux 工作负载Download, install, and setup the Linux workload

Visual Studio 安装程序Visual Studio setup

  1. 启动 Visual Studio 安装程序并选择“使用 C++ 的 Linux 开发”工作负载。Start the Visual Studio installer and select the Linux development with C++ workload.

    用于 Linux 开发的 Visual C++ 扩展

  2. 单击“安装”以继续进行安装。Click Install to continue with the installation.

Linux 安装程序Linux setup

目标 Linux 计算机必须安装 openssh-serverg++gdbgdbserver,并且必须运行 ssh 守护程序。The target Linux computer must have openssh-server, g++, gdb, and gdbserver installed, and the ssh daemon must be running. 如果这些尚不存在,则可以进行安装,如下所示:If these are not already present, you can install them as follows:

  1. 在 Linux 计算机上的 shell 提示符下,运行:At a shell prompt on your Linux computer, run:

    sudo apt-get install openssh-server g++ gdb gdbserver

    由于 sudo 命令,可能会提示你输入 root 密码。You may be prompted for your root password due to the sudo command. 如果是这样,输入密码然后继续。If so, enter it and continue. 完成后,将可以安装这些服务和工具。Once complete, these services and tools will be installed.

  2. 通过运行以下命令,确保 ssh 服务在 Linux 计算机上运行:Ensure the ssh service is running on your Linux computer by running:

    sudo service ssh start

    这将启动该服务并在后台运行它,准备接受连接。This will start the service and run it in the background, ready to accept connections.