Remote GUI Access from Windows to Linux




Set up remote GUI access to a Linux host from a Windows host with VNC (Virtual Network Computing).
It's easy and takes only a few minutes. It took me way longer to document it than to do it, and I had not
done it for a few years, so that included time to research.

When using virtual machines, GUI access can be very clunky even when the VM is hosted on your
own fast, powerful, local machine. VNC provides a much faster and better experience.

Description:
vncserver is used to start a VNC desktop. vncserver is a Perl script which simplifies the process of
starting an Xvnc server. It runs Xvnc with appropriate options and starts a window manager on the
VNC desktop.

Here is a good implementation of VNC: TigerVNC


Install the server software on the Linux host.

Install the server on the Linux host. I use CentOS 7. I did this as root. You can use sudo if it makes you
happy.

yum install tigervnc-server.x86_64

View documentation:

man vncserver

Create a VNC desktop with the vncserver command. You can name it what you like. I chose vnc1:

vncserver -name vnc1

New 'vnc1' desktop is node01:1

node01 is the hostname in my case. You will see your hostname.

The output tells you where the startup, config and log files live:

Creating default startup script /root/.vnc/xstartup
Creating default config /root/.vnc/config
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/node01:1.log

You need to open a port in the firewall to allow remote access.

First, find out what port is in use. It's 5901 for this VNC server desktop:

ps a | grep vnc

2623 pts/0    S 0:00 /usr/bin/Xvnc :1 -auth /root/.Xauthority
-desktop vnc1 -fp catalogue:/etc/X11/fontpath.d -geometry 1024x768
-pn -rfbauth /root/.vnc/passwd -rfbport 5901 -rfbwait 30000

Open the port:

firewall-cmd --permanent --add-port=5901/tcp
success

View open ports:

firewall-cmd --list-ports
80/tcp 5901/tcp

Download the Windows client binary. All binaries are here:


I chose this one, the 64-bit client:


The client does not require install. Put it wherever is convenient on your machine.

Open it and enter the hostname and IP, and the port.

Example:


Choose Connect and enter the password when prompted, and in a moment your desktop is ready
to go.

Comments

Popular posts from this blog

Date Dimension Table Definition

Stop Flickering Pointer in Vista's Windows Explorer