VNC – setup for PC Windows

Getting started with VNC – remote access desktop – for PC Windows users

Step 1: If working remotely and VPN is not already installed on your notebook, computer:

Example. use VNC to connect to Linux workstation, hostname: pluto

Step 2: If you do not have a VNC password or this is the first time using/running VNC, you’ll need to create a VNC login password

  • On your PC Windows 10 computer, open a PowerShell terminal window
    ( goto: Search -> PowerShell -> select: Windows PowerShell )
  • enter: ssh username@pluto
  • enter: vncpasswd

Step 3: If a vnc session is not running, start a new vnc session running on: pluto

  • On your PC Windows 10 computer, open a PowerShell terminal window
  • enter: ssh username@pluto
  • start vnc, enter:
    vncserver :3 -geometry 1920×1200 -depth 24 -IdleTimeout=0
    this should display the message: pluto:3
    where “3” is the vnc session # number

Step 4: To connect to your vnc session

If you don’t already have VNCviewer,

On your home computer, download and install a VNC viewer client.
   I recommend using RealVNC’s viewer to ensure clipboard copy and paste
   features work correctly.

   https://www.realvnc.com/en/connect/download/viewer/

  • On your PC Windows 10 computer, Start VNCviewer
  • In the input box, enter: pluto:590X
    where “X” = vnc session # number, from vncserver
    example, enter: pluto:3 or pluto:5903
  • select: Connect (or Login)

Step 5: A small login window will appear, enter your VNC password
to connect to the VNC server on “pluto”


 –

Note 1: VNC xstartup

When starting VNC, VNC reads the file: /home/<username>/.vnc/xstartup

A minimal xstartup file is created the first time the user run vncserver; however users may need to customize their file.

In order for clipboard copy and paste to work, the user must run vncconfig in the background. This utility creates the bridge to the Window’s copy and paste clipboard. It can be run manually or included in the xstartup file.

Sample file: /home/<username>/.vnc/xstartup

#!/bin/sh 

# for RHEL/CentOS 7  

unset SESSION_MANAGER 
unset DBUS_SESSION_BUS_ADDRESS 
vncconfig -iconic & 
exec /etc/X11/xinit/xinitrc 

Sample file: /home/<username>/.vnc/xstartup

#!/bin/sh

# for RHEL/CentOS 6

   if [ -f /usr/bin/mate-session ]; then
     unset SESSION_MANAGER
     unset DBUS_SESSION_BUS_ADDRESS
     /usr/bin/mate-session

     [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
     [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
     xsetroot -solid grey
     vncconfig -iconic &
     x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
     x-window-manager &
   else
     gnome-session &
   fi

Note 2:

The Xvnc server and GNOME desktop session will run persistently.
That is, the session runs until you either kill or terminate the session –

example: vncserver -kill :X

where “X” = vnc session # number

vncserver -kill :3


or reboot pluto . You can freely disconnect and reconnect to the
remote session without terminating it.

If the GNOME desktop session hangs, kill the Xvnc server and repeat
step 3.

Note 3:

VNC, black screen, when connecting to CentOS/RHEL 7 workstation with NVidia

If trying to use vnc to access a remote system running CentOS or RHEL 7 workstation with an NVidia graphics driver installed, vnc displays a black screen. This is due to the NVidia proprietary graphics libraries and driver that are installed. The workaround is to uninstall the NV software and driver. This is a known issue and there is currently no solution.