OSXvnc icon indicating copy to clipboard operation
OSXvnc copied to clipboard

Can't log to System Server without logged user in Big Sur 11.4

Open ceztko opened this issue 3 years ago • 7 comments

I'm trying to use Vine Server because of poor performance of free VNC clients on Windows connecting to the stock "Remote Management" feature of MacOS. Vine Server has better performance and other basic features like copy and paste work so I'm very happy with that. What I'm trying to do is connecting to the "System Server" after a reboot, and the service apparently is not running. The machine has also the built-in "Remote Management" enabled on the TCP port 5900, so I can login with that and start a new session to the System Server which automatically starts on a different port (5901) after the user is logged. The UI caption seem to suggest that the System Server should start independently of any logged user so what I should expect here? Is there a bug in Vine Server, am I missing something or simply this is an unsupported scenario?

ceztko avatar Jul 15 '21 14:07 ceztko

I hate to "Me too", but this is why I stopped using the system server. Even if it started, it still had a problem with connections. I had to turn on auto-login for other reasons, so I just had it auto-launch on login. Before that, I'd connect to the Remote Management vnc server, log in, and let the Vine Server application start. Then I'd switch to the Vine server port.

kalaklanar avatar Jul 15 '21 15:07 kalaklanar

Personally I have no own experience with that feature of Vine Server, so I have to check it myself. This will take a while because of other business, so if anybody else finds a solution I'll be happy to integrate it.

stweil avatar Jul 15 '21 17:07 stweil

When selecting the "System Server" the process appear to be still launched with the credentials of the same user of the logged session. I'm expecting the process to be launched either with root or another administrative user. I guess this was the intended behavior so this may be more a bug/regression caused by a change in the OS.

ceztko avatar Jul 16 '21 15:07 ceztko

A bit of a stale issue but I'm encountering this issue as well. I may have found a possible workaround, so stay tuned.

crystall1nedev avatar Oct 31 '21 05:10 crystall1nedev

So the workaround is a bit of a mess. I hope it's only temporary. Essentially, you need to write a bash script and launch daemon, and then give bash permission to control your computer with accessibility features. Noted issues:

  • You need to unload and reload the launch daemon if you log out, as the VNC server will have shut down.
  • If you use a while loop hoping to circumvent the above, logging out and logging back in freezes the VNC connection. The mouse still moves and you can still interact, but it won't look like it to the client.
  • You have to run it as root.

crystall1nedev avatar Nov 01 '21 21:11 crystall1nedev

Macos is not my primary platform. The script you are using plus the commands to demonize it would be very appreciated.

ceztko avatar Nov 01 '21 21:11 ceztko

Here's com.osxvnc.systemserver.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>

    <key>Label</key>
    <string>com.osxvnc.systemserver.plist</string>
    <key>RunAtLoad</key>
    <true/>
    <key>EnvironmentVariables</key>
    <dict>
      <key>PATH</key>
      <string><![CDATA[/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin]]></string>
    </dict>
    <key>ProgramArguments</key>
    <array>
      <string>/bin/bash</string>
      <string>-c</string>
      <string>/Library/systemserver.sh</string>
    </array>
  </dict>
</plist>

Here's the /Library/systemserver.sh script

/bin/bash -c '"/Library/Application Support/VineServer/OSXvnc-server" -rfbport <vncport> -desktop <computer name> -rfbauth "/Library/Application Support/VineServer/.vinevncauth" -systemserver 1 -alwaysshared -restartonuserswitch N -unicodekeyboard 0 -keyboardloading y -pressmodsforkeys y -eventtap 3 -eventsource 2 -swapbuttons -rendezvous n'

(The original files are tailored towards my automatic booting of a noVNC server on this system)

crystall1nedev avatar Nov 01 '21 22:11 crystall1nedev