A stable, fast reliable VNC connection to Lion or Lion server
I hope this post help people with VNC setup from non Mac machines to a Mac running Lion or Lion Server 10.7.4.
Apple has changed quite a few things in Lion regrading VNC and screen sharing. As a consequence many VNC viewers are no longer compatible until the VNC software is upgraded to be Lion compatible. You will find many posts about this topic in this forum, eg
https://discussions.apple.com/thread/3289794?start=0&tstart=0
Often, the result is that the user can't proceed beyond the gray login screen (screen locks up etc).
This post describes how configure Real VNCs VNC server on Lion Server 10.7.4 to work in conjunction! with ARD, thus allowing you to keep screen sharing enabled and still use ARD from client if that is desired)
Download the VNC server at (Version 5! necessary)
http://www.realvnc.com/download/vnc/latest/
and install the VNC server on the host (the computer you want to login to via VNC)
Single User Host setup
==================
- Install the VNC server and follow the intsruction
(If you your Mac is configured for remote management, screen sharing, remote apple events the installation may complete with error stating to contact the manufacturer....ignore the error as it most likely caused by a port conflict because VNC server and ARD (or apple scrren sgaring both use port 5900 per default), the software was still completely and correctly installed.
- start VNC Server by opening Finder -> Applications -> Real VNC -> VNC Server (User Mode)
You will see a small VNC icon in the top tsak bar of the screen.
(if you open the "information Center" the issues tab will show a port 5900 conflict)
- open VNCserver Options and select the connections tab:
+Change the default port from 5900 to 5901 and serve Java viewer on Port from 5800 to 5801
+ Change Authetication to "Mac password"
+ Select Encryption "always on"
- Selct the expert tab
+scroll down to the bottom of the list and change "StopUserModeOnSwitchOut" to "no"
(this settings prevents the VNC server to be stopped automatically if you have Fast Switching User Mode enabled on the host.)
- select "Apply"
(now if you open the Information Center" again, the port conflict problem should be solved.
- select "open" from the VNC server menu:
If the configuration was succesful, thw window will show a check mark in a green box stating everything is ok.
- In addition you will find the address that the client user will need to connect to the VNC server on the host
it will say something like "VNC viewer user can connect using the address 192.168.x.y:1"
Note: If you start several VNC servers, each session will need a dedicated port (like 5902, 5903 etc)
Router/Firewall Settings:
===================
Depending on the router/firewall you use your ports may have been automatically configured for you (airPort extreme for example).
You need to open port 5901 and 5801 and forward these ports to the IP address of the host. If ARD was alredy working in your setup, you can copy the port coniguration for ports 5900, 3283 and 3306 that are used by ARD and implement the same rules for the new port used by VNC 5901.
Review the settings of your firewall/router.
VNC client
========
- download the VNC client for your OS from
http://www.realvnc.com/download/viewer/
and follow the install instructions.
- Start the VNC client on your client PC (Windows for example) and enter the address that the VNC server reported to you earlier (192.168.x.y:1)
- Encryption : "Let VNC Server choose"
- select "connect"
- enter your Mac username and password that was setup on your host
you are now connected via VNC to your host.
You can also configure the VNC server to allow other users to login to the same! VNC session using their user credentials (friends/family or serverAdmins that want to share access to the host)
To do this open the options dialog box on the VNC server host computer and select "configure" next to authentication.
- add the users that are supposed to get access to your VNC session using their own credentials. (make sure this is what you really want, otherwise read on in the multi user section of this post)
Multi User Host Setup
=================
If multiple users are supposed to access the host computer using their own credentials logging into their own! desktop, follow these instructions:
- first enable Fast User Switching on your host computer by going to
System preferences -> User/Groups -> Login Options and select the check box "show fast user switching menu as..."
- For each user on the host that should be reached via a VNC session start VNC server (user) as described before and assign a new port number to the new user like 5902 etc.
- repeat the configuration outlined above for each user (eg. "StopUserModeOnSwitchOut" to "no")
(note initilally when you start the VNC server for the first time again, you will get notified that a port conflict exists again....this disappears as soon as the new port is configured)
now another user can login via VNC into his own desktop using the server address : "191.168..x.y.:2"
Final notes:
=========
I spent hours trying to get a variety of VNC viewers to work with the new screen sharing/VNC implementation in Lion and finally gave up. I called Apple Enterprise support and they confirmed that "a majority of the existing VNC products are not compatible with the new VNC implementation in Lion yet and that Apple recommends ARD". The discussion on what other non Mac users (Windows, Linux) should do did not go anywhere....
I have tested the above configuration with the free version VNC server 5 on the host and the free version VNC viewer 5 on a client. It worked flawlessly, fast, reproducable and very stable. You need to be aware that depending on the features you want (number of desktops, users etc) that you may have to purchase the personal or enterprise edition for the server.
The featurs are described here:
http://www.realvnc.com/products/vnc/
I personally installed the enterprise edition after I verified that the free editions worked stable and reliably as I needed them to work.
I hope you now have a stable VNC link into your Lion host from the platform of your choice !