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’t load Grafana’s application files. Nor will it open Home Assistant dashboards or Node-Red UI. And the Microsoft Store doesn’t work for 8.1 anymore, so I can’t even install a VNC client. So basically useless. However, it does have a native RDP client.
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.
A new Xrdp session creates a new Xsession at :10, which can be modified by
sudo nano /etc/xrdp/sesman.ini
and changing the section
[Sessions]
; X11DisplayOffset - x11 display number offset
; Type: integer
; Default: 10
X11DisplayOffset=10
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’t working right…so rather than debug all those issues, I just made a new user)
[Unit]
Description=xrdp session
Documentation=none
Requires=xrdp.service
After=network.target xrdp.service
[Service]
Type=simple
RemainAfterExit=yes
User=rdp
ExecStart=/usr/bin/xrdp-sesrun -b 16 -p mypassword rdp
[Install]
WantedBy=multi-user.target
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.
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.
[Unit]
Description=Launches Firefox fullscreen in the :10 X session for the MS Surface RT RDP session
#After=graphical.target
After=startrdpsession.service
#PartOf=graphical-session.target
[Service]
User=rdp
Type=simple
RemainAfterExit=yes
ExecStartPre=/bin/sleep 10
Environment=DISPLAY=:10
ExecStart=/usr/bin/firefox-esr --kiosk "http://thewebsiteiwant.com" -profile "/home/rdp/firefox" &
[Install]
WantedBy=graphical.target
I give the system 10 seconds to settle down before running it.
Then in windows I set up the admin user to log in automatically by loading the program “netplwiz” (seriously, Windows?!) and unchecking the option to require login/password. Guide here.
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 “Task Scheduler” and click on New Task, then click through the tabs as follows.


Unfortunately, the shortest option for delay is 30 seconds, but still usable. Under Actions, you’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:

And the action tab looks like
