I have a mac mini with users X and Y. The mac mini auto-logins to user X on startup. I often use that mac mini via screen sharing for user Y.
Is it possible to run a command on that mac mini, so that a local (disconnected/headless) sharing session is launched for user Y? This would just sit in the background waiting for someone to run the screen sharing client via user Y.
My goal would be to use that command in launchctl daemon/agent that runs on startup (i.e. on boot, after a system restart) to have user Y start a headless session in the background.
So after a restart, the monitor would show user X logged in (as per the "Automatic login" preference in the "Login options" of "Users & Groups" in "System Preferences". At the same time though, user Y is also logged in (with startup programs restarted etc) and is rendering headless. If I were to run "ps -ef" I would see processes from user Y active and if I use screen sharing to access user Y from my laptop, I would not have to wait for a "login" but rather be met with a desktop of running programs as soon as I enter the password...