使用 VNC 或 RDP 安装和配置 Ubuntu 24.04 远程桌面环境。

带有图形桌面环境的 Ubuntu 24.04 模板允许你使用轻量的 XFCE 可视化界面(而非命令行终端)管理 Hostinger 虚拟专用服务器(VPS)。本指南介绍如何安装该模板,并使用两种不同的远程桌面选项配置你的连接。

开始之前

要成功执行此安装,请确保满足以下要求:

  • 一个 Hostinger KVM 2 或更高版本的 Ubuntu VPS 方案。由于图形桌面环境流畅运行的要求,KVM 1 方案不支持此模板。
  • 如果你已安装了其他操作系统模板,请在继续之前通过 SFTP 备份任何重要文件。更改操作系统会永久删除服务器上当前存储的所有数据。

步骤 1 – 安装 Ubuntu 24.04 模板

VPS OS change screen with Ubuntu 24.04 with Remote Desktop selected in Application tab
VPS OS change screen with Ubuntu 24.04 with Remote Desktop selected in Application tab
  1. 登录 hPanel 并进入 VPS 区块。
  2. 选择你要管理的服务器。
  3. 在左侧边栏,导航到 OS & Panel → Operating System(操作系统)
  4. 向下滚动到 Change your Operating System(更改你的操作系统)区块,并选择 Application(应用)标签页。
  5. 搜索“Desktop”,选择 Ubuntu 24.04 with Remote Desktop。
  6. 点击 Change OS(更改操作系统)。

步骤 2 – 连接到你的远程桌面

根据你偏好的远程访问协议和设备操作系统,选择以下配置选项之一。

选项 1 – 通过 VNC 连接

虚拟网络计算(VNC)方法使用自定义客户端提供到 VPS 界面的直接图形连接。

Windows

  1. 从官方 RealVNC 网站 下载并安装 VNC Viewer。
  2. 启动 VNC Viewer。
  3. 在地址栏中输入你的 VPS IP 地址,后接端口 5900(例如 192.0.2.1:5900)。
  4. 出现提示时,输入你的面板密码作为 VNC 密码。
  5. 点击 Connect(连接)

Linux

  1. 使用你的发行版包管理器或官方 RealVNC 包 安装 VNC Viewer。
  2. 打开终端并运行 vncviewer 命令。
  3. 输入你的 VPS IP 地址 和端口 5900
  4. 提供你的面板密码进行身份验证。

macOS

  1. 打开 Finder,点击顶部菜单中的 Go(前往),选择 Connect to Server(连接到服务器)
  2. 输入你的 VPS IP 地址 和端口 5900

或者,安装自定义客户端(如 RealVNC Viewer for macOS)并遵循 Windows 设置步骤。

选项 2 – 通过 XRDP 连接

Windows search showing Remote Desktop Connection app as best match
Windows search showing Remote Desktop Connection app as best match
Remote Desktop Connection window with IP address entered in Computer field
Remote Desktop Connection window with IP address entered in Computer field
Remote Desktop Connection warning about an unverified remote computer certificate
Remote Desktop Connection warning about an unverified remote computer certificate
xrdp login window with Session set to Xorg, username and password fields, and OK button
xrdp login window with Session set to Xorg, username and password fields, and OK button
Devices page with the plus button highlighted in the top-right corner
Devices page with the plus button highlighted in the top-right corner
VPS menu showing Add PC option selected
VPS menu showing Add PC option selected
Remote Desktop add PC dialog with PC name IP field selected and filled with 22.222.222.222
Remote Desktop add PC dialog with PC name IP field selected and filled with 22.222.222.222
VPS add credentials dialog with password field selected and username root
VPS add credentials dialog with password field selected and username root
VPS RDP certificate warning dialog with Continue button highlighted
VPS RDP certificate warning dialog with Continue button highlighted
Ubuntu VPS desktop with mouse wallpaper and desktop icons on the left, dock centered at the bottom
Ubuntu VPS desktop with mouse wallpaper and desktop icons on the left, dock centered at the bottom

XRDP 方法利用远程桌面协议(RDP),让你可以安全地登录到你的环境。

Windows

  1. 打开默认的远程桌面连接(Remote Desktop Connection)应用。
  2. 在 Computer(计算机)字段中,输入你的 VPS IP 地址,然后点击 Connect(连接)
  3. 如果出现证书警告,点击 Yes(是) 继续。
  4. 在登录屏幕上,输入 root 作为用户名和你的 VPS root 密码。

Linux

  1. 安装一个 RDP 客户端,如 FreeRDPRemmina
  2. 打开客户端并创建一个新的连接配置文件。
  3. 输入你的 VPS IP 地址,将用户名设为 root,并输入你的 root 密码。
  4. 连接以建立远程桌面会话。

macOS

  1. 从 App Store 下载并打开 Windows App(前身为 Microsoft Remote Desktop)。
  2. 点击 Add PC 或 + 图标。
  3. 在 PC name 字段中,输入你的 VPS IP 地址,然后点击 Add(添加)
  4. 双击新添加的连接。
  5. 输入 root 作为用户名和你的 root 密码。
  6. 如果出现提示,点击 Continue(继续)以绕过证书警告。

你现在已准备好访问和管理 Hostinger VPS 上的图形化 Ubuntu 24.04 环境。

注意

  • VNC 和 XRDP 连接的默认登录密码对应你的 VPS root 密码。你可以随时通过 hPanel 重置此密码。
  • 图形应用通常设计为在普通用户账户下运行。以 root 用户运行它们可能导致性能问题或权限冲突。
  • Ubuntu 22.04 操作系统模板仅适用于已在使用它的现有安装。所有新的远程桌面安装必须使用 Ubuntu 24.04 模板。

来源:Hostinger 官方帮助文档