VNC在Linux上的配置

本文详细介绍了如何在Linux(CentOS)上配置和管理VNC服务器,包括启动/停止/重启VNC服务,设置密码,通过IE、Firefox浏览器及VNC Viewer登录,以及设置登陆到KDE桌面,特别提到了防火墙设置和多用户同时登录的选项。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、VNC的启动/停止/重启
1.1

#service vncserver start/stop/restart

关闭具体的vncserver命令:vncserver -kill :1       vncserver -kill :2

1.2

--Add more port after VNC Server is running

#vncserver N

2、设置密码

#vncpasswd

3、客户端登陆, Windows和linux都可以登陆到VNC Server
3.1 从IE和firefox登录

直接从IE浏览器中输入如下地址:

http://xxx.xxx.xxx.xxx:5801

输入密码即可使用。

3.2 从VNC view登录

在windows上安装vnc view,然后输入xxx.xxx.xxx.xxx:5901,连接登录,输入密码即可。

备注:VNC给浏览器的端口是5800+N,给vncviewer的端口是5900+N,N是设置的display号.防火墙一定要打开vnc的设置,VNCViewer 切换全屏模式:F8

4、设置登陆到KDE桌面

4.1

[root@centos ~]# vi /etc/sysconfig/vncservers

#

# Uncomment the line below to start a VNC server on display :1

# as my 'myusername' (adjust this to your own). You will also

# need to set a VNC password; run 'man vncpasswd' to see how

# to do that.

#

# DO NOT RUN THIS SERVICE if your local area network is

# untrusted! For a secure way of using VNC, see

# <URL:>.http://www.uk.research.att.com/vnc/sshvnc.html

# VNCSERVERS="1:myusername"

VNCSERVERS="1:root"

#You can add more user here

# VNCSERVERARGS[1]="-geometry 800x600"

VNCSERVERARGS[1]=”-geometry 800×600 -alwaysshared -depth 24″

-alwaysshared代表允许多用户同时登录 -depth代为色深,参数有8,16,24,32。

注:红色部分就是被修改或增加的部分

4.2

[root@centos .vnc]$ vi /root/.vnc/xstartup

#!/bin/sh

# Uncomment the following two lines for normal desktop:

unset SESSION_MANAGER

exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources

xsetroot -solid grey

vncconfig -iconic &

xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

#gnome-session & #set starting GNOME desktop

startkde &        #kde desktop is used

#twm &   #Text interface

注:有的系统配置里有 –nolisten tcp 和 –nohttpd ,这两个是阻止Xwindows登陆和HTTP方式VNC登陆的,如果需要图形界面,那就删除这部分。

注:红色部分就是被修改或增加的部分

4.3

 

重启VNC即可。

http://hi.baidu.com/xiaorong_boy/blog/item/b188845102caf02742a75b1a.html的基础上稍作修改。

Technorati Tags: linux, vnc
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值