{"id":136,"date":"2025-07-02T12:00:25","date_gmt":"2025-07-02T12:00:25","guid":{"rendered":"https:\/\/haco.club\/?p=136"},"modified":"2025-07-02T12:00:25","modified_gmt":"2025-07-02T12:00:25","slug":"ubuntu-xrdp","status":"publish","type":"post","link":"https:\/\/haco.club\/?p=136","title":{"rendered":"Ubuntu XRDP"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><a href=\"https:\/\/cloud.tencent.com\/developer\/article\/2355160\">https:\/\/cloud.tencent.com\/developer\/article\/2355160<\/a><\/p>\n<\/blockquote>\n\n\n\n<p>XRDP is a cross-platform remote desktop connection tool that can be used on Windows and Linux . Using XRDP on Ubuntu allows you to remotely connect to a Linux <a href=\"https:\/\/cloud.tencent.com\/product\/cvm?from_column=20065&amp;from=20065\">server<\/a> from a Windows computer for file transfer, remote control, and other operations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Install XRDP<\/strong><\/h2>\n\n\n\n<p><strong>First, you need to install XRDP on Ubuntu. Open the terminal and enter the following command to install it:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt updatesudo apt install xrdp<\/code><\/pre>\n\n\n\n<p><strong>After the installation is complete, you can check whether XRDP was successfully installed by entering the following command:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>xrdp --version<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Black screen when connecting<\/strong><\/h2>\n\n\n\n<p>This problem is that if you do not log out of your local computer, the remote desktop will be black. The best solution is to log out of the local computer, which is to log out. This method will definitely work. Unlike the perfect remote control of Windows, in Ubuntu, local login and remote login are separated. If you log in remotely and do not log out, the local screen will be black. Conversely, if you log in locally and do not log out, the remote screen will be black. It is the option put together with shutdown and restart.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Desktop Optimization<\/strong><\/h2>\n\n\n\n<p>Note that you must modify the following configuration file before connecting remotely, otherwise the screen will go black and you will need to restart.<\/p>\n\n\n\n<p>Anyway, remember one thing: if you do not log in locally after restarting, the remote screen will not be black!<\/p>\n\n\n\n<p>If you don&#8217;t do any configuration, the desktop after startup is very awkward, because it is the original desktop of Gnome , there is no taskbar on the left, the window has no minimize button, and so on. The solution is also very simple:<\/p>\n\n\n\n<p><strong>1. Add a configuration file<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim ~\/.xsessionrc\n\n# Add\n\nexport GNOME_SHELL_SESSION_MODE=ubuntu\nexport XDG_CURRENT_DESKTOP=ubuntu:GNOME\nexport XDG_CONFIG_DIRS=\/etc\/xdg\/xdg-ubuntu:\/etc\/xdg<\/code><\/pre>\n\n\n\n<p><strong>2. Restart the xrdp service<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart xrdp.service<\/code><\/pre>\n\n\n\n<p>If you connect again at this time, you will get exactly the same effect as the native desktop!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Xrdp experience optimization to reduce\/solve screen freezes<\/h2>\n\n\n\n<p><strong>Adjusting Xrdp Configuration Parameters<\/strong><\/p>\n\n\n\n<p>Edit \/etc\/xrdp\/xrdp.ini<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tcp_send_buffer_bytes=4194304\ntcp_recv_buffer_bytes=6291456<\/code><\/pre>\n\n\n\n<p>The two parameters tcp_send_buffer_bytes and tcp_recv_buffer_bytes are commented out by default, with the default value (32768) being commented out. Adjust according to the actual situation.<\/p>\n\n\n\n<p><strong>Adjust system parameters<\/strong><\/p>\n\n\n\n<p>Temporary effect<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo sysctl -w net.core.rmem_max=12582912\nsudo sysctl -w net.core.wmem_max=8388608<\/code><\/pre>\n\n\n\n<p>Retain after reboot<\/p>\n\n\n\n<p>Write the following content to the configuration file \/etc\/sysctl.conf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>net.core.rmem_max = 12582912\nnet.core.wmem_max = 8388608<\/code><\/pre>\n\n\n\n<p>Then execute<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo sysctl -p<\/code><\/pre>\n\n\n\n<p>Restart the xrdp service to take effect<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart xrdp<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/cloud.tencent.com\/developer\/article\/2355160 XRDP is a cross-platform remote desktop connection tool that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[22],"class_list":["post-136","post","type-post","status-publish","format-standard","hentry","category-tutotial","tag-xrdp"],"_links":{"self":[{"href":"https:\/\/haco.club\/index.php?rest_route=\/wp\/v2\/posts\/136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haco.club\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haco.club\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haco.club\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haco.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=136"}],"version-history":[{"count":1,"href":"https:\/\/haco.club\/index.php?rest_route=\/wp\/v2\/posts\/136\/revisions"}],"predecessor-version":[{"id":137,"href":"https:\/\/haco.club\/index.php?rest_route=\/wp\/v2\/posts\/136\/revisions\/137"}],"wp:attachment":[{"href":"https:\/\/haco.club\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haco.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haco.club\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}