How to configure the VNC server in Linux and Centos
How to configure the VNC server in
Linux and Centos?
We can
configure the VNC server and can be automatically started when the system boots
or restart.
Before
this service we will have to work with some commands and script needs to be
done.
Firstly,
need to edit the /etc/sysconfig/vncservers
file to include the users in this file you want to run VNC servers . Append a
line to that file as follows:
Step 1 :-
VNCSERVERS="N:user"
Where N
is the number of users want to use the VNC server sessions to run on where the user is the username you want
the server to run as. Here below are the example for the same
VNCSERVERS="N:user1
Y:user2"
Example :-
VNCSERVERS="1:root 2:root"
Step 2 :-
$
vncpasswd
Password:
Verify:
If you want
to have the full Linux environment, create ~username/.vnc/xstartup and include the
following lines:
Step 3 :-
#!/bin/bash
unset
SESSION_MANAGER
exec
/etc/X11/xinit/xinitrc
Lastly,
ensure that the resulting file has the execute bit set:
Step 4 :-
# chmod
755 ~username/.vnc/xstartup
In order
to start the vncserver service immediately, run the following command:
Step 5 :-
# service
vncserver start
In order
for the vncserver service to start during the boot sequence, run the following
command:
Step 6 :-
#
chkconfig vncserver on
#
chkconfig --list vncserver
vncserver 0:off 1:off 2:on 3:on 4:on
5:on 6:off
Comments
Post a Comment