{"id":888,"date":"2016-01-27T12:11:39","date_gmt":"2016-01-27T19:11:39","guid":{"rendered":"http:\/\/homepages.uc.edu\/~yaozo\/wordpress\/?p=888"},"modified":"2022-11-22T05:50:58","modified_gmt":"2022-11-22T05:50:58","slug":"how-to-use-xrdp-for-remote-access-to-ubuntu-14-04","status":"publish","type":"post","link":"https:\/\/zhuoyao.net\/index.php\/2016\/01\/27\/how-to-use-xrdp-for-remote-access-to-ubuntu-14-04\/","title":{"rendered":"How to use xRDP for remote access to Ubuntu 14.04"},"content":{"rendered":"<p>To remotely control my Windows machines, I always prefer to use&nbsp;<a href=\"http:\/\/en.wikipedia.org\/wiki\/Remote_Desktop_Protocol\" target=\"_blank\" rel=\"noopener\">RDP<\/a> (<a href=\"http:\/\/en.wikipedia.org\/wiki\/Remote_Desktop_Protocol\" target=\"_blank\" rel=\"noopener\">Remote Desktop Protocol<\/a>) as it performs much nicer&nbsp;than <a href=\"https:\/\/www.realvnc.com\/\" target=\"_blank\" rel=\"noopener\">VNC<\/a>&nbsp;(<a href=\"http:\/\/en.wikipedia.org\/wiki\/Virtual_Network_Computing\" target=\"_blank\" rel=\"noopener\">Virtual Network Computing<\/a>). VNC has this streak of \u201cJPEG\u201d quality and slow behavior, whereas RDP is fast and crystal clear.<\/p>\n<p>RDP is however a proprietary protocol from Microsoft. So how can we use RDP to control our Ubuntu box remotely?<\/p>\n<p>This is where <a href=\"http:\/\/www.xrdp.org\/\" target=\"_blank\" rel=\"noopener\">xRDP<\/a> comes in play,&nbsp;an open source remote desktop protocol (RDP) server.&nbsp;It actually runs VNC protocol over RDP as far as I understand, yet if behaves much better than VNC by itself (possibly because of the used desktop manager). Since Ubuntu 12.10 (if I\u2019m not mistaken), xRDP doesn\u2019t seem to work with the Ubuntu desktop anymore \u2026 unless you use an alternative desktop manager. This seems related to 3D acceleration and nobody seems to care (since 2011, according to bug reports).<\/p>\n<p><em>Note<\/em> : if you really need Copy\/Paste functionality between the two machines, then please use Ubuntu\u2019s default installed \u201cDesktop Sharing\u201d instead (MacOS X users read <a href=\"http:\/\/www.tweaking4all.com\/forums\/topic\/macos-x-access-ubuntu-14-x-with-vnc-screen-sharing\/\">this forum post<\/a>).<\/p>\n<p>&nbsp;<\/p>\n<h2>Desktop Manager<\/h2>\n<p>Since the current desktop manager of Ubuntu (Unity which runs on Gnome) no longer seems to work with xRDP, an alternative desktop manager needs to be installed.<\/p>\n<p>I tried <a href=\"https:\/\/help.ubuntu.com\/community\/Openbox\" target=\"_blank\" rel=\"noopener\">OpenBox<\/a>, but wasn\u2019t very impressed by the amount of work needed to get a reasonable desktop.<\/p>\n<p>We will use another desktop manager that has been around for quite a long time is <a href=\"http:\/\/www.xfce.org\/\" target=\"_blank\" rel=\"noopener\">XFCE<\/a>, which is&nbsp;lightweight and fast.<\/p>\n<p><em>Note<\/em> :&nbsp;A light weight desktop manager helps making a remote desktop connection much more enjoyable.<\/p>\n<h2>Installing xRDP and XFCE<\/h2>\n<p>Installing xRDP and XFCE is pretty easy, once you know what to do \u2026<\/p>\n<p>Just make sure you have an Internet connection before you start.<\/p>\n<h4>Step 1 \u2013 Install&nbsp;xRDP<\/h4>\n<p>We will use sudo and apt-get to update your system and install xRDP. Keep in mind that sudo will ask for your admin password.<\/p>\n<div class=\"codecolorer-container bash default\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"line-numbers\">\n<div>1<br \/>\n2<\/div>\n<\/td>\n<td>\n<pre class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">apt-get update<\/span>\n<span class=\"kw2\">sudo<\/span> <span class=\"kw2\">apt-get install<\/span> xrdp<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h4>Step 2 \u2013 Install XFCE4<\/h4>\n<p>Again we will use sudo and apt-get:<\/p>\n<div class=\"codecolorer-container bash default\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"line-numbers\">\n<pre>1<\/pre>\n<\/td>\n<td>\n<pre class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">apt-get install<\/span> xfce4<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><i class=\"icon-exclamation-sign icon-color-hot\"><\/i>&nbsp; Optional, recommended by Neal, install XFCE4 terminal and 2 icons sets:<\/p>\n<div class=\"codecolorer-container bash default\">\n<table style=\"height: 119px;\" width=\"341\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"line-numbers\">\n<div>1<br \/>\n2<br \/>\n3<br \/>\n4<br \/>\n5<\/div>\n<\/td>\n<td>\n<pre class=\"bash codecolorer\"><span class=\"co0\"># Install XFCE4 terminal (way better than xterm)<\/span>\n <span class=\"kw2\">sudo<\/span> <span class=\"kw2\">apt-get<\/span> install xfce4-terminal\n \n <span class=\"co0\"># Install icon sets<\/span>\n <span class=\"kw2\">sudo<\/span> <span class=\"kw2\">apt-get install<\/span> gnome-icon-theme-full tango-icon-theme<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h4>Step 3 \u2013 Configure xRDP<\/h4>\n<p>In this step we modify 2 files to make sure xRDP uses xfce4.<\/p>\n<p>First we need to create or edit our <code class=\"codecolorer bash default\"><span class=\"bash\">.xsession<\/span><\/code>&nbsp;&nbsp;file in our home directory.<br \/>\nWe can either use nano or simply redirect an echo statement (easier):<\/p>\n<div class=\"codecolorer-container bash default\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"line-numbers\">\n<div>1<\/div>\n<\/td>\n<td>\n<pre class=\"bash codecolorer\"><span class=\"kw3\">echo<\/span> xfce4-session <span class=\"sy0\">&gt;<\/span>~<span class=\"sy0\">\/<\/span>.xsession<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>The second file we need to edit is the startup file for xRDP, so it will start xfce4.<\/p>\n<div class=\"codecolorer-container bash default\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"line-numbers\">\n<div>1<\/div>\n<\/td>\n<td>\n<pre class=\"bash codecolorer\"><span class=\"kw2\">nano<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>xrdp<span class=\"sy0\">\/<\/span>startwm.sh<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>The content should look like this (pay attention to the last line):<\/p>\n<div class=\"codecolorer-container bash default\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"line-numbers\">\n<div>1<br \/>\n2<br \/>\n3<br \/>\n4<br \/>\n5<br \/>\n6<br \/>\n7<br \/>\n8<\/div>\n<\/td>\n<td>\n<pre class=\"bash codecolorer\"><span class=\"co0\">#!\/bin\/sh<\/span>\n \n <span class=\"kw1\">if<\/span> <span class=\"br0\">[<\/span> <span class=\"re5\">-r<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>default<span class=\"sy0\">\/<\/span>locale <span class=\"br0\">]<\/span>; <span class=\"kw1\">then<\/span>\n &nbsp; . <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>default<span class=\"sy0\">\/<\/span>locale\n &nbsp; <span class=\"kw3\">export<\/span> LANG LANGUAGE\n <span class=\"kw1\">fi<\/span>\n \n startxfce4<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h4>Step 4 \u2013 Restart xRDP<\/h4>\n<p>To make all these changes effective, restart xRDP as such:<\/p>\n<div class=\"codecolorer-container bash default\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"line-numbers\">\n<div>1<\/div>\n<\/td>\n<td>\n<pre class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> service xrdp restart<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2>Testing your xRDP connection<\/h2>\n<p>On the computer that will remotely control your Ubuntu machine, start you RDP client.<\/p>\n<p>Windows comes standard with a Remote Desktop client (mstsc.exe \u2013 you can start it from a command prompt, or find the shortcut to Remote Desktop under Accessories).<\/p>\n<p>For a Mac, Microsoft actually has a Remote Desktop Client which can be found in the <a href=\"https:\/\/itunes.apple.com\/us\/app\/microsoft-remote-desktop\/id715768417?mt=12\" target=\"_blank\" rel=\"noopener\">Apple App Store<\/a>, or you can use <a href=\"http:\/\/cord.sourceforge.net\/\" target=\"_blank\" rel=\"noopener\">Cord<\/a> (free).<\/p>\n<p>Whichever client you use, most work with either the computer network name or IP address of your Ubuntu machine.<\/p>\n<p>To find the IP address on your Ubuntu box, type:<\/p>\n<div class=\"codecolorer-container bash default\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"line-numbers\">\n<div>1<\/div>\n<\/td>\n<td>\n<pre class=\"bash codecolorer\"><span class=\"kw2\">hostname<\/span> <span class=\"re5\">-I<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>(note: this is a capital \u201ci\u201d)<\/p>\n<p>Depending on your RDP client capabilities and settings (for example: Microsoft RDP Client allows automatic login), you might or might not see the login screen.<\/p>\n<p>Here we enter our Ubuntu username and password and click \u201cOK\u201d, after which briefly a window will show with the login process and you\u2019ll have access to your Ubuntu machine, even though the desktop looks different.&nbsp;One downside I\u2019ve discovered so far is that the clipboard is NOT being synchronized \u2026 so Copy and Paste between machines does not work properly.<\/p>\n<p>&nbsp;<\/p>\n<div id=\"attachment_3886\" class=\"wp-caption aligncenter\"><a class=\"fancybox image\" href=\"http:\/\/www.tweaking4all.com\/wp-content\/uploads\/2014\/07\/xrdp-login-screen.png\" rel=\"gallery\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-3886\" src=\"http:\/\/www.tweaking4all.com\/wp-content\/uploads\/2014\/07\/xrdp-login-screen.png\" sizes=\"auto, (max-width: 478px) 100vw, 478px\" srcset=\"http:\/\/www.tweaking4all.com\/wp-content\/uploads\/2014\/07\/xrdp-login-screen-180x97.png 180w, http:\/\/www.tweaking4all.com\/wp-content\/uploads\/2014\/07\/xrdp-login-screen.png 478w\" alt=\"xRDP - Login screen\" width=\"478\" height=\"258\"><\/a><\/p>\n<p class=\"wp-caption-text\">xRDP \u2013 Login screen<\/p>\n<\/div>\n<div id=\"attachment_3887\" class=\"wp-caption aligncenter\"><a class=\"fancybox image\" href=\"http:\/\/www.tweaking4all.com\/wp-content\/uploads\/2014\/07\/xrdp-screen.jpg\" rel=\"gallery\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-3887\" src=\"http:\/\/www.tweaking4all.com\/wp-content\/uploads\/2014\/07\/xrdp-screen.jpg\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" srcset=\"http:\/\/www.tweaking4all.com\/wp-content\/uploads\/2014\/07\/xrdp-screen-400x226.jpg 400w, http:\/\/www.tweaking4all.com\/wp-content\/uploads\/2014\/07\/xrdp-screen-800x452.jpg 800w, http:\/\/www.tweaking4all.com\/wp-content\/uploads\/2014\/07\/xrdp-screen.jpg 1024w\" alt=\"xRDP - Your Ubuntu xfce4 desktop\" width=\"1024\" height=\"579\"><\/a><\/p>\n<p class=\"wp-caption-text\">xRDP \u2013 Your Ubuntu xfce4 desktop<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To remotely control my Windows machines, I always prefer to use&nbsp;RDP (Remote Desktop Protocol) as it performs much nicer&nbsp;than VNC&nbsp;(Virtual Network Computing). VNC has this&hellip; <\/p>\n","protected":false},"author":1,"featured_media":962,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-888","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/888","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/comments?post=888"}],"version-history":[{"count":1,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/888\/revisions"}],"predecessor-version":[{"id":970,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/888\/revisions\/970"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/media\/962"}],"wp:attachment":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/media?parent=888"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/categories?post=888"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/tags?post=888"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}