VNC server does not work with Mac Screen Sharing

This bug has been copied automatically from: https://bugs.launchpad.net/qemu/+bug/925405

When connecting to a QEMU instance from a Mac using any VNC settings on
the QEMU CLI and any target arch (ARM, Intel, etc.), the connection is
attempted but the negotiation never finishes.

I've verified this when building QEMU from source (1.0 and HEAD) on
Ubuntu, Fedora and Debian or when using Ubuntu (Oneiric) and Debian
(Lenny) packages.

It does not matter whether I specify authentication (or anything else) on
QEMU's side, the behavior is always the same - I see the connection being
established using netstat and tcpdump, but QEMU does not seem to send back
any pixmap data after the connection setup.

Best guess as to why this happens is that the VNC negotiation on QEMU does
not like the protocol version and VNC encoding sent by the Mac's built-in
VNC client, or that its negotiation logic is subtly broken. I appreciate
that it's not meant to be a full VNC server, but it prevents me from using
it remotely until a stable Mac build is feasible.

Background info:

Mac OS X includes a VNC client called Screen Sharing that you can invoke
in two different ways:

* At a terminal, by typing "open vnc://hostname:tcp_port"
* From any URI-enabled field (such as the Safari URI field), where you can
just type the URI as vnc://hostname:tcp_port

Please do not confuse the enhanced VNC protocol Apple Remote Desktop uses
with Screen Sharing - they are not mutually exclusive, but they are not
incompatible either, since what Apple does is to negotiate extra pixmap
encoding and authentication options - I use Screen Sharing to access many
VNC servers such as vnc4server, tightvncserver, vino, etc. without any
issues whatsoever, so the issue I'm reporting is not an issue with Apple's
implementation.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information