You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 16.04访客会话默认用Gnome Metacity的配置文件位置查询

Set Gnome Metacity as Default Window Manager for Guest Sessions on Ubuntu 16.04

Hey there! I’ve helped with similar configuration tweaks on Ubuntu 16.04 before, so let’s walk through how to make Metacity the default window manager for guest sessions:

Key Configuration File Locations

First, let’s cover the critical files you’ll need to modify—these are tied to LightDM (Ubuntu 16.04’s default display manager) and X session startup:

  • LightDM Guest Session Wrapper: /usr/share/lightdm/lightdm.conf.d/50-guest-wrapper.conf
    This file controls how the guest session is initialized. We’ll add an environment variable here to override the default window manager.

  • X Session Startup Scripts Directory: /etc/X11/Xsession.d/
    Scripts in this folder run automatically when any X session starts (including guest sessions). We can create a custom script here to force Metacity to launch.

Method 1: Modify the LightDM Guest Configuration

This is the most straightforward approach:

  1. Open the guest wrapper config file with sudo privileges:

    sudo nano /usr/share/lightdm/lightdm.conf.d/50-guest-wrapper.conf
    
  2. Add the following line to the file (it sets the window manager environment variable):

    env/WM=metacity
    
  3. Save your changes (press Ctrl+O, hit Enter, then Ctrl+X to exit nano).

Method 2: Create a Custom X Session Script

If Method 1 doesn’t work for your setup, use this fallback approach:

  1. Create a new script file in the Xsession directory (we’ll name it 99-guest-metacity to ensure it runs last):

    sudo nano /etc/X11/Xsession.d/99-guest-metacity
    
  2. Paste the following content into the script—it checks if the user is the guest and forces Metacity to start:

    # Force Metacity as window manager for guest sessions
    if [ "$USER" = "guest" ]; then
        export WM=metacity
        exec metacity &
    fi
    
  3. Make the script executable:

    sudo chmod +x /etc/X11/Xsession.d/99-guest-metacity
    

Apply and Test the Changes

Restart LightDM to activate your new configuration:

sudo service lightdm restart

Now, when a guest user logs in, Metacity should replace the default Ubuntu window manager (Unity’s Compiz) as the active window manager.

Quick troubleshooting tip: If you run into issues, check the LightDM logs at /var/log/lightdm/ for errors related to guest session initialization or window manager startup.

内容的提问来源于stack exchange,提问作者Philippe Gaucher

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 03:37:27