Record Your Screen on Linux
Record your Linux screen using GNOME's built-in recorder, Kooha, or OBS Studio — with Wayland portal setup and hardware encoding explained.
Before you start
- ▸A working desktop session (GNOME, KDE, or other) on X11 or Wayland
- ▸Flatpak configured with the Flathub remote (for Kooha and the OBS Flatpak)
- ▸For hardware encoding: correct GPU drivers and libva installed
Screen recording on Linux has improved dramatically. Whether you need a quick capture of a bug, a tutorial walkthrough, or a full production stream, there is a tool that fits — and most work well on both X11 and Wayland. This guide covers the three most practical options: GNOME's built-in recorder for quick captures, Kooha for a lightweight GUI, and OBS Studio for serious work. It also explains Wayland portals and hardware encoding so you can get the best quality and performance.
Understand the Wayland Situation First
On Wayland, applications cannot capture the screen freely the way they could on X11. Instead, screen capture goes through the XDG Desktop Portal, which presents a permission dialog asking which window or monitor to share. This is a security feature, not a bug. Most modern recording tools support it, but older or poorly maintained tools may fail silently or require you to fall back to X11.
Before recording, confirm your session type:
echo $XDG_SESSION_TYPE
Output will be wayland or x11. If you are on Wayland and a tool misbehaves, the troubleshooting section at the end covers common fixes.
Option 1: GNOME Built-In Screen Recorder
GNOME 41 and later ships a screen recorder with no installation required. It records the full screen to a WebM file saved in ~/Videos/Screencasts/.
Start and Stop a Recording
Press Ctrl + Alt + Shift + R to start recording. A red dot appears in the top-right of the panel. Press the same shortcut again to stop. That's it.
Adjust the Maximum Duration
The default limit is 30 seconds. Raise it with:
gsettings set org.gnome.settings-daemon.plugins.media-keys max-screencast-length 300
Set it to 0 for no limit. The GNOME recorder is Wayland-native and always works in a GNOME session. It does not record audio.
Option 2: Kooha — Lightweight GUI Recorder
Kooha is a GTK4 screen recorder built specifically for GNOME and Wayland. It supports WebM, MKV, and MP4 output, optional microphone audio, and a countdown timer. It is a Flatpak-first application.
Install Kooha
On any distro with Flatpak enabled (the recommended route):
flatpak install flathub io.github.seadve.Kooha
On Arch, it is also in the AUR:
yay -S kooha
Record with Kooha
Launch Kooha from your app menu. Click the gear icon to choose output format and whether to capture audio. Click Record — the XDG portal dialog appears asking you to select a monitor or window. Choose your target and click Share. A countdown starts, then recording begins. Click the stop button in the panel or the Kooha window to finish. Files are saved to ~/Videos by default.
Kooha respects the portal permission model fully, which makes it reliable on GNOME, KDE Plasma, and other Wayland compositors that implement the portal spec.
Option 3: OBS Studio — Full-Featured Recording and Streaming
OBS Studio is the standard choice for anything beyond simple captures: multi-source compositing, audio mixing, streaming to Twitch or YouTube, and hardware encoding. It supports both X11 and Wayland.
Install OBS Studio
Debian / Ubuntu:
sudo apt install obs-studio
Fedora / RHEL (requires RPM Fusion free repository):
sudo dnf install obs-studio
Arch:
sudo pacman -S obs-studio
The Flatpak version includes the most up-to-date Wayland portal support and is often newer than distro packages:
flatpak install flathub com.obsproject.Studio
Configure a Screen Capture Source on Wayland
- Open OBS and go to Sources → + → Screen Capture (PipeWire). This is the Wayland portal path.
- Click OK. A portal dialog appears — select your monitor or window and click Share.
- The capture appears in the OBS preview. Resize and position it in your scene as needed.
On X11 you can also use Screen Capture (XSHM) or Window Capture (Xcomposite), which do not require portal permission dialogs.
Set Output Format and Path
Go to Settings → Output. Set Output Mode to Advanced for full control. Under the Recording tab, set:
- Type: Standard
- Recording Path: your preferred directory
- Recording Format: MKV (switch to MP4 in remux after the fact — MKV is safer against corruption if OBS crashes)
- Encoder: See the hardware encoding section below
Enable Hardware Encoding
Software encoding (x264) works everywhere but is CPU-heavy. If your GPU supports it, hardware encoding is faster and uses far less CPU.
| GPU | Encoder name in OBS |
|---|---|
| NVIDIA (NVENC) | NVIDIA NVENC H.264 / AV1 |
| AMD (VAAPI) | AMD HW H.264 (VAAPI) |
| Intel (QSV / VAAPI) | Intel QSV H.264 / VAAPI H.264 |
VAAPI encoders require the correct Mesa or vendor driver stack. On Debian/Ubuntu, install the VAAPI driver for your hardware:
# Intel
sudo apt install intel-media-va-driver
# AMD (open-source)
sudo apt install mesa-va-drivers
On Fedora these drivers are usually installed automatically with the Mesa stack. Verify VAAPI is working:
vainfo
You should see a list of supported profiles. If the command is not found, install libva-utils (Debian/Ubuntu) or libva-utils (Fedora/Arch).
Start and Stop Recording
Click Start Recording in the OBS controls panel. Click Stop Recording when done. The file is written to the path you configured. To remux MKV to MP4 without re-encoding:
ffmpeg -i recording.mkv -c copy recording.mp4
Verify Your Recording
After any recording method, confirm the file is valid and not corrupt:
ffprobe -v error -show_streams -of default=noprint_wrappers=1 ~/Videos/recording.mkv
Look for codec_name, width, height, and duration in the output. If ffprobe exits with an error or shows no streams, the file is damaged.
Troubleshooting
Black Screen in OBS on Wayland
If the Screen Capture (PipeWire) source shows a black preview, ensure xdg-desktop-portal and the correct backend are running. On GNOME you need xdg-desktop-portal-gnome; on KDE, xdg-desktop-portal-kde. Restart the portal service:
systemctl --user restart xdg-desktop-portal
Also confirm PipeWire is active:
systemctl --user status pipewire pipewire-pulse
No Audio in Recording
In OBS, check Settings → Audio. Set Desktop Audio to your PipeWire/PulseAudio sink monitor. On PipeWire systems the device is usually named pipewire or listed as a monitor source. In the OBS audio mixer, make sure the channel is not muted and the level meters are moving during playback.
VAAPI Encoder Not Listed in OBS
The Flatpak version of OBS needs the org.freedesktop.Platform.VAAPI.Intel or equivalent extension installed:
flatpak install flathub org.freedesktop.Platform.VAAPI.Intel
For AMD/Mesa hardware with the Flatpak build, ensure mesa-va-drivers is installed on the host and that the Flatpak runtime has access to /dev/dri.
Kooha Records Wrong Monitor
The portal dialog lists all connected outputs. If you accidentally shared the wrong one, stop the recording, click Record again, and the portal dialog will reappear. Kooha does not cache your selection between sessions.
Frequently asked questions
- Why does OBS show a black screen on Wayland?
- The XDG desktop portal or its compositor-specific backend is not running or crashed. Restart it with 'systemctl --user restart xdg-desktop-portal' and confirm PipeWire is active.
- Can I record a single window instead of the whole screen?
- Yes. In Kooha and OBS the portal dialog lets you choose a specific window. In GNOME's built-in recorder only full-screen capture is supported.
- Which output format should I choose — MKV, MP4, or WebM?
- Use MKV while recording in OBS because it survives crashes without corruption; remux to MP4 with ffmpeg afterwards for compatibility. WebM is fine for web sharing but less universally playable offline.
- Does hardware encoding (VAAPI/NVENC) lower recording quality?
- At the same bitrate, hardware encoders can be slightly less efficient than a slow x264 software encode, but the difference is rarely visible at typical screen-recording bitrates (6–15 Mbps). The CPU savings are significant.
- Do these tools work on KDE Plasma with Wayland?
- Yes. Kooha and OBS both use the XDG portal, which KDE Plasma implements via xdg-desktop-portal-kde. Ensure that package is installed and the service is running.
Related guides
Linux Clipboards Explained (+ Clipboard Managers)
Learn the difference between Linux's PRIMARY and CLIPBOARD selections, use xclip, xsel, and wl-clipboard from the terminal, and manage history with GPaste or Klipper.
Configure LibreOffice for Daily Use
Configure LibreOffice for daily use: set default save formats for MS Office interop, tune autosave, install fonts, and add productivity extensions.
Configure the Touchpad and Multitouch Gestures
Configure Linux touchpad behavior and multitouch gestures using libinput, libinput-gestures, and native GNOME and KDE Plasma settings on both Wayland and X11.
Wayland vs X11: How to Choose and Configure Each
Know when to run Wayland or X11, how to check your current session, switch at login with GDM/SDDM/LightDM, and handle NVIDIA and XWayland edge cases.