United States (change)
Shortcuts: Downloads Fedora Red Hat Network
Account Links: Cart Your Account Logout
The VNC server can be automatically started when the system boots via the vncserver service. However, before this service will work, some preparatory set up needs to be done.
First, edit the /etc/sysconfig/vncservers file to include the users you want to run VNC servers for. Add a line to that file as follows:
VNCSERVERS="N:user"
Where N is the number of the display you want the VNC server to run on and user is the username you want the server to run as. Multiple displays and users can be specified by placing a space between them, as follows:
VNCSERVERS="N:user1 Y:user2"Note that if you are using the X Window System, display 0 cannot be used for VNC as it is already being used by X.
For each user you specify, a VNC password needs to be set. VNC passwords are completely separate from the normal system password for that account. A user can set their VNC password by executing the vncpasswd command. For example:
$ vncpasswd Password: Verify:
By default, VNC starts up only a simple window manager and a terminal window. If you would like to have the full Red Hat environment, create ~username/.vnc/xstartup and include the following lines:
#!/bin/bash unset SESSION_MANAGER exec /etc/X11/xinit/xinitrc
Lastly, ensure that the resulting file has the execute bit set:
# chmod 755 ~username/.vnc/xstartup
In order to start the vncserver service immediately, run the following command:
# service vncserver start
For exmaple:
# service vncserver start Starting VNC server: 1:user1
In order for the vncserver service to start during the boot sequence, run the following command:
# chkconfig vncserver on
Note this command will simply return a command prompt. For example:
# chkconfig vncserver on # chkconfig --list vncserver vncserver 0:off 1:off 2:on 3:on 4:on 5:on 6:off