centos6.5远程桌面连接(VNC\SPice)

在Linux下用vnc远程桌面,centos中默认没有安装VNC

查询系统是否安装VNC

# rpm -q tigervnc tigervnc-server

 

安装VNC服务

# yum install tigervnc tigervnc-server -y

为vncserver设置密码

[root@localhost ~]# vncserver

You will require a password to access your desktops.

Password:<输入vnc登录密码>
Verify:<再次输入vnc登录密码>

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

[root@localhost ~]# 

配置vnc

为了防止黑屏,需要修改一下/root/.vnc/xstartup,注释下面两行并添加一行内容

# vi /root/.vnc/xstartup 

#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
gnome-session &

修改用户配置文件

# vi /etc/sysconfig/vncservers

添加两行

VNCSERVERS="2:root"
VNCSERVERARGS[2]="-geometry 1024x768 -depth 32"

改变xstartup的权限

# chmod 777 /root/.vnc/xstartup

防火墙开放端或者也可以直接关闭防火墙

查看端口号

# netstat -antpl

 关闭防火墙

# service iptables stop

启动VNC

# /etc/init.d/vncserver start

然后在Windows中用客户端登录

猜你喜欢

转载自www.cnblogs.com/djlsunshine/p/10270654.html