Objective: turn on/enable and configure VNC server on Fedora Linux pc or server. This will allow you to remote a Fedora Linux box with a VNC client.
!!WARNING!!: This is only to be setup and configured on a Fedora Linux computer that is behind a firewall and is on your local network. It is not recommended to forward VNC traffic from the public Internet unless doing so over a SSH, (secure shell) connection. Even then you do this at your own risk. ( your password will be your only protection which is not good).
This is useful to do in situations when your server is not in the same location as you but is on your local network and protected by a firewall.
** Remember ** to always back your system before making any changes and to use strong, secure password.
Assumed: You have VNC server installed from a fresh Fedora Linux install. (This is wizard driven so I am not going to spend time going over that)
Requirement: a user account that you want to use to remotely connect to your server. (many use the same account that they would use to logon to their Linux computer locally).
Edit the file vncservers in /etc/sysconfig with a text editor with the following
(you can comment out and make changes)
( I use an ftp client and download to a temp location and edit with TexPad . I then FTP the file backup to the server)
USERNAME is the user logon that you want to connect to the Fedora Linux server remotely with.
- VNCSERVERS="2:USERNAME"
- VNCSERVERARGS[2]="-geometry 1024×768 -depth 16"
- 2 is the display number. you will need this later when you connect to the remote Fedora Linux server or pc. ie.) 5902
- the resolution is set at 1024×768 with a color depth of 16bit
If you have not done so already, open a terminal on your Fedora Linux server with root credentials
- Now set the VNC server password
- type: vncpasswd <enter>
- enter in your secure password
- verify password
Restart your VNCserver
- service vncserver restart <enter>
To make VNC server start up when your Fedora Linux server boots up..
- type: chkconfig vncserver on <enter>
- You can also do this in the GUI using the Services manager
When VNC server is started you need to edit the following file with your favorite text editor as (discussed in prior steps) /home/{useranme}/.vnc/xstartup
- remove the # sign before:
- unset SESSION_MANAGER
- exec /etc/X11/xinit/xinitrc
Example of what you will want in your startup file:
#!/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 80×24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
By uncommenting the tow lines at the top stars a GUI shell will start when you connect remotely to your Fedora Linux server with the VNC client.
On your PC launch your VNC client. Type in your server host name or IP address and append :{portNumber}:{displayNumber}
So for example you would type 192.168.45.252:5902:2 in your VNC client host box on your PC. Click OK and you should now see you Fedora Linux desktop remotely.
To make your server little more secure you can SSH into your server and stop the VNC service when you are not remotting into the Fedora Linux server.
Tags: Fedora Linux, VNC
Entries (RSS)