Thursday, July 9, 2015

Fedora 22 LXDE VNC server (x11vnc)

For connecting to your machine over the Internet, Teamviewer is super-easy to use. But for one reason or another it's not always possible. Solution to this is x11vnc.

First, install x11vnc to your machine using

sudo dnf install x11vnc

You don't want anybody to be able to connect to your machine so you should setup password

x11vnc -storepasswd

This command will ask you to type in password for remoting-in to your machine and save it to ~/.vnc/passwd

Now, you should test to see if your VNC server works.

x11vnc -forever -rfbauth ~/.vnc/passwd -rfbport 5900

You should be able to connect to your machine with VNC Viewer.

You could run this command every time you start your machine, but it's not really handy. I wanted to setup my machine so that x11vnc server starts as soon as login screen shows (so even if I'm not logged it I could remote connect).

To do that, open file /etc/lxdm/LoginReady and add following line

x11vnc -display :0 -forever -bg -rfbauth /home/locodog/.vnc/passwd

Please note that here you should put whole path to your VNC password file, do not use ~/.vnc/passwd

Reboot your machine and test it out.

If you don't want to go through all this, after installing x11vnc you could just use x11vnc Gui to start your vnc server.

For VNC client, after testing many I recommend Remmina. It has everything I need, bookmarks because I don't want to type in IP address every time I want to connect to remote machine and also, scaling. It's really no fun having to scroll up-down, and left-right in order to reach every corner of remote display. Keep in mind that Remmina will disconnect (or not connect at all) if color depth on client side is not same as on server side.

This post was very helpful:
http://ubuntuforums.org/showthread.php?t=1868554

2 comments:

  1. Ehem, vnc was around years... before teamviewer.

    ReplyDelete
    Replies
    1. Yes, it was. But at least here where I am, entry level admins default to TeamViewer, few of my coworkers didn't even heard about VNC, so my assumption was that they cannot be only one. Also from content of the post one can see that intended audience are not senior admins.

      Delete