{"id":25,"date":"2024-06-01T13:41:33","date_gmt":"2024-06-01T13:41:33","guid":{"rendered":"http:\/\/192.168.5.10\/?p=25"},"modified":"2024-09-04T14:02:14","modified_gmt":"2024-09-04T14:02:14","slug":"automatic-rdp-session-for-old-ms-surface-tablet","status":"publish","type":"post","link":"http:\/\/blog.ltzs.us\/?p=25","title":{"rendered":"Automatic rdp session for old MS Surface tablet"},"content":{"rendered":"\n<p>I have an old Surface RT with windows 8.1 on it that I want to use as a dashboard. But Internet Explorer is ancient and won&#8217;t load Grafana&#8217;s application files. Nor will it open Home Assistant dashboards or Node-Red UI. And the Microsoft Store doesn&#8217;t work for 8.1 anymore, so I can&#8217;t even install a VNC client. &nbsp;So basically useless. However, it does have a native RDP client.&nbsp;<\/p>\n\n\n\n<p>So I installed xrdp on my debian based server. Now the trick is to start an RDP session as soon as the server boots up (normally a session is created when the RDP client connects) so I can pre-load the Firefox instance in kiosk mode so as soon as the tablet connects, grafana is loaded and displayed.<\/p>\n\n\n\n<p>A new Xrdp session creates a new Xsession at :10, which can be modified by&nbsp;<\/p>\n\n\n\n<p><mark style=\"background-color:#fcb900\" class=\"has-inline-color\"><code>sudo nano \/etc\/xrdp\/sesman.ini<\/code><\/mark><\/p>\n\n\n\n<p>and changing the section<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-bash\">[Sessions]\n; X11DisplayOffset - x11 display number offset\n; Type: integer\n; Default: 10\nX11DisplayOffset=10<\/code><\/pre>\n\n\n\n<p>In my case, :10 is fine. So I added a systemd service called startrdpsession with a new user named rdp (since various services in LXQT have trouble managing the same user with multiple xsessions. i.e. connman would start up twice in the :0 session, file manager and desktop background weren&#8217;t working right&#8230;so rather than debug all those issues, I just made a new user)&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-\">[Unit]\nDescription=xrdp session\nDocumentation=none\nRequires=xrdp.service\nAfter=network.target xrdp.service\n\n[Service]\nType=simple\nRemainAfterExit=yes\nUser=rdp\nExecStart=\/usr\/bin\/xrdp-sesrun -b 16 -p mypassword rdp\n\n[Install]\nWantedBy=multi-user.target<\/code><\/pre>\n\n\n\n<p>xrdp-sesrun has an option to pull the password from a text file instead of using the -p option, which would be more secure, but if someone is looking at my \/lib\/systemd files, I have bigger problems.<\/p>\n\n\n\n<p>So now I have an active session running as soon as the server boots up. Now I need to auto-start firefox to that Xsession in kiosk mode. I made a service file to do that called startrdpfirefox.service.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-\">[Unit]\nDescription=Launches Firefox fullscreen in the :10 X session for the MS Surface RT RDP session\n#After=graphical.target\nAfter=startrdpsession.service\n#PartOf=graphical-session.target\n\n[Service]\nUser=rdp\nType=simple\nRemainAfterExit=yes\nExecStartPre=\/bin\/sleep 10\nEnvironment=DISPLAY=:10\nExecStart=\/usr\/bin\/firefox-esr --kiosk &quot;http:\/\/thewebsiteiwant.com&quot; -profile &quot;\/home\/rdp\/firefox&quot; &amp;\n\n[Install]\nWantedBy=graphical.target<\/code><\/pre>\n\n\n\n<p>I give the system 10 seconds to settle down before running it.<\/p>\n\n\n\n<p>Then in windows I set up the admin user to log in automatically by loading the program &#8220;netplwiz&#8221; (seriously, Windows?!) and unchecking the option to require login\/password. Guide <a href=\"https:\/\/www.lifewire.com\/how-do-i-auto-login-to-windows-2626066\">here<\/a>. <\/p>\n\n\n\n<p>Now I set up a scheduled task to run immediately after login (actually with a bit of delay since I ran into issues when it runs immediately). Search for &#8220;Task Scheduler&#8221; and click on New Task, then click through the tabs as follows.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"984\" height=\"744\" src=\"http:\/\/192.168.5.10\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.12.29.png\" alt=\"\" class=\"wp-image-27\" srcset=\"http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.12.29.png 984w, http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.12.29-300x227.png 300w, http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.12.29-768x581.png 768w, http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.12.29-850x643.png 850w\" sizes=\"auto, (max-width: 984px) 100vw, 984px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"500\" src=\"http:\/\/192.168.5.10\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.13.06-1024x500.png\" alt=\"\" class=\"wp-image-28\" srcset=\"http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.13.06-1024x500.png 1024w, http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.13.06-300x146.png 300w, http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.13.06-768x375.png 768w, http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.13.06-1536x749.png 1536w, http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.13.06-850x415.png 850w, http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.13.06.png 1734w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Unfortunately, the shortest option for delay is 30 seconds, but still usable. Under Actions, you&#8217;ll choose a batch file to run the RDP connection file (that has the user\/password saved so it can log in automatically. Batch looks like:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"532\" src=\"http:\/\/192.168.5.10\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.29.43-1024x532.png\" alt=\"\" class=\"wp-image-29\" srcset=\"http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.29.43-1024x532.png 1024w, http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.29.43-300x156.png 300w, http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.29.43-768x399.png 768w, http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.29.43-850x441.png 850w, http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.29.43.png 1468w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>And the action tab looks like<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"570\" src=\"http:\/\/192.168.5.10\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.13.25-1024x570.png\" alt=\"\" class=\"wp-image-30\" srcset=\"http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.13.25-1024x570.png 1024w, http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.13.25-300x167.png 300w, http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.13.25-768x428.png 768w, http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.13.25-850x473.png 850w, http:\/\/blog.ltzs.us\/wp-content\/uploads\/2024\/06\/Screen-Shot-2024-06-01-at-09.13.25.png 1490w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>I have an old Surface RT with windows 8.1 on it that I want to use as a dashboard. But Internet Explorer is ancient and won&#8217;t load Grafana&#8217;s application files. Nor will it open Home Assistant dashboards or Node-Red UI. And the Microsoft Store doesn&#8217;t work for 8.1 anymore, so I can&#8217;t even install a&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[8,4,6,3,2,7],"class_list":["post-25","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-firefox","tag-linux","tag-microsoft-surface","tag-rdp","tag-remote","tag-xrdp-sesrun"],"_links":{"self":[{"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=\/wp\/v2\/posts\/25","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=25"}],"version-history":[{"count":8,"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=\/wp\/v2\/posts\/25\/revisions"}],"predecessor-version":[{"id":185,"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=\/wp\/v2\/posts\/25\/revisions\/185"}],"wp:attachment":[{"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=25"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=25"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}