Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Add Guest Session in Ubuntu Desktop

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To add a guest session in Ubuntu Desktop, you need to enable the feature in the system's login screen settings. By default, Ubuntu's GDM (GNOME Display Manager) hides the guest session option, but you can turn it on with a simple configuration change. This guide walks you through the exact steps for Ubuntu 22.04 LTS and newer versions (GNOME desktop).

What You'll Need

  • A Ubuntu desktop installation (22.04 or later) with the default GNOME desktop environment.
  • Administrative (sudo) access to edit system configuration files.
  • A terminal window (Ctrl+Alt+T).

Step-by-Step

  1. Open a terminal. Press Ctrl+Alt+T on your keyboard to launch the terminal window.
  2. Create a custom GDM configuration file. The guest session is controlled by a file in the GDM configuration directory. Run the following command to create a new file (if it doesn't exist):
    sudo nano /etc/gdm3/custom.conf
    If you prefer a different text editor (like gedit or vim), replace nano with your choice.
  3. Add the guest session line. In the file, look for the [daemon] section (it may be empty or have comments). Add the following line under that section:
    Enable=true
    Make sure it is exactly Enable=true (capital E, no spaces). If the line already exists and is set to false, change it to true.
  4. Save and exit. In nano, press Ctrl+O to write the file, then Ctrl+X to exit. If using gedit, just close the window and click "Save".
  5. Restart the GDM service. To apply the change, you need to restart the display manager. Run:
    sudo systemctl restart gdm3
    This will log you out of your current session. Save any open work before running this command.
  6. Log in and check. After the restart, you will see the login screen. Click on the user list (or the "Not listed?" option) and look for a "Guest Session" entry. It may appear as a separate user icon or as an option in the top-right corner of the login screen. Click it to start a guest session.

Common Mistakes

  • Typo in the configuration line: The line must be exactly Enable=true under the [daemon] section. A common mistake is writing enable=true (lowercase) or placing it under the wrong section (like [security]).
  • Editing the wrong file: Some guides mention /etc/gdm/custom.conf (without the 3). On Ubuntu, the correct path is /etc/gdm3/custom.conf. Editing the wrong file will have no effect.
  • Not restarting GDM: The change only takes effect after restarting the display manager. Simply logging out and back in may not be enough.
  • Using sudo with nano but not saving correctly: Ensure you have write permissions. If you get a "Permission denied" error, you forgot the sudo prefix.

Tips

  • Test in a virtual machine first: If you are unsure, try the steps in a VM to see how the guest session behaves before applying it to your main system.
  • Know what a guest session does: A guest session gives a temporary user a clean desktop with no access to your personal files. All data created during the session is deleted when the guest logs out.
  • Disable it later: To remove the guest session, simply set Enable=false in the same file and restart GDM.
  • If you use a different desktop environment: This guide is for the default GNOME desktop. If you use KDE Plasma, Xfce, or others, the method differs and may require installing additional packages (like lightdm for Xfce).

Troubleshooting

If the guest session does not appear after following the steps, try these in order:

  1. Check the configuration file: Re-open /etc/gdm3/custom.conf and verify the line is exactly Enable=true under [daemon]. Look for any stray spaces or comments that might interfere.
  2. Restart the system: Sometimes a full reboot is more reliable than restarting the GDM service. Run sudo reboot and check again.
  3. Check GDM status: Run systemctl status gdm3 to ensure the service is running without errors. If it shows errors, look for clues in the output.
  4. Try a different display manager: If GDM is not cooperating, you can switch to LightDM (the default in older Ubuntu versions) which has a simpler guest session toggle. Install it with sudo apt install lightdm, then select it during configuration. This is a more involved change, so only do this if you are comfortable.
  5. Check for conflicting settings: Some system tweaks (like from GNOME Tweaks) or custom themes can hide the guest session. Temporarily reset your login screen theme to default to test.

Frequently Asked Questions

Is the guest session available by default in Ubuntu?

No, it is disabled by default in recent Ubuntu versions (since 18.04) for security and privacy reasons. You need to enable it manually as described above.

Can I customize what a guest can do?

Not easily. The guest session is designed to be a temporary, sandboxed environment. You cannot restrict specific apps or folders without advanced system configuration (like AppArmor or custom policies), which is beyond the scope of this guide.

Will enabling guest session affect my personal files?

No. The guest session runs in a temporary home directory that is cleared on logout. Your personal files remain protected and inaccessible to the guest user.

Does the guest session require an internet connection?

No, it works offline. The guest user can use any installed applications, but they won't have access to your saved Wi-Fi passwords or browser profiles.

Can I have multiple guest sessions at once?

Yes, you can start multiple guest sessions, but each one is independent. They can run simultaneously, but they share the same temporary home directory, so files saved in one guest session may be visible in another until logout.

What if I want to remove the guest session later?

Simply edit /etc/gdm3/custom.conf and change Enable=true to Enable=false, then restart GDM. The guest session will disappear from the login screen.