Connecting to the built-in Mac VNC server from a Windows machine

Connecting to the built-in Mac VNC may cause the host machine to freeze up when connecting from Windows. Included are some potential fixes..

Igor Shults

A little-known fact about Mac versions 10.4 (Tiger) and over, is that they come with a built-in VNC server. This feature is included in a couple of the “Sharing” options and can be accessed with a regular VNC viewer/client.

However, when connecting from a Windows machine (particularly when running TightVNC as the viewer), I found I had to configure a few extra settings to make it work without constant freezes on my Mac, forcing me to hard reset. Here are some of the tweaks I had to make to ensure I could connect without issues. I am running 10.7.5 (Lion), so your steps may vary slightly.

Firstly, you need to allow VNC connections. The two options are either Screen Sharing or Remote Management. Screen Sharing is what the “average” VNC user may need, while the latter is helpful if you need more permissions and control over the host machine.

Allowing VNC connections:

Step 1 - Go to your System Preferences and under the Internet and Wireless heading, click on Sharing. Step 2 - Enable either the Screen Sharing or the Remote Management checkboxes. Step 3 - Click on Computer Settings and enable “VNC viewers may control screen with password.” Step 4 - Provide a password and click “OK”. (Only for Remote Management) Step 5 - Click on Options and enable any other permissions you may need.

You should now have a VNC server running on the standard port 5900 of your machine. You should (in theory) be able to connect to your Mac with any viewer using your machine’s IP address and the port. As I mentioned before, I had some issues connecting from Windows, and had to take a few precautions. I’m using TightVNC, so these changes may or may not be necessary on other viewers.

Tweaks for Windows:

  • To prevent receiving a patterned, gray screen after the login, be sure to logout of your current user on your Mac first. The viewer will prompt for a password, but once connected, will not display the actual desktop unless no users are logged in on the host.
  • In the Options menu:

    • Enable “Disable clipboard transfer.” This was a major issue that would cause freezing immediately upon on connect unless enabled. Of course, you will not be able to share the clipboard across the host and client machines, but at least the host machine will continue running properly.
    • Set the “Preferred Encoding” to either “Raw” or “ZRLE”. The other options appeared to work, but seemed to cause some minor freeze-ups on the Mac.
  • Oftentimes after closing the viewer, the Mac would freeze yet again, requiring a reset. One workaround is to click the “Pause” button (double red bar) in the active Viewer before closing the connection. Have not yet gotten a chance to look into why this works, but it seems to solve the problem for the time being.

Following these steps should help ensure you can connect to your Mac from a Windows machine.  Just enter <host IP>:5900 as the Remote Host and enter the password from before to connect.

Of course, another option is to simply user a third-party VNC server, but if you don’t feel like installing more software, hopefully this should help in preventing a few headaches.

Igor Shults

Share this Post

Related Blog Posts

Unknown

Caching with JCS

December 19th, 2012

Learn how to use JCS to cache data in your application.

Brendon Anderson
Unknown

Recovering from Merge Errors in Mercurial with Sub-Repositories and Named Branches

March 8th, 2012

Recovering from Merge Errors in Mercurial with Sub-Repositories and Named Branches

Object Partners
Unknown

Introduction to Servlet 3.0

January 16th, 2012

One very nice thing Servlet 3.0 brings us is a set of annotations to declare Filters and Servlets and Listeners. With these annotations, the configuration of applications is removed from the web.xml file and put into the applications JARs and WEB-INF/classes.

Object Partners

About the author

Igor Shults

Sr. Consultant

Igor is a self-driven developer with a desire to apply and expand his current skill set.  He has experience working with companies of all sizes on the whole application stack, from the database to the front-end.  He enjoys working in collaborative environments involving discussion and planning around data modeling and product development.