Files
nexus/wiki/concepts/X11.md
2026-04-22 12:02:55 +08:00

66 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "X11"
type: concept
tags: [显示协议, Linux, 远程桌面]
last_updated: 2026-04-14
---
# X11
传统的 Linux 显示协议和窗口系统,也称为 X Window System 或 X.org是 Linux 桌面环境数十年的标准显示架构。
## 基本信息
- **类型**:显示协议 / 窗口系统
- **首个版本**1984年MIT
- **当前版本**X11R7.x / X.org Server
- **官网**https://www.x.org
## 架构特点
```
应用程序 → X Client Library → X Server → 显示硬件
网络连接(可远程)
```
- **X Server**:运行在用户本地,接收客户端请求并管理屏幕/键盘/鼠标
- **X Client**:应用程序本身,通过 X Protocol 与 Server 通信
- **网络透明**X 协议基于网络,应用程序可在远程机器运行而本地显示
## 优势
- **广泛兼容**:几乎所有 Linux 应用都支持
- **远程桌面友好**:原生支持 VNC/xrdp/SPICE 等远程协议
- **权限开放**:应用可访问屏幕内容,便于截图、录屏、远程控制
- **成熟稳定**40年历史bug少文档丰富
## 劣势
- **安全性低**:应用间共享内存,可互相截屏或注入输入
- **性能较低**:多次内存拷贝,延迟较高
- **架构老旧**设计于80年代不适合现代图形需求
## 在 Ubuntu 24.04 中的配置
Ubuntu 24.04 默认使用 Wayland但可通过 GDM3 强制启用 X11
```bash
# 编辑配置文件
sudo nano /etc/gdm3/custom.conf
# 找到并修改
[daemon]
WaylandEnable=false # 取消注释
# 重启 GDM
sudo systemctl restart gdm3
```
## 远程桌面场景
X11 在以下远程桌面场景优于 Wayland
- **RustDesk**:需要 X11 才能在 Login Screen 交互
- **VNC**:原生支持
- **xrdp**:标准方案
- **xdotool/xte**:自动化输入工具
## 相关概念
- [[Wayland]] — 新一代显示协议X11 的替代者)
- [[GDM3]] — GNOME Display Manager控制 X11/Wayland 切换
- [[RustDesk]] — 依赖 X11 的远程桌面软件