zed-industries/zed · error

Failed to create desktop capturer. Check that xdg-desktop-po

Error message

Failed to create desktop capturer. Check that xdg-desktop-portal is installed and running.

What it means

Startup failure in start_wayland_desktop_capture: the WebRTC desktop capturer object could not be created on Linux/Wayland, almost always because xdg-desktop-portal (with the screencast backend) is missing or not running, so screen sharing cannot begin at all.

Source

Thrown at crates/livekit_client/src/livekit_client/linux.rs:87

    fn webrtc_log_callback(message: String, severity: webrtc_ffi::LoggingSeverity) {
        match severity {
            webrtc_ffi::LoggingSeverity::Error => log::error!("[webrtc] {}", message.trim()),
            _ => log::debug!("[webrtc] {}", message.trim()),
        }
    }

    let _webrtc_log_sink = webrtc_ffi::new_log_sink(webrtc_log_callback);
    log::debug!("Wayland desktop capture: WebRTC internal logging enabled");

    let stop_flag = Arc::new(AtomicBool::new(false));
    let (mut video_source_tx, mut video_source_rx) = mpsc::channel::<NativeVideoSource>(1);
    let (failure_tx, failure_rx) = oneshot::channel::<()>();

    let mut options = DesktopCapturerOptions::new(DesktopCaptureSourceType::Generic);
    options.set_include_cursor(true);
    let mut capturer = DesktopCapturer::new(options).ok_or_else(|| {
        anyhow::anyhow!(
            "Failed to create desktop capturer. \
             Check that xdg-desktop-portal is installed and running."
        )
    })?;

    let permanent_error = Arc::new(AtomicBool::new(false));
    let stop_cb = stop_flag.clone();
    let permanent_error_cb = permanent_error.clone();
    capturer.start_capture(None, {
        let mut video_source: Option<NativeVideoSource> = None;
        let mut current_width: u32 = 0;
        let mut current_height: u32 = 0;
        let mut video_frame = VideoFrame {
            rotation: VideoRotation::VideoRotation0,
            buffer: NV12Buffer::new(1, 1),
            timestamp_us: 0,
        };

View on GitHub (pinned to f4178619ac)

Solutions

  1. Install xdg-desktop-portal and the portal backend matching your compositor (e.g. xdg-desktop-portal-gnome/-kde/-wlroots)
  2. Ensure the portal and PipeWire services are running (systemctl --user status xdg-desktop-portal pipewire)
  3. Fall back to an X11/XWayland session if Wayland capture cannot be set up
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/livekit_client/src/livekit_client/linux.rs:87 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/3184f81e43d9e7ea. Report an issue: GitHub.