Centos 6.X版本配置VNC:
来源:互联网 发布:喜马拉雅fm连不上网络 编辑:程序博客网 时间:2024/05/21 12:49
Centos 6.X版本配置VNC:
1.先查看主机是否已经安装VNC (centos 6.0 以后VNC名字由vnc改成tigervnc)
# rpm -qa|grep tigervnc
#
如果有安装vnc,会显示已经安装的软件版本信息;没有就不会显示,以上信息显示未安装vncsever服务。
2.安装vnc服务和桌面服务
# yum install tigervnc tigervnc-server -y
# yum groupinstall -y "Desktop" "X Window System"
执行以上命令,没有安装相关程序,则会自动安装,如果安装了一些程序,不会重复安装,会自动跳过。
TIPS:安装后会安装NetworkManager服务,此服务会和network冲突,所以如果该服务在运行中需要停止该服务,并设置开机启动项不启动。
# chkconfig --list
NetworkManager 0:off 1:off 2:on 3:on 4:on 5:on 6:off
以上命令是查看,是否有NetworkManager服务。
# chkconfig NetworkManager off
# chkconfig --list
NetworkManager 0:off 1:off 2:off 3:off 4:off 5:off 6:off
如果有NetworkManager服务,以上命令是设置开启启动项不启动。
# service NetworkManager stop
Stopping NetworkManager daemon: [FAILED]
以上命令是停止NetworkManager,运行后显示FAILED,说明该服务还没有运行。
3.将vnc服务启动项(重启主机会自动启动)
# chkconfig vncserver on
查看启动项
# chkconfig --list
vncserver 0:off 1:off 2:on 3:on 4:on 5:on 6:off
显示如上信息,已经设置vnc启动项
4.设置 VNC 密码
# vncserver
You will require a password to access your desktops.
Password:
Verify:
xauth: creating new authority file /root/.Xauthority
New 'xxx:1 (root)' desktop is xxx:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/xxx:1.log
这里“Password”是设置vnc的密码,需要输入两边。会在当前用户主目录下 生成 .vnc 目录和配置文件
# vncpasswd
Password:
Verify:
TIPS:如果需要修改vnc密码,则是输入命令:vncpasswd,仍是需要输入两次,设置的密码保存在 /root/.vnc/passwd
5.VNC 配置
# cd /root/.vnc/
# ll
total 76
-rw-r--r-- 1 root root 3101 Nov 28 13:18 xxx:1.log
-rw-r--r-- 1 root root 5 Nov 28 13:18 xxx:1.pid
-rw------- 1 root root 8 Nov 28 13:20 passwd
-rwxr-xr-x 1 root root 654 Nov 28 13:18 xstartup
TIPS:修改 xstartup 文件 把最后的 twm 改成 gnome-session
# vim xstartup
·············································
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &
修改完配置文件后,需要重启vncserver服务。
# service vncserver restart
Shutting down VNC server: [ OK ]
Starting VNC server: no displays configured [FAILED]
TIPS:重启vnc失败,需要修改 /etc/sysconfig/vncservers 文件最后面添加以下内容
VNCSERVERS="1:root"
VNCSERVERARGS[2]="-geometry 800x600"
修改vncservers文件,添加以上信息,放在最后。
# vim /etc/sysconfig/vncservers
·············································
VNCSERVERS="1:root"
VNCSERVERARGS[2]="-geometry 800x600"
TIPS:这样修改后,就算 /etc/inittab 启动模式为 3 也可以正常进入图形界面
在重启vncserver服务,可以正常重启vnc服务。
# service vncserver restart
Shutting down VNC server: 1:root [ OK ]
Starting VNC server: 1:root
New 'xxx:1 (root)' desktop is xxx:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/xxx:1.log
[ OK ]
查看运行中的vnc进程,/usr/bin/Xvnc :1 显示桌面号:5901 端口。
# ps -axjf | grep vnc
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
1086 4360 4359 1086 pts/0 4359 S+ 0 0:00 \_ grep vnc
1 2545 2495 1086 pts/0 4359 S 0 0:00 /usr/bin/Xvnc :1 -desktop AY121116112446ce98248:1 (root) -auth /root/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /root/.vnc/passwd -
rfbport 5901 -fp catalogue:/etc/X11/fontpath.d -pn
2556 2557 2495 1086 pts/0 4359 S 0 0:00 \_ vncconfig -iconic
可以使用netstat -an命令查看到,5901端口正在运行。
# netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN
- Centos 6.X版本配置VNC:
- CentOS 5.x下VNC Server配置
- 在CentOS 6.x 上安装 vnc
- centos vnc配置笔记
- centos / redhat vnc 配置
- CentOS下配置VNC
- centOS 6.5 VNC配置
- CentOS 配置VNC
- centos vnc配置总结
- centOS配置VNC Viewer
- centos配置安装vnc
- CentoS安装配置VNC
- centos VNC服务器与VNC客户端配置
- centos vnc server配置方法
- CentOS 6.0 VNC远程桌面配置
- centos 上vnc的配置
- centos vnc server配置方法
- CentOS 6.0 VNC远程桌面配置
- 安装Python-Matplotlib时出现的问题--Python version 2.7 required, which was not found in the registry
- ARM的存储器映射与存储器重映射
- 黑马程序员——基本常识,java的跨平台性,环境搭建,
- IOS多线程之——NSThread
- display:inline、block、inline-block的区别
- Centos 6.X版本配置VNC:
- Discount Louis Vuitton Bags 0OCDA
- Cheap Louis Vuitton Sunglasses 33fT8
- 常用ARM汇编指令及ATPCS规则
- xamarin.ios 拖动tablecell来重新排序
- qt中的界面按钮变化
- Cheap Louis Vuitton Sunglasses dUgIu
- Louis Vuitton Outlet Sunglasses 6x25S
- 【activiti】常用API