centos 6.5 配置安装vnc
环境:
OS:Centos 6.5
1.安装桌面包
yum -y groupinstall Desktop
yum -y groupinstall "X Window System"
2.设置图形界面启动(需要重新启动)
/etc/inittab
修改为5 图形界面启动
id:5:initdefault:
或是不设置也可以通过startx启动图形界面
3.安装图形界面右键出现打开终端栏目
[root@newepidb ios]# mount CentOS-6.5-x86_64-bin-DVD1.iso -o loop /mnt
[root@newepidb ios]#yum -y install nautilus-open-terminal
安装vnc
1.检查是否已经安装了vnc-server
[root@newepidb ios]# rpm -q tigervnc tigervnc-server
package tigervnc is not installed
package tigervnc-server is not installed
2.安装vnc-server
yum install tigervnc-server
3.配置vnc-server
打开配置文件目录并编辑配置文件
[root@VM_0_11_centos ~]# vi /etc/sysconfig/vncservers
VNCSERVERS="2:root 1:oracle"
##VNCSERVERARGS[1]="-geometry 800x600 -nolisten tcp -localhost"
VNCSERVERSVNCSERVERARGS[1]="-geometry 1024x768 -alwaysshared"
VNCSERVERSVNCSERVERARGS[2]="-geometry 1024x768 -alwaysshared"
4.输入命令启动vnc服务
初始启动时需要配置远程用户连接vnc时输入的密码
[root@newepidb ios]# vncserver
You will require a password to access your desktops.
Password:
Verify:
xauth: (stdin):1: bad display name "newepidb:1" in "add" command
New 'newepidb:1 (root)' desktop is newepidb:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/newepidb:1.log
5.修改vnc远程连接的密码
su - oracle
[oracle@newepidb ~]$ vncpasswd
Password:
Verify:
6.查看
[root@newepidb ios]# vncserver -list
TigerVNC server sessions:
X DISPLAY # PROCESS ID
:1 2536
7.关闭防火墙
[root@newepidb ios]#service iptables stop --命令关闭防火墙,但是系统重启后会开始
[root@newepidb ios]#chkconfig iptables off --关闭防火墙开机自启动
[root@newepidb ios]#chkconfig --list --查看开机情况
8.日常命令
service vncserver status
service vncserver restart
service vncserver stop
service vncserver start
vncserver -kill :1 ##kill与:之间有空格
vncserver -kill :2 ##kill与:之间有空格
9.设置屏幕保护
System -> Preferences -> Screensaver。
如果需要取消屏幕保护的锁定功能,将Lock screen when screensaver is active前面的勾去掉就可以了