These directions are for remotely connecting to a Linux computer using a VNC server.
Must have a good internet connection in order for it to not be extremely slow, but note that the school's VPN may be the issue if connection is really slow.
We will be using the RealVNC program, which includes the VNC Viewer and the VNC Server.
* Simplified steps for future use after initial set up:
vncpasswd
, next enter the password you would like to use when accessing the server computer. (This will only be your VNC password when you are starting VNC) vncserver
to start the server. More information and functions about starting and killing the server in the Extra Information section of this page.chmod +x xstartup
in terminal windowSee /nas/setup/xstartup-aircraft. Put the below “code” in .vnc/xstartup using editor or cp. For example, cp /nas/setup/xstartup-aircraft ~/.vnc/xstartup
#!/bin/sh vncconfig -iconic & #Uncomment the following two lines for normal desktop: unset SESSION_MANAGER exec /etc/X11/xinit/xinitrc [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & #xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & gnome-session & #IF YOUR NOT ABLE TO OPEN A GNOME TERMINAL IN YOUR VNC SESSION, COMMENT OUT THE LINE ABOVE AND UNCOMMENT OUT THE LINE BELOW! #exec gnome-session & 0
#!/bin/sh # Uncomment the following two lines for normal desktop: # unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS # exec /etc/X11/xinit/xinitrc [ -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" & mate-session &
#!/bin/sh #Uncomment the following two lines for normal desktop: # unset SESSION_MANAGER # exec /etc/X11/xinit/xinitrc [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & #xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & mate-session &
vncserver
vncserver :*
(where * is the display number, make sure you watch your spacing!) mkdir /home/<user.name>/bin
vi vncaircraft
#!/bin/bash # Shell Access Aircraft using vnc client export VNC_VIA_CMD='/usr/bin/ssh -2 -c aes128-cbc -x -p 22 -f -L %L:%H:%R %G sleep 2' /usr/bin/vncviewer -FullColor -passwd ~/.vnc/passwd -via aircraft.atmos.und.edu :1
chmod +x vncaircraft
vncpasswd
If it asks you if you would like to enter a view-only password say yes.
/home/<user.name>/bin
directory and run vncaircraft
./vncaircraft
ls ~/.vnc/*.pid computer_name:1.pid
vncserver -kill :*
(where * is the number of the display)ps -ef | grep -i Xvnc
Do the same steps as above, however in your 'vnccalagary' file on your home server, you must input the following. NOTE: You may need to change some of the contents in this file such as your <user.name> and what server number.
#!/bin/bash # Shell Access Aircraft using vnc client export VNC_VIA_CMD='/usr/bin/ssh -2 -x -p 22 -f -L %L:%H:%R %G sleep 2' /usr/bin/vncviewer -FullColor -passwd /home/<user.name>/.vnc/passwd -via <user.name>@134.129.222.140 :1
Also, you need to use the xstartup code file for Calgary which is displayed underneath the xstartup code for linux mint machines.
1) Connect to the campus' VPN
2) Use PuTTY or the like to connect to the computer you want to remotely access
3) Start the VNC server as described in the Starting and Killing the Remote Linux VNC Server section and take note of the display number you are assigned
New 'computer_name.atmos.und.edu:1 (username)' desktop is computer_name.atmos.und.edu:1
4) Exit out of PuTTY while keeping the previous terminal open, reopen PuTTY, and type the following:
5) Open VNC Viewer and type into the VNC Server box: localhost:?? where ?? is the display number assigned to you
You can access vnc through a Linux (i.e. Redhat) terminal window with the following command:
vncviewer -via <IP address> :<display number>
With the case of esxfedoralo, it would be the following command:
vncviewer -via 134.129.214.58 :<display number>
OS X has a built in VNC viewer, so no extra software is needed to access the VNC server.
To access the VNC server: — David Delene 2020/10/19 23:12
To change the VNC viewer resolution:
To allow scripting to access VNC, people may want to use the same display number, Hence, below is list, please add your name and number. Please use vncserver :? where ? is your display number.
* Active Users
To see who is using VNC Server session use the command “ps -ef | grep -i Xvnc”. This can also be used to check if your own session is running. To kill a session use vncserver -kill :? where ? is your display number.
- Error Example: Attempting to run vnc, you may get the error 'Timed out waiting for a response from the computer.' Use above command to check your session. If your session is not running, email Derek.Stinchfield@und.edu to start session.