When I'm trying to connect to x11vnc server started on Ubuntu 16.10


The "Screen Sharing" app on on OS X 10.11.6 just hangs.

enter image description here

How can I fix this?

  • When debugging this, if there is any problem with creating the connection, note that the Screen Sharing app (in macOS 10.13.4) will leave an open connection and not try again. You need to quit the app before trying again.
    – James
    May 26, 2018 at 13:07

3 Answers 3


If you want to connect to x11vnc server using "Screen Sharing" app on OS X, you need to tweak the x11vnc starting command:

x11vnc -display :0 -noxrecord -noxfixes -noxdamage -forever -passwd 123456
  • You can't use -ncache
  • You have to use -passwd


  • 2
    Still working 08/2018 Aug 8, 2018 at 12:20
  • 1
    Still working 07/2020. With the above command running on the linux box, open Screen Sharing.app from /System/Library/CoreServices/Application/ and enter <ip-to-linux-device>:5900 and it connects. Jul 8, 2020 at 20:43
  • 1
    @SaifurRahmanMohsin from osx you can also run: open vnc://<serverip>:5900 Jul 8, 2020 at 23:22
  • 1
    works 08/2020 - macOS 10.14.6 (18G6020)
    – gnmerritt
    Aug 22, 2020 at 17:32

I used the following to set up connections to remote systems, even those using slow internet.

x11vnc -rfbport 5900 -bg -o ~/.vnc/log -rfbauth ~/.vnc/passwd -ncache 0 -speeds modem -forever -shared -ultrafilexfer -skip_lockkeys -desktop <RemoteComputer>

This starts a VNC daemon that:

  • Sets the port to 5900 (default), but you could change it here, rfbport
  • runs the server in the background, bg.
  • logs what's going on, o.
  • uses a password sored as encrypted hash, rfbauth.
  • disables pixel cache, an issue on OSX, ncache.
  • adapts data transfer to low speeds, speeds modem.
  • does not close the connection once you're done, forever.
  • accepts an unlimited amount of connections, shared. That's a thing, e.g., when your actual connection breaks and the server did not close it yet, you wouldn't be able to reconnect right away.
  • enable file sharing acc.to ultravnc, ultrafilexfer. Does not seem to work with macs though.
  • ignores lock keys of the remote computer like caps lock etc., skip_lockkeys.
  • and gives your remote computer a name, desktop.

You can set an encrypted password via

x11vnc -storepasswd

And stop the server via a simple kill signal (-SIGTERM). Enjoy!

  • oh, a thing that I found recently.. in some cases the brackets, i.e., '(' ')', do not work on the remote system. For example, it happens on VBox clients on the connected system. In such a case, use the following additional flag -skip_keycodes 187,188
    – helius
    Oct 28, 2021 at 15:25

Building off prior answer, but too long for a comment. In MacOS Big Sur 11.1, I get better performance with this:

x11vnc -display :0 -noxrecord -forever -passwd 123456

By removing -noxdamage, I see both a decrease in drawing latency and far fewer tears when resizing or minimizing windows in x11. Removing -noxfixes make a much better experience as well, because the cursor displays properly - including when the x11 cursor changes shape (e.g. to resize a window). This is very handy, otherwise you will be constantly guessing if your cursor is properly over the reside selection box. No noticeable difference (to me) from removing noxrecord, so I left it in

While the -ncache option does successfully connect, I was unable to mix ncache and multiple desktop windows. This appears to be an unexpected artifact of how desktop windows are implemented (in Y-coords, windows are "under" the main one) that conflicts with how ncache works (by also using duplicate windows under the main one).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.