Centos 6.2 开启 VNC远程桌面
2013-10-30 21:50
417 查看
服务器放在机房,常会有需要使用Linux桌面的需求,把过程写下来,系统Centos 6.2
一、查看是否安装 VNC
centos 6.0 以后VNC名字 由 vnc 改成 tigervnc
[root@xen ~]# rpm -qa|grep tigervnc
tigervnc-1.0.90-0.17.20110314svn4359.el6.x86_64
tigervnc-server-1.0.90-0.17.20110314svn4359.el6.x86_64
如果没有就安装下了
[root@xen ~]# yum install tigervnc tigervnc-server -y
添加启动项
[root@xen ~]# chkconfig --add vncserver
[root@xen ~]# chkconfig vncserver on
二、设置 VNC 密码
[root@xen ~]# vncserver
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/xen:1.log
会在当前用户主目录下 生成 .vnc 目录和配置文件
[root@xen ~]# vncpasswd
Password:
Verify:
设置的密码保存在 /root/.vnc/passwd
三、VNC 配置
修改 xstartup 文件 把最后的 twm & 删掉 加上 gnome-session &
[root@xen ~]# cd /root/.vnc/
[root@xen .vnc]# tail -n 3 xstartup
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &
如果直接 启动
[root@xen .vnc]# /etc/init.d/vncserver start
正在启动 VNC 服务器:no displays configured [失败]
所以要修改 /etc/sysconfig/vncservers 文件添加以下内容
VNCSERVERS="2:root"
# 桌面号:用户 监听 590* 端口
VNCSERVERARGS[2]="-geometry 800x600"
这样修改后,就算 /etc/inittab 启动模式为 3 也可以正常进入图形界面
启动 vncserver
[root@xen ~]# /etc/init.d/vncserver start
正在启动 VNC 服务器:2:root xauth: (stdin):1: bad display name "xen:2" in "add" command
New 'xen:2 (root)' desktop is xen:2
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/xen:2.log
[确定]
四、VNC 连接
可以使用下载安装vnc客户端的方式进行连接,也可以使用google浏览器appstore里面搜索vnc插件
注意连接的时候,ip地址那填写服务器的ip:2,2是上配置里面写的,连接用户名root,密码在上面定义的密码
一、查看是否安装 VNC
centos 6.0 以后VNC名字 由 vnc 改成 tigervnc
[root@xen ~]# rpm -qa|grep tigervnc
tigervnc-1.0.90-0.17.20110314svn4359.el6.x86_64
tigervnc-server-1.0.90-0.17.20110314svn4359.el6.x86_64
如果没有就安装下了
[root@xen ~]# yum install tigervnc tigervnc-server -y
添加启动项
[root@xen ~]# chkconfig --add vncserver
[root@xen ~]# chkconfig vncserver on
二、设置 VNC 密码
[root@xen ~]# vncserver
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/xen:1.log
会在当前用户主目录下 生成 .vnc 目录和配置文件
[root@xen ~]# vncpasswd
Password:
Verify:
设置的密码保存在 /root/.vnc/passwd
三、VNC 配置
修改 xstartup 文件 把最后的 twm & 删掉 加上 gnome-session &
[root@xen ~]# cd /root/.vnc/
[root@xen .vnc]# tail -n 3 xstartup
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &
如果直接 启动
[root@xen .vnc]# /etc/init.d/vncserver start
正在启动 VNC 服务器:no displays configured [失败]
所以要修改 /etc/sysconfig/vncservers 文件添加以下内容
VNCSERVERS="2:root"
# 桌面号:用户 监听 590* 端口
VNCSERVERARGS[2]="-geometry 800x600"
这样修改后,就算 /etc/inittab 启动模式为 3 也可以正常进入图形界面
启动 vncserver
[root@xen ~]# /etc/init.d/vncserver start
正在启动 VNC 服务器:2:root xauth: (stdin):1: bad display name "xen:2" in "add" command
New 'xen:2 (root)' desktop is xen:2
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/xen:2.log
[确定]
四、VNC 连接
可以使用下载安装vnc客户端的方式进行连接,也可以使用google浏览器appstore里面搜索vnc插件
注意连接的时候,ip地址那填写服务器的ip:2,2是上配置里面写的,连接用户名root,密码在上面定义的密码
相关文章推荐
- Linux 与 Windows 对UNICODE 的处理方式
- Ubuntu12.04下QQ完美走起啊!走起啊!有木有啊!
- 解決Linux下Android开发真机调试设备不被识别问题
- Centos6 编译安装Python
- Ubuntu Linux使用体验
- c语言实现hashmap(转载)
- Linux 信号signal处理机制
- linux下mysql添加用户
- Scientific Linux 5.5 图形安装教程
- 硬盘安装CentOS 6.2以及添加GRUB启动菜单
- 基于 Linux 集群环境上 GPFS 的问题诊断
- 谁是桌面王者?Win PK Linux三大镇山之宝
- vivi下重新调整分区
- CentOS 6.2实战部署Nginx+MySQL+PHP
- Linux VS Unix:Linux欲一统天下 Unix不死
- linux下设定环境变量
- Linux下修改MySQL编码的方法
- Linux串口通信
- 从Windows系统下访问Linux分区相关软件