linux 图形远程桌面,在 Azure 实验室服务中启用适用于 Linux 的图形远程桌面 - Azure Lab Services | Microsoft Docs...

您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

在 Azure 实验室服务中启用适用于 Linux 虚拟机的图形远程桌面Enable graphical remote desktop for Linux virtual machines in Azure Lab Services

06/26/2020

本文内容

本文演示如何完成以下任务:This article shows you how to do the following tasks:

为 Linux VM 启用图形远程桌面会话Enable graphical remote desktop sessions for a Linux VM

如何使用 RDP(远程桌面协议)或 X2Go 远程桌面客户端连接到 Linux VMHow to connect to a Linux VM using RDP (Remote Desktop Protocol) or X2Go remote desktop clients

设置图形远程桌面解决方案Set up graphical remote desktop solution

从 Linux 映像创建实验室时,将自动配置 SSH(安全外壳)访问权限,以便讲师可以使用 SSH 从命令行连接到模板 VM。When a lab is created from a Linux image, SSH (Secure Shell) access is automatically configured so that the instructor can connect to the template VM from the command line using SSH. 同样,发布模板 VM 后,学生也可以使用 SSH 连接到其 VM。Likewise, when the template VM is published, students can also connect to their VMs using SSH.

若要使用 GUI(图形用户界面)连接到 Linux VM,建议使用 RDP 或 X2Go。To connect to a Linux VM using a GUI (graphical user interface), we recommend using either RDP or X2Go. 这两个选项均要求讲师对模板 VM 进行一些其他设置:Both of these options require the instructor to do some additional setup on the template VM:

RDP 设置RDP Setup

若要使用 RDP,讲师必须:To use RDP, the instructor must:

启用远程桌面连接;这是打开用于 RDP 的 VM 端口所特别需要的。Enable remote desktop connection; this is specifically needed to open the VM's port for RDP.

安装 RDP 远程桌面服务器。Install the RDP remote desktop server.

安装 Linux 图形桌面环境(例如 MATE、XFCE 等)。Install a Linux graphical desktop environment (such as MATE, XFCE, and so on).

X2Go 设置X2Go Setup

若要使用 X2Go,讲师必须:To use X2Go, the instructor must:

安装 X2Go 远程桌面服务器。Install the X2Go remote desktop server.

安装 Linux 图形桌面环境(例如 MATE、XFCE 等)。Install a Linux graphical desktop environment (such as MATE, XFCE, and so on).

X2Go 使用已为 SSH 启用的相同端口。X2Go uses the same port that is already enabled for SSH. 因此,无需进行额外配置即可在 VM 上为 X2Go 打开端口。As a result, no extra configuration required to open a port on the VM for X2Go.

备注

在某些情况下,例如使用 Ubuntu LTS 18.04 时,X2Go 可提供更好的性能。In some cases, such as with Ubuntu LTS 18.04, X2Go provides better performance. 如果使用 RDP 并在与图形桌面环境交互时注意到延迟,请考虑尝试 X2Go,因为它可能会提高性能。If you use RDP and notice latency when interacting with the graphical desktop environment, consider trying X2Go since it may improve performance.

为 RDP 启用远程桌面连接Enable remote desktop connection for RDP

仅在使用 RDP 进行连接时需要执行此步骤。This step is only needed to connect using RDP. 如果计划使用 X2Go,则可以跳到下一部分,因为 X2Go 使用 SSH 端口。If instead you plan to use X2Go, you can skip to the next section since X2Go uses the SSH port.

在实验室创建期间,讲师可以选择“启用远程桌面连接”。During lab creation, the instructor has the option to Enable Remote Desktop Connection. 讲师必须 启用 此选项才能打开 Linux VM 上 RDP 远程桌面会话所需的端口。The instructor must enable this option to open the port on the Linux VM that is needed for an RDP remote desktop session. 否则,如果禁用此选项,则仅会打开用于 SSH 的端口。Otherwise, if this option is left disabled, only the port for SSH is opened.

c5d1be6564082780dcf94af069b1f58b.png

在“启用远程桌面连接”消息框中,选择“继续启用远程桌面”。On the Enabling Remote Desktop Connection message box, select Continue with Remote Desktop.

c038223c283ff0f5142adced88411d4c.png

安装 RDP 或 X2GoInstall RDP or X2Go

创建实验室后,讲师需要确保已在模板 VM 上安装图形桌面环境和远程桌面服务器。After the lab is created, the instructor needs to ensure that a graphical desktop environment and remote desktop server are installed on the template VM. 讲师必须先使用 SSH 连接到模板 VM,然后才能安装以下包:Instructors must first connect to the template VM using SSH to install the packages for:

RDP 或 X2Go 远程桌面服务器。Either the RDP or X2Go remote desktop server.

图形桌面环境,例如 MATE、XFCE 等。A graphical desktop environment, such as MATE, XFCE, etc.

完成此设置后,讲师可以使用 Microsoft 远程桌面 (RDP) 客户端或 X2Go 客户端连接到模板 VM。After this is set up, the instructor can connect to the template VM using either the Microsoft Remote Desktop (RDP) client or X2Go client.

请按照以下步骤设置模板 VM:Follow the below steps to set up the template VM:

如果在工具栏上看到“自定义模板”,请选择它。If you see Customize template on the toolbar, select it. 然后,在“自定义模板”对话框中选择“继续”。Then, select Continue on the Customize template dialog box. 此操作会启动模板 VM。This action starts the template VM.

e529b2f7f15c80b380003e2af480de2c.png

在模板 VM 启动后,你可以在工具栏上选择“连接到模板”,然后选择“通过 SSH 进行连接”。After the template VM is started, you can select Connect template and then Connect via SSH on the toolbar.

389d9b6be6145ed69512c101aedb09fa.png

你会看到下面的“连接到虚拟机”对话框。You see the following Connect to your virtual machine dialog box. 选择文本框旁的“复制”按钮,将其复制到剪贴板。Select the Copy button next to the text box to copy it to the clipboard. 保存 SSH 连接信息。Save the SSH connection information. 从 SSH 终端(如 Putty)使用此信息连接到虚拟机。Use this connection information from an SSH terminal (like Putty) to connect to the virtual machine.

a2aec97621ae5699282bd1a59fdf102f.png

安装 RDP 或 X2Go 以及所选的图形桌面环境。Install either RDP or X2Go along with the graphical desktop environment of your choice. 请参阅以下说明:Refer to the following instructions:

通过 GUI 连接到模板 VMConnect to the template VM via the GUI

设置模板 VM 后,讲师可以使用 Microsoft 远程桌面 (RDP) 客户端或 X2Go 客户端通过 GUI 进行连接。After the template VM is set up, the instructor can connect via the GUI using either the Microsoft Remote Desktop (RDP) client or X2Go client. 使用的客户端取决于是将 RDP 还是 X2Go 配置为模板 VM 上的远程桌面服务器。The client that you use depends on if RDP or X2Go is configured as the remote desktop server on the template VM.

Microsoft 远程桌面 (RDP) 客户端Microsoft Remote Desktop (RDP) client

Microsoft 远程桌面 (RDP) 客户端用于连接到已配置 RDP 的模板 VM。The Microsoft Remote Desktop (RDP) client is used to connect to a template VM that has RDP configured. 远程桌面客户端可用于 Windows、Chromebook、Mac 等设备。The Remote Desktop client can be used on Windows, Chromebooks, Macs and more. 有关更多详细信息,请参阅有关远程桌面客户端的文章。Refer to the article on Remote Desktop clients for further details.

根据用于连接模板 VM 的计算机的类型,执行以下步骤:Follow the below steps based on the type of computer used to connect to the template VM:

WindowsWindows

单击实验室工具栏上的“连接到模板”,然后选择“通过 RDP 连接”,连接到模板 VM。Click Connect to template on your lab's toolbar and select Connect via RDP to connect to the template VM.

保存 RDP 文件,并使用它通过远程桌面客户端连接到模板 VM。Save the RDP file and use it to connect to the template VM using the Remote Desktop client.

通常情况下,远程桌面客户端已在 Windows 上安装和配置。Typically, the Remote Desktop client is already installed and configured on Windows. 因此,只需单击 RDP 文件将其打开并启动远程会话即可。As a result, all you need to do is click on the RDP file to open it and start the remote session.

MacMac

单击实验室工具栏上的“连接到模板”,然后选择“通过 RDP 连接”,保存 RDP 文件。Click Connect to template on your lab's toolbar and then select Connect via RDP to save the RDP file.

ChromebookChromebook

单击实验室工具栏上的“连接到模板”,然后选择“通过 RDP 连接”,保存 RDP 文件。Click Connect to template on your lab's toolbar and then select Connect via RDP to save the RDP file.

X2Go 客户端X2Go client

X2Go 客户端用于连接到配置了 X2Go 的模板 VM。The X2Go client is used to connect to a template VM that has X2Go configured. 使用模板 VM 的 SSH 连接信息,按照操作说明文章使用 X2Go 连接到 VM 中的步骤操作。Using the template VM's SSH connection information, follow the steps in the how-to article Connect to a VM using X2Go.

后续步骤Next steps

讲师在其模板 VM 上设置 RDP 或 X2Go 并发布后,学生可以通过 GUI 远程桌面或 SSH 连接到其 VM。After an instructor sets up either RDP or X2Go on their template VM and publishes, students can connect to their VMs via the GUI remote desktop or SSH.

有关详细信息,请参阅:For more information, see:

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值