blog-banner

OS X Mavericks Concurrent Remote User Access from Linux

    Goal:

    To do concurrent remote desktop access on a single OS X machine from multiple Linux/Windows desktops in a way that one session does not interfere with another user's session & performance should be acceptable to use.

    OS X's built-in "Screen Sharing" utility:

    VNC protocol serves as the base for remote user access on OS X, just like its RDP on Windows. Starting from OS X Lion+, we know that OS X ships with a built-in utility called "Screen Sharing" to offer remote user login. There is a number of articles explaining how to do that and what VNC clients you could use. However, that works great when it is accessing the server from another Mac. Due to its closed nature, OS X's screen sharing doesn't work well with VNC clients available for Linux.

    Problem:

    Issues that were faced with the built-in sharing utility when accessing Linux Clients are:

    • Poor performance - it takes ages to just see the cursor/mouse pointer move. It's practically unusable with the default setup
    • Unable to update resolution - when we change resolution from the client window, it corrupts the session's display and takes 5-10 mins to repair itself

    Solution:

    Use an alternative stand-alone VNC Server

    • Download Real VNC and install it on the host OS X machine. It is to be noted that this method requires the Mac to be connected to a display. Once installed RealVNC server would run in "Service Mode" - however, the model won't be useful for concurrent user access because it shares the main display screen for all users.
    • Assume that there are 3 users on the host OS X: user1 (who uses the Mac on its native display), user2 & user3 connect remotely from Linux desktops
    • Since we are to run RealVNC in user-mode, it means that if user2 has to remotely log in to his account named "user2" on the host machine, he has to first login to the user2 account on the host machine locally - then start the RealVNC server in user-mode and then use the switch-user feature to go back to the native user account "user1". Now, user2 could remote login to his user2 account until the host system is up & running (and until the user2 account is not logged out)
    • There is a gotcha: by default - the RealVNC server in user mode will kill itself on fast user-switching. To prevent the default behavior, go to RealVNC server options -> Expert -> set StopUserModeOnSwitchOut to False - refer screenshot below

    Now, user1 could continue his work on native display and user2 could access his account through a VNC client at acceptable speed & quality. The same process has to be repeated for a number of other user accounts as required.

    Yes - it's not an easy job starting up the VNC server in user mode for any number of users manually. In that case, leaving the OS X host running 24x7 could be a viable solution. I would be happy to hear if anyone has a better solution to share.