My Raspberry Pi currently boots to the desktop login screen, and I would like to keep it that way. However I would also like to be able to login to a user's (like pi) desktop using something like ssh and end up seeing the desktop on the display plugged into the RPi's hdmi port.
To clarify, I do not want to see the RPi's display on the remote computer, just use the remote computer to login and see the desktop on the display plugged into the RPi so I do not have to plug a keyboard into the RPi just to login.
Is there any way to do that?
I've tried things like stopping lightdm and starting an xserver with
startx however I get errors when I try to start any desktop application. I've also tried running
dm-tool switch_to_user pi, but I get this error:
Not running inside a display manager, XDG_SEAT_PATH not defined.
NOTE: I have run all these commands over ssh and would like to continue to use ssh to run these commands, as I am trying to avoid accessing the RPi's I/O to plug in a keyboard, and it is easy to automate running commands over ssh.