xserver,实现未安装图形化桌面Linux打开GUI应用

The X Window System (X11, or simply X) is a windowing system for bitmap displays, common on Unix-like operating systems.

X窗口系统用于位图显示,常见于类Unix系统,目前比较常见的就是X11。

X uses a client–server model: an X server communicates with various client programs. The server accepts requests for graphical output (windows) and sends back user input (from keyboard, mouse, or touchscreen). 

X窗口系统使用C/S模型,一个X服务端可以与多个X服务端通信。服务端接收图形化输出的请求,并返回用户输入(来自键盘、鼠标和触摸屏)。

File:X client server example.svg

简单来说,肉眼可见的窗口都是xclient,xclient功能实现依赖xserve。

当ssh远程连接时,如果需要传递xclient,加上参数-X,从而实现x11转发

# ssh root@192.168.88.4 -X

Windows端可用的xserver有xmanager和xming,xming为开源的,而xmanager则是xshell家族的,学习成本自然低很多。

打开xshell会话属性,默认选择或者选用xming。

在未安装图形化界面的Linux中,我们尝试安装firefox,因为浏览器作为GUI应用,apt会自动帮我们解决依赖的问题,帮我们安装x11相关内容,同时也可以使用firefox进行测试。

安装完成之后,输入

 firefox &

在终端中连接其他设备也可以使用-X参数开启x11转发。

完成了以上步骤,继续查看维基百科搞清楚一些概念。

X provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting with a mouse and keyboard. X does not mandate the user interface – this is handled by individual programs. As such, the visual styling of X-based environments varies greatly; different programs may present radically different interfaces.

X窗口系统提供基础的GUI环境框架:在显示器上绘制和移动窗口,与键盘鼠标实现交互。X窗口系统不强制用户界面(这里不译作接口),用户界面由独立程序处理。因此,基于X窗口系统的可视化风格变化多样,不同的程序可能存在完全不同的界面。

X features network transparency, which means an X program running on a computer somewhere on a network (such as the Internet) can display its user interface on an X server running on some other computer on the network. The X server is typically the provider of graphics resources and keyboard/mouse events to X clients, meaning that the X server is usually running on the computer in front of a human user, while the X client applications run anywhere on the network and communicate with the user's computer to request the rendering of graphics content and receive events from input devices including keyboards and mice.

X窗口系统起网络透明度的作用,这意味着在网络上某处计算机上运行的X程序可以在网络上的其他计算机上运行的X服务器上显示其用户界面。X服务器通常是向X客户端提供图形资源和键盘/鼠标事件的提供者,这意味着X服务器通常在人类用户面前的计算机上运行,而X客户端应用程序在网络上的任何地方运行,并与用户的计算机通信以请求图形内容的呈现并从包括键盘和鼠标在内的输入设备接收事件。

这里虽然也是C/S模型,但是要注意的是server并不是Linux整机资源,而是一个进程,用于监控用户请求并返回图形化数据。需要注意的是,局域网内使用其他不会觉得卡顿。如果尝试使用x11转发去连接远程机器,界面刷新会特别慢,毕竟数据量大。

 

  • 2
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值