How to Add Guest Session in Ubuntu Desktop
In this article
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
- Open a terminal. Press
Ctrl+Alt+Ton your keyboard to launch the terminal window. - 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):
If you prefer a different text editor (like gedit or vim), replacesudo nano /etc/gdm3/custom.confnanowith your choice. - 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:
Make sure it is exactlyEnable=trueEnable=true(capital E, no spaces). If the line already exists and is set tofalse, change it totrue. - Save and exit. In nano, press
Ctrl+Oto write the file, thenCtrl+Xto exit. If using gedit, just close the window and click "Save". - Restart the GDM service. To apply the change, you need to restart the display manager. Run:
This will log you out of your current session. Save any open work before running this command.sudo systemctl restart gdm3 - 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=trueunder the[daemon]section. A common mistake is writingenable=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
sudoprefix.
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=falsein 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
lightdmfor Xfce).
Troubleshooting
If the guest session does not appear after following the steps, try these in order:
- Check the configuration file: Re-open
/etc/gdm3/custom.confand verify the line is exactlyEnable=trueunder[daemon]. Look for any stray spaces or comments that might interfere. - Restart the system: Sometimes a full reboot is more reliable than restarting the GDM service. Run
sudo rebootand check again. - Check GDM status: Run
systemctl status gdm3to ensure the service is running without errors. If it shows errors, look for clues in the output. - 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. - 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.