Linux 下 VNC Server的安装以及配置
2009-09-02 14:41
381 查看
Steps as following:
1. Install vnc-server module:
-> yum -y install vnc-server*
As root:
# useradd vncuser
# passwd vncuser
-> Login to each user(IMPORTANT), and run vncpasswd. This will create a .vnc directory.
-> Edit /etc/sysconfig/vncservers, and add the following to the end of the file.
2. 将用户名称加入到配置文件:
(注:这里的“用户名”是指linux系统用户的名称)
[gavin@centos ~]# vi /etc/sysconfig/vncservers
# VNCSERVERS="1:vncuser 2:john" # use the method for more user
VNCSERVERS="1:vncuser 2:root 3:root"
# VNCSERVERARGS[1]="-geometry 800x600"
VNCSERVERARGS[1]="-geometry 1024x768"
3. 设置用户vncuser的密码
[vncuser@centos ~]$ vncpasswd
Password:
Verify:
4. start the VNC service by following command line:
service vncserver start
5. Change xstartup for the vncserver user script, this step is very important.
[vncuser@centos ~]$ cd ~/.vnc/
[vncuser@centos .vnc]$ vi xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
#unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc
==>变为:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
6. 重启vncserver
[vncuser@centos ~]# /sbin/service vncserver restart
7. VERY IMPORTANT:
Don't forget to change inittab under /etc directory, change the boot mode from5 to 3.
8. 启动VNC client端登陆,网页上登陆的URL类似:http://xxxx.xxx.xxx:5801
客户端登陆类似:xxx.xxxx.xxx:1
http://219.233.206.150:1 (譬如是VNCViewer连接时)
启动服务时候碰到错误怎么办?
一般可以按照如下几个步骤来诊断修复:
启动VNC service时的用户是否合适,重点需要对应/etc/sysconfig/vncservers 下面的VNCSERVERS="1:vncuser 2:root 3:root" 这个配置与当前启动service的用户能否对上,另外需要注意vncpasswd的时候必须是以此启动用户登录,检查的方法就是看譬如vncuser对应的根目录下是否有.vnc子目录即可,确保这些以后就是inittab是否从5改为3了,如果以上都确认,启动vncserver应该是没有问题的,连接的时候注意客户端与服务器端是否有防火墙的阻挡。(service
iptables stop停止服务器端)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
附上centos.org上的一个troubleshooting思路:
Hello, let me start by saying I am a complete newbie to the Linux/Centos world so apologies in advance for the elementary questions/responses. My problem is the following; having built a Centos 5.9 server I am trying to configure remote access using VNCServer/VNCViewer.
Having followed all the steps outlined here: http://wiki.centos.org/HowTos/VNC-Server , I am still having issues when i try to connect . The fact that Im not prompted for a password whatsoever leads me to believe that there is something not running on the server side to begin with e.g. a service under
a particular user. So far I have done the following:
1. Created the accounts for example:
VNCSERVERS="1:larry 2:moe 3:curly"
VNCSERVERARGS[1]="-geometry 640x480"
VNCSERVERARGS[2]="-geometry 640x480"
2. Created the ~/.vnc directory for that users
3. Attempted to restart the service under the root account. When doing so, it displays the following line which might suggest that the service is running under one of the accounts, 'test', that ive created also:
[root@IMGCentos ~]# /sbin/service vncserver start
Starting VNC server: 3:test A VNC server is already running as :3
[FAILED]
[root@IMGCentos ~]# /sbin/service vncserver stop
Shutting down VNC server: 3:test [ OK ]
[root@IMGCentos ~]# /sbin/chkconfig vncserver on
[root@IMGCentos ~]#
4. Disabled the firewall
At this stage, having followed all of the steps outlined on the HowTos/VNC server page I am still unable to connect and still not getting prompted for a password. Can anyone point me in the right direction with this. Im sure there are logs that can tell me
where things are falling over. Hopefully someone can provide some steps on the best way to troubleshoot. Any feedback is much appreciated.
Cheers
1. Install vnc-server module:
-> yum -y install vnc-server*
As root:
# useradd vncuser
# passwd vncuser
-> Login to each user(IMPORTANT), and run vncpasswd. This will create a .vnc directory.
-> Edit /etc/sysconfig/vncservers, and add the following to the end of the file.
2. 将用户名称加入到配置文件:
(注:这里的“用户名”是指linux系统用户的名称)
[gavin@centos ~]# vi /etc/sysconfig/vncservers
# VNCSERVERS="1:vncuser 2:john" # use the method for more user
VNCSERVERS="1:vncuser 2:root 3:root"
# VNCSERVERARGS[1]="-geometry 800x600"
VNCSERVERARGS[1]="-geometry 1024x768"
3. 设置用户vncuser的密码
[vncuser@centos ~]$ vncpasswd
Password:
Verify:
4. start the VNC service by following command line:
service vncserver start
5. Change xstartup for the vncserver user script, this step is very important.
[vncuser@centos ~]$ cd ~/.vnc/
[vncuser@centos .vnc]$ vi xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
#unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc
==>变为:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
6. 重启vncserver
[vncuser@centos ~]# /sbin/service vncserver restart
7. VERY IMPORTANT:
Don't forget to change inittab under /etc directory, change the boot mode from5 to 3.
8. 启动VNC client端登陆,网页上登陆的URL类似:http://xxxx.xxx.xxx:5801
客户端登陆类似:xxx.xxxx.xxx:1
http://219.233.206.150:1 (譬如是VNCViewer连接时)
启动服务时候碰到错误怎么办?
一般可以按照如下几个步骤来诊断修复:
启动VNC service时的用户是否合适,重点需要对应/etc/sysconfig/vncservers 下面的VNCSERVERS="1:vncuser 2:root 3:root" 这个配置与当前启动service的用户能否对上,另外需要注意vncpasswd的时候必须是以此启动用户登录,检查的方法就是看譬如vncuser对应的根目录下是否有.vnc子目录即可,确保这些以后就是inittab是否从5改为3了,如果以上都确认,启动vncserver应该是没有问题的,连接的时候注意客户端与服务器端是否有防火墙的阻挡。(service
iptables stop停止服务器端)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
附上centos.org上的一个troubleshooting思路:
Hello, let me start by saying I am a complete newbie to the Linux/Centos world so apologies in advance for the elementary questions/responses. My problem is the following; having built a Centos 5.9 server I am trying to configure remote access using VNCServer/VNCViewer.
Having followed all the steps outlined here: http://wiki.centos.org/HowTos/VNC-Server , I am still having issues when i try to connect . The fact that Im not prompted for a password whatsoever leads me to believe that there is something not running on the server side to begin with e.g. a service under
a particular user. So far I have done the following:
1. Created the accounts for example:
VNCSERVERS="1:larry 2:moe 3:curly"
VNCSERVERARGS[1]="-geometry 640x480"
VNCSERVERARGS[2]="-geometry 640x480"
2. Created the ~/.vnc directory for that users
3. Attempted to restart the service under the root account. When doing so, it displays the following line which might suggest that the service is running under one of the accounts, 'test', that ive created also:
[root@IMGCentos ~]# /sbin/service vncserver start
Starting VNC server: 3:test A VNC server is already running as :3
[FAILED]
[root@IMGCentos ~]# /sbin/service vncserver stop
Shutting down VNC server: 3:test [ OK ]
[root@IMGCentos ~]# /sbin/chkconfig vncserver on
[root@IMGCentos ~]#
4. Disabled the firewall
At this stage, having followed all of the steps outlined on the HowTos/VNC server page I am still unable to connect and still not getting prompted for a password. Can anyone point me in the right direction with this. Im sure there are logs that can tell me
where things are falling over. Hopefully someone can provide some steps on the best way to troubleshoot. Any feedback is much appreciated.
Cheers
相关文章推荐
- Linux安装配置maven以及搭建nexus私服(实践记录)
- python安装MySQLdb:在windows下或linux下(以及eclipse中pydev使用msqldb的配置方法)
- Linux安装nginx以及配置反向代理
- Linux安装jdk 8以及环境变量配置
- Linux下ant Junit安装,配置,以及完成单元测试
- linux上安装apache以及httpd.conf基本配置
- 新手:linux环境配置以及linux下的pycharm安装
- Linux和WindowXP上安装Nginx,以及简单配置
- Haproxy在linux下安装配置,以及开日志
- Linux(Ubuntu) Java(Jdk1.8.0_60)安装以及配置
- 自己的linux系统安装以及软件配置
- linux安装jdk以及jdk的配置
- 【大数据】开发环境搭建(一):Linux安装以及配置环境Nat
- Linux安装配置maven以及搭建nexus私服
- Linux中Samba服务器的编译安装以及配置的宏的写法
- 阿里云服务器Linux(CentOS)中MySQL5.7安装以及完整的配置
- 在linux下安装GSL库以及在codeblocks上配置GSL库
- linux下mysql的安装以及环境变量的配置
- linux下安装mariadb以及相关配置
- Linux下SVN服务器安装以及配置