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

100 lines
2.2 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: "GDM3"
type: concept
tags: [显示管理器, GNOME, Ubuntu]
last_updated: 2026-04-14
---
# GDM3
GNOME Display Manager 3是 Ubuntu 桌面环境默认的登录管理器,负责用户认证、会话选择和显示协议切换。
## 基本信息
- **类型**显示管理器Display Manager
- **所属项目**GNOME
- **配置文件**`/etc/gdm3/custom.conf`
- **官网**https://wiki.gnome.org/Projects/GDM
## 核心功能
- **用户认证**:显示登录界面,验证用户凭据
- **会话选择**允许用户选择桌面环境GNOME/XFCE/KDE等
- **显示协议**:控制使用 Wayland 或 X11
- **会话启动**:调用用户选择的桌面环境
## 与 Wayland/X11 的关系
GDM3 是连接显示协议和用户会话的桥梁:
```
硬件 → Kernel → Mesa/DRI → X11/Wayland → GDM3 → GNOME Shell → 用户应用
```
### 配置显示协议
编辑 `/etc/gdm3/custom.conf`
```bash
sudo nano /etc/gdm3/custom.conf
```
| 配置 | 效果 |
|------|------|
| `WaylandEnable=true`(默认) | GDM 和会话都使用 Wayland |
| `WaylandEnable=false` | 强制 GDM 和会话使用 X11 |
### 完整配置示例
```ini
[daemon]
# 取消注释以禁用 Wayland强制使用 X11
WaylandEnable=false
# 自动登录(可选)
AutomaticLogin=username
AutomaticLoginEnable=True
# Timed 登录(可选)
TimedLogin=username
TimedLoginEnable=True
TimedLoginDelay=5
```
## 重启 GDM3 服务
修改配置后需要重启 GDM
```bash
# 方法1重启 GDM 服务(不中断其他用户)
sudo systemctl restart gdm3
# 方法2完全重启会中断所有会话
sudo reboot
```
## 故障排查
### GDM 无法启动
```bash
# 查看 GDM 日志
sudo journalctl -u gdm3 -n 50
# 检查 X11 日志
cat /var/log/Xorg.0.log
```
### 切换后黑屏
通常是显卡驱动问题,尝试:
```bash
# 查看当前显卡
lspci | grep -i vga
# 安装推荐驱动
sudo ubuntu-drivers autoinstall
```
## 相关概念
- [[Wayland]] — 默认显示协议Ubuntu 24.04
- [[X11]] — 传统显示协议(通过 WaylandEnable=false 启用)
- [[RustDesk]] — 受 GDM Wayland 配置影响的远程桌面软件
- [[GNOME]] — 使用 GDM3 的桌面环境