RHL配置VNC Server

RHL配置VNC Server

0. 启动vncserver服务
[root@localhost ~]# service vncserver status
Xvnc 已停
[root@localhost ~]# service vncserver start
启动 VNC 服务器:no displays configured                    [确定]
1. 开启vncserver服务端
[root@localhost ~]# vncserver :1

You will require a password to access your desktops.

Password:
Verify:

New 'localhost.localdomain:1 (root)' desktop is localhost.localdomain:1

Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:1.log
2. 修改vnc显示方式
默认情况下是shell,下面设置使用xwindows方式登录到远程linux,将默认的twm &注释掉,增加一行gnome-session &,使用的是GNOME桌面,还有KED方式:startkde&。
[root@localhost ~]# vi /root/.vnc/xstartup
[root@localhost ~]# cat /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" &
# twm &
gnome-session &
如果要立即生效连接桌面方式,需要重启服务:
[root@localhost ~]# vncserver -kill :1
Killing Xvnc process ID 8135
[root@localhost ~]# vncserver :1
查看下监听状态:
[root@localhost ~]# netstat -tulnp
3. 在客户端连接
192.168.2.203:5901 http://192.168.2.203:5801
4. 配置vncserver自启动
[root@localhost ~]# chkconfig --list vncserver
vncserver          0:关闭    1:关闭    2:关闭    3:关闭    4:关闭    5:关闭    6:关闭
[root@localhost ~]# chkconfig --level 2345 vncserver on
[root@localhost ~]# chkconfig --list vncserver
vncserver          0:关闭    1:关闭    2:启用    3:启用    4:启用    5:启用    6:关闭
修改开机启动服务进程
[root@localhost ~]# vi /etc/sysconfig/vncservers
[root@localhost ~]# cat /etc/sysconfig/vncservers
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# 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/archive/vnc/sshvnc.html>.

# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.

# Use "-nohttpd" to prevent web-based VNC clients connecting.

# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel.  See the "-via" option in the
# `man vncviewer' manual page.

 VNCSERVERS="1:root"
 VNCSERVERARGS[1]="-geometry 1024x768"
 
 -The End-
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值