{"id":3690,"date":"2022-03-11T04:27:24","date_gmt":"2022-03-11T12:27:24","guid":{"rendered":"https:\/\/wonghoi.humgar.com\/blog\/?p=3690"},"modified":"2025-10-18T14:08:56","modified_gmt":"2025-10-18T22:08:56","slug":"getting-remote-desktop-server-to-work-on-cinnamon-desktop","status":"publish","type":"post","link":"https:\/\/wonghoi.humgar.com\/blog\/2022\/03\/11\/getting-remote-desktop-server-to-work-on-cinnamon-desktop\/","title":{"rendered":"Getting Remote Desktop Server to work on Cinnamon Desktop"},"content":{"rendered":"\n<p>xrdp+xorg is a huge pain in the butt as it does not account for variations in systems properly (or automatically) so often it breaks out of the box. <\/p>\n\n\n\n<p>First of all, if you are using cinnamon (including Ubuntu Cinnamon Remix, I suspect it is the same for Linux Mint too), you will run into this shit after successfully logging in:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/askubuntu.com\/questions\/1208404\/oh-no-something-has-gone-wrong-after-clean-install-of-19-10-lvm-and-making-cha\"><img loading=\"lazy\" decoding=\"async\" width=\"707\" height=\"592\" src=\"https:\/\/wonghoi.humgar.com\/blog\/wp-content\/uploads\/2024\/05\/image-11.png\" alt=\"\" class=\"wp-image-5892\" srcset=\"https:\/\/wonghoi.humgar.com\/blog\/wp-content\/uploads\/2024\/05\/image-11.png 707w, https:\/\/wonghoi.humgar.com\/blog\/wp-content\/uploads\/2024\/05\/image-11-300x251.png 300w, https:\/\/wonghoi.humgar.com\/blog\/wp-content\/uploads\/2024\/05\/image-11-358x300.png 358w\" sizes=\"auto, (max-width: 707px) 100vw, 707px\" \/><\/a><\/figure>\n\n\n\n<p>This is a GNOME session crash. The information on the web points to some other modes of failure in ArchLinux and the like. That&#8217;s not the reason. By going through <a href=\"https:\/\/wonghoi.humgar.com\/blog\/2021\/06\/20\/remote-desktop-into-linux-gui-xrdp\/\" data-type=\"post\" data-id=\"2602\">my own notes on xrdp<\/a>, I noticed the gut of <code>\/etc\/xrdp\/startwm.sh<\/code> is to call the <strong>executable<\/strong> script <code>\/etc\/X11\/Xsession<\/code>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">test -x \/etc\/X11\/Xsession &amp;&amp; exec \/etc\/X11\/Xsession\nexec \/bin\/sh \/etc\/X11\/Xsession<\/pre>\n\n\n\n<p>However <code>\/etc\/X11\/Xsession<\/code> in term plough through a bunch of scripts in <code>\/etc\/X11\/Xsession.d <\/code>folder and one step was to look for the <strong>executable<\/strong> script <code>~\/.xsession<\/code>, which is not established by default! For some reason the Xsession scripts can figure out the local desktop environment but not when it&#8217;s launched through xrdp!<\/p>\n\n\n\n<p>So the solution is to make an executable script <code>~\/.xsession<\/code> with just one call to cinnamon-session and that&#8217;s it!<\/p>\n\n\n\n<p>I initially thought the call was just &#8216;cinnamon&#8217; because the most popular answer in the Stack Exchange <a href=\"https:\/\/askubuntu.com\/questions\/135483\/how-to-configure-xrdp-to-start-cinnamon-as-default-desktop-session\" target=\"_blank\" rel=\"noreferrer noopener\">page<\/a> suggested writing to <code>~\/.Xclients<\/code> but this redirection was now obsolete and they use <code>~\/.xsession<\/code> instead:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"671\" height=\"214\" src=\"https:\/\/wonghoi.humgar.com\/blog\/wp-content\/uploads\/2022\/03\/image-11.png\" alt=\"\" class=\"wp-image-3711\" srcset=\"https:\/\/wonghoi.humgar.com\/blog\/wp-content\/uploads\/2022\/03\/image-11.png 671w, https:\/\/wonghoi.humgar.com\/blog\/wp-content\/uploads\/2022\/03\/image-11-300x96.png 300w\" sizes=\"auto, (max-width: 671px) 100vw, 671px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"972\" height=\"128\" src=\"https:\/\/wonghoi.humgar.com\/blog\/wp-content\/uploads\/2022\/03\/image-12.png\" alt=\"\" class=\"wp-image-3712\" srcset=\"https:\/\/wonghoi.humgar.com\/blog\/wp-content\/uploads\/2022\/03\/image-12.png 972w, https:\/\/wonghoi.humgar.com\/blog\/wp-content\/uploads\/2022\/03\/image-12-300x40.png 300w, https:\/\/wonghoi.humgar.com\/blog\/wp-content\/uploads\/2022\/03\/image-12-768x101.png 768w\" sizes=\"auto, (max-width: 972px) 100vw, 972px\" \/><\/figure>\n\n\n\n<p>but when I did that, the desktop loads but there are <a rel=\"noreferrer noopener\" href=\"https:\/\/forums.linuxmint.com\/viewtopic.php?t=97628\" target=\"_blank\">no icon<\/a> and the theme colors are way off. The answer was buried here in a comment in one of the answers:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"763\" height=\"95\" src=\"https:\/\/wonghoi.humgar.com\/blog\/wp-content\/uploads\/2022\/03\/image-9.png\" alt=\"\" class=\"wp-image-3709\" srcset=\"https:\/\/wonghoi.humgar.com\/blog\/wp-content\/uploads\/2022\/03\/image-9.png 763w, https:\/\/wonghoi.humgar.com\/blog\/wp-content\/uploads\/2022\/03\/image-9-300x37.png 300w\" sizes=\"auto, (max-width: 763px) 100vw, 763px\" \/><\/figure>\n\n\n\n<p>If you want this behavior to be universal across all user (don&#8217;t have to establish the <code>~\/.xsession<\/code> for each user), and is ok with hard-coding to stick to Cinnamon desktop for everybody including local users (i.e. no redirection script to figure out based on context and conditional config files), you can just replace the last two lines of <code>\/etc\/xrdp\/startwm.sh<\/code>, which calls <code>\/etc\/X11\/Xsession<\/code>, with simply <code>cinnamon-session<\/code>.<\/p>\n\n\n\n<p>Geeze! Why does every basic feature in Windows has to turn into a freaking research project in Linux? I&#8217;ve wasted so many hours compiling XRDP from scratch from the author&#8217;s webpage thinking it&#8217;d solve the problem because he had many tutorials for a lot of cases that xrdp breaks out of the box. Turns out they didn&#8217;t matter: it&#8217;s just that xrdp couldn&#8217;t figure out the right desktop environment so it crashed after loggint in through xorg!<\/p>\n<div class=\"pvc_clear\"><\/div><p id=\"pvc_stats_3690\" class=\"pvc_stats all  \" data-element-id=\"3690\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/wonghoi.humgar.com\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p><div class=\"pvc_clear\"><\/div>","protected":false},"excerpt":{"rendered":"<p>xrdp+xorg is a huge pain in the butt as it does not account for variations in systems properly (or automatically) so often it breaks out of the box. First of all, if you are using cinnamon (including Ubuntu Cinnamon Remix, &hellip; <a href=\"https:\/\/wonghoi.humgar.com\/blog\/2022\/03\/11\/getting-remote-desktop-server-to-work-on-cinnamon-desktop\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_3690\" class=\"pvc_stats all  \" data-element-id=\"3690\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/wonghoi.humgar.com\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[39],"tags":[],"class_list":["post-3690","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/posts\/3690","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/comments?post=3690"}],"version-history":[{"count":12,"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/posts\/3690\/revisions"}],"predecessor-version":[{"id":6571,"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/posts\/3690\/revisions\/6571"}],"wp:attachment":[{"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/media?parent=3690"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/categories?post=3690"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wonghoi.humgar.com\/blog\/wp-json\/wp\/v2\/tags?post=3690"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}