linux vnc 安装目录,Linux 下 VNC Server的安装以及配置

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.

启动服务时候碰到错误怎么办?

一般可以按照如下几个步骤来诊断修复:

启动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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值