How to enable/disable wayland on Ubuntu 22.04 Desktop

本文指导如何在Ubuntu22.04JammyJellyfish上管理Wayland和Xorg显示服务器,包括编辑GDM3的custom.conf文件以启用或禁用Wayland,以及重启系统使更改生效。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ayland is a communication protocol that specifies the communication between a display server and its clients, and we can choose whether to enable/disable Wayland on Ubuntu. By default the Ubuntu 22.04 Jammy Jellyfish desktop already uses Wayland but it’s also possible to load to Xorg display server instead. In this tutorial, you will see how to disable and enable Wayland in Ubuntu 22.04 Jammy Jellyfish.

In this tutorial you will learn:

  • How to enable Wayland
  • How to disable Wayland
  • The default display manager for the GNOME desktop environment is GDM3. Therefore, we will edit the /etc/gdm3/custom.conf file to either disable or enable Wayland. Open a command line terminal and use nano or your favorite text editor to open this file with root permissions.
    $ sudo nano /etc/gdm3/custom.conf
    
  • Within this file, look for the line that says #WaylandEnable=false. You can uncomment this line and either set it to true or false, depending on whether you want Wayland enabled or not.Enable Wayland:
    WaylandEnable=true
    

    Or disable Wayland:

    WaylandEnable=false
    
  • After you have made the desired changes, save this file and exit it. You will need to restart GDM3 or reboot your Ubuntu 22.04 desktop for the changes to take effect.
    $ sudo systemctl restart gdm3
    
  • To login to Ubuntu 22.04 using the Wayland click on the gear button and select Ubuntu option before you login. If you have disabled the Wayland display server, you will only see the Xorg option appear, or the gear button doesn’t show up at all.
### 创建 `.hushlogin` 文件以禁用每日消息 在 Ubuntu 或其他基于 Linux 的操作系统中,可以通过在家目录下创建一个名为 `.hushlogin` 的隐藏文件来禁用登录时显示的每日消息或其他提示信息。以下是实现这一功能的具体方法: #### 方法描述 1. **创建 `.hushlogin` 文件** 使用 `touch` 命令可以在用户的家目录中快速创建一个空文件。运行以下命令即可完成操作: ```bash touch ~/.hushlogin ``` 这一命令的作用是在当前用户的家目录中生成一个名为 `.hushlogin` 的文件[^1]。 2. **验证文件是否存在** 可以通过以下命令确认该文件是否成功创建: ```bash ls -la ~ | grep .hushlogin ``` 如果返回的结果包含 `.hushlogin`,则说明文件已成功创建。 3. **效果说明** 创建此文件后,系统会自动停止显示默认的登录欢迎信息(motd, Message of the Day),以及其他可能由系统配置触发的信息提示。 --- ### 配置 SSH 登录行为(可选) 如果希望进一步调整远程登录的行为,可以修改 SSH 服务的相关配置文件 `/etc/ssh/sshd_config` 来增强控制能力。具体步骤如下: 1. 打开配置文件进行编辑: ```bash sudo vim /etc/ssh/sshd_config ``` 2. 查找并设置以下参数: - 将 `PrintMotd` 设置为 `no`,以完全禁用 MOTD 显示。 ```plaintext PrintMotd no ``` - (可选)将 `Banner` 参数清空或注释掉,防止自定义横幅被加载。 3. 完成修改后保存退出,并重启 SSH 服务使更改生效: ```bash sudo systemctl restart sshd ``` 上述操作能够更全面地管理系统的登录提示行为[^2]。 --- ### 下载与安装环境准备 为了确保以上操作能够在最新版本的 Ubuntu 上正常工作,建议先下载官方发布的 ISO 镜像文件。可以从以下地址获取所需资源: - 官方网站链接:[Ubuntu Download](https://ubuntu.com/download)[^3] - 清华大学开源软件镜像站:[Tsinghua TUNA Mirror](https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04.2/ubuntu-22.04.2-desktop-amd64.iso) 下载完成后按照常规流程安装 Ubuntu 即可应用前述方法。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值