
二、安装Xmanager Enterprise
三、启动Xmanager - Passive
四、启动Xshell,远程连接Linux
五、执行 export DISPLAY=客户端机器IP(使用Xshell端的机器IP):0.0
a) 例如:export DISPLAY=192.168.1.9:0.0
六、安装X-window必要支持包
sudo yum install xorg-x11-xauth xorg-x11-fonts-* xorg-x11-font-utils xorg-x11-fonts-Type1 xclock
七、执行: xhost +
八、执行: xclock
X Window即X Windows图形用户接口,是一种计算机软件系统和网络协议,提供了一个基础的图形用户界面(GUI)和丰富的输入设备能力联网计算机。其中软件编写使用广义的命令集,它创建了一个硬件抽象层,允许设备独立性和重用方案的任何计算机上实现。本文讲解如何在最小化安装的RedHat中安装X Window。#ssh以支持XWindow的形式登录
[root@larrywen software]# ssh 192.168.0.29 -X
The authenticity of host '192.168.0.29 (192.168.0.29)' can't be established.
RSA key fingerprint is 38:a0:60:c2:e8:71:26:e5:b3:83:75:a8:e6:25:d8:5e.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.29' (RSA) to the list of known hosts.
root@192.168.0.29's password:
Last login: Sat Jul 27 13:46:29 2013 from 192.168.0.10
#本地创建一个文件,编辑保存一个文件到远程,可以看到远程有刚创建的文件
[root@linuxidc ~]# gedit
[root@linuxidc ~]#
#以支持XWindow的形式登录,远程不安装X Window服务,可以看到本机编辑保存的文件
[root@larrywen Desktop]# ssh 192.168.1.11 -X
root@192.168.1.11's password:
Last login: Sat Jul 27 19:26:38 2013 from 192.168.1.1
/usr/bin/xauth: creating new authority file /root/.Xauthority
[root@serv01 ~]# gedit
[root@serv01 ~]# ls Unsaved\ Document\ 1
Unsaved Document 1
#安装X Window,建议安装完后重启
[root@serv01 ~]# yum groupinstall "X Window System" "Desktop" -y
#卸载X Window
[root@serv01 ~]# yum groupremove "X Window System" "Desktop" -y
#可以选择安装Gnome或者KDE
#RHEL5 6,Desktop 默认是Gnome
#RHEL4,Desktop 默认是KDE
#虚拟机下要启动图形界面,需要调整内存,最好800M
#字符界面下启动图形界面
[root@serv01 ~]# startx
#图形界面下退回字符界面
Ctrl+Alt+Back
#测试用:如果安装后卸载然后重新安装后出现鼠标、键盘不能移动,重启解决
本文主要介绍如何在Linux下配置图形服务以便ssh远程使用GUI环境。
Linux的桌面环境是通过X Server(XFree86、Xorg),X Client(libX11),Window Manager(KDE、xfce、wm2)等服务提供的。我们先简单了解X涉及的一些概念,下面的X架构图来自wikipedia,请注意X server是运行在有屏幕的机器这边,也就是你自己的PC上,而远程执行的应用,例如jvisualvm则是X的client端。换句话说就是SSH的client端是X的server端,SSH的server端是X的client端。
由于X server是监听在本地的,ssh服务端的远程client想连回本地必须使用remote tunnel, X11 forwarding 则可以方便的将X11协议转发到远程主机。转发过程中会自动设置 DISPLAY 环境变量和Xauth授权信息。
然后重启sshd,重启并不会导致已连上的ssh client断开。
服务器的XLib版本则可以通过 rpm -q libX11 命令确认。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)