首页 > 代码库 > VNC-tigervnc-server远程调用图形化

VNC-tigervnc-server远程调用图形化

  远程调用Linux图形化,很不错的..

01、远程Linux须装图形化

 yum groupinstall -y    ‘Desktop‘   ‘X Window System‘  #xclock试图形化

02、安装tigervnc-server

yum install -y tigervnc-server

03、设置vnc登录密码

[root@zabbix ~]# vncserver

You will require a password to access your desktops.

Password: Password must be at least 6 characters - try again Password: Password must be at least 6 characters - try again   #123456 Password: Verify:

New ‘zabbix:1 (root)‘ desktop is zabbix:1

Creating default startup script /root/.vnc/xstartup Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/zabbix:1.log

04、修正启动参数配置

vim /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/.Xresourcesxsetroot -solid greyvncconfig -iconic &xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &#twm &gnome-session &   #gnome

注:释掉twm,添加桌面环境。如果是kde填写kde-session & ,gnome &

 

05、启动vncserver

vncserver  :1        #启动

vncserver -kill :1   #关闭

注意:VNC服务的端口号与桌面号

VNC使用TCP端口从5900开始

桌面号为“1”  ---- 端口号为5901

桌面号为“2”  ---- 端口号为5902

桌面号为“3”  ---- 端口号为5903

 

启动多个vncserver

vncserver  :2

vncserver  :3

 06、客户端vnc-viewer

IP:端口(简写1与上面开窗口对应)

 VNC-viewer:http://files.cnblogs.com/files/xiaochina/vncviewer.zip

技术分享

07、切换用户仍可以调出图形化

172.24.0.120:2

123123

xeyes

xhost +            #其他用户也可以远程调用图形化 (root用户下)

su  - weblogic

xeyes               #测试图形化

08、黑屏解决方案

错误提示:

Starting VNC server: no displays configured 

解决方案:

vim /etc/sysconfig/vncservers

VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1360x768  -alwaysshared"

相关地址:

http://www.cnblogs.com/xiaochina/p/5823500.html

VNC-tigervnc-server远程调用图形化