<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>XRDP &#8211; IT Crafter</title>
	<atom:link href="https://blog.itcrafter.net/archives/tag/xrdp/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.itcrafter.net</link>
	<description></description>
	<lastBuildDate>Wed, 27 Mar 2024 16:53:48 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>Ubuntu 22.04 配置 XRDP 远程桌面</title>
		<link>https://blog.itcrafter.net/archives/122</link>
					<comments>https://blog.itcrafter.net/archives/122#respond</comments>
		
		<dc:creator><![CDATA[IT Crafter]]></dc:creator>
		<pubDate>Mon, 05 Feb 2024 16:46:33 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[UBUNTU]]></category>
		<category><![CDATA[XRDP]]></category>
		<category><![CDATA[远程桌面]]></category>
		<guid isPermaLink="false">https://blog.itcrafter.net/?p=122</guid>

					<description><![CDATA[很多人部署 Ubuntu OS 都只是用作服务器，如果偶尔也有 GUI 需求，但又不想专门为此添置显示器，那么 ... <a title="Ubuntu 22.04 配置 XRDP 远程桌面" class="read-more" href="https://blog.itcrafter.net/archives/122" aria-label="Read more about Ubuntu 22.04 配置 XRDP 远程桌面">阅读更多</a>]]></description>
										<content:encoded><![CDATA[
<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>很多人部署 Ubuntu OS 都只是用作服务器，如果偶尔也有 GUI 需求，但又不想专门为此添置显示器，那么趁手的远程桌面工具就是不二之选了。</p>



<p>Ubuntu 的远程桌面方案，大致有如下几种：</p>



<ul class="wp-block-list">
<li><strong>Gnome 自带的远程功能</strong>：系统设置中自带的远程桌面功能，优点是简单易用。但因为属于用户服务，所以必须登录系统后才能远程接入，而且一旦触发锁屏还会断开桌面会话，比较鸡肋。</li>



<li><strong>VNC 协议</strong>：跨平台的远程接入协议，但性能比较差，体现在传输图像时延迟较高而帧率较低。</li>



<li><strong>XRDP 软件</strong>：基于 RDP 远程桌面协议的免费开源程序。安装 XRDP 后，可以通过 Windows 的远程桌面客户端（mstsc.exe）接入 Ubuntu，又或者在 Linux 中使用 Remmina 等客户端接入。而且 RDP 协议在传输图像时性能更高，延迟更低。</li>
</ul>



<p>所以对于无显示器的 Ubuntu OS，推荐使用 XRDP 作为远程接入的服务端。</p>



<p>下面是以 Ubuntu 22.04 为例的 XRDP 配置步骤（shell 命令行操作）：</p>



<h4 class="wp-block-heading">1. 更新软件列表：</h4>



<pre class="wp-block-code"><code><code>$ sudo apt update</code></code></pre>



<h4 class="wp-block-heading">2. 安装 XRDP</h4>



<pre class="wp-block-code"><code><code>$ sudo apt install xrdp</code></code></pre>



<h4 class="wp-block-heading">3. 设置防火墙端口通行</h4>



<p>XRDP 的默认端口是 3389，与 Windows 上的端口一样，需要设置防护墙放行：</p>



<pre class="wp-block-code"><code><code>$ sudo ufw allow 3389</code></code></pre>



<h2 class="wp-block-heading">4. 设置开机自启动</h2>



<p>一般来说，XRDP 在安装完成之后会自动启动。如果没有，可以配置一下：</p>



<pre class="wp-block-code"><code><code>$ sudo systemctl enable xrdp     # 设置开机自启动
$ sudo systemctl start xrdp     # 手动启动 XRDP</code></code></pre>



<h2 class="wp-block-heading">5. 完成，可远程接入</h2>



<p>在 Windows 上运行 mstsc.ext，输入上述安装了 XRDP 的计算机 IP，即可接入。</p>



<p>点击“连接”后，登录界面如下图所示：</p>



<figure class="wp-block-image"><img decoding="async" src="https://pic2.helpfully.top:9522/uploads/2024/02/65c10d12ee95e.png" alt="image-20240206003003328"/></figure>



<p>输入 Ubuntu OS 的用户名和密码，便可登录桌面。</p>



<h2 class="wp-block-heading">注意</h2>



<ol class="wp-block-list">
<li>Ubuntu Desktop 版本默认的桌面环境是 GNOME；</li>



<li>Ubuntu Server 版本默认不安装桌面环境，所以远程接入后只显示一个 Terminal 窗口，如下：</li>
</ol>



<figure class="wp-block-image"><img decoding="async" src="https://pic2.helpfully.top:9522/uploads/2024/02/65c10dd8a9dd4.png" alt="image-20240206003328169"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.itcrafter.net/archives/122/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
