Skip to content

Instantly share code, notes, and snippets.

@danielrosehill
Created November 24, 2025 13:50
Show Gist options
  • Select an option

  • Save danielrosehill/8f2960a206b5b71686457790f290cc27 to your computer and use it in GitHub Desktop.

Select an option

Save danielrosehill/8f2960a206b5b71686457790f290cc27 to your computer and use it in GitHub Desktop.
Disable USB sandboxing globally for all flatpak applications on Linux

Disable Flatpak USB Sandboxing Globally (Linux)

Problem

Flatpak applications are sandboxed by default and cannot access USB devices, which causes issues with:

  • Hardware controllers (Stream Decks, MIDI devices, game controllers)
  • USB peripherals (webcams, microphones, printers)
  • Development hardware (Arduino, ESP32, etc.)
  • Any USB device that needs direct access

This manifests as devices showing as "not connected" in flatpak apps even though they're detected by the system.

Solution

Grant USB device access globally to all flatpak applications:

flatpak override --user --device=all

This single command applies to:

  • All currently installed flatpak applications
  • All future flatpak installations
  • Persists across reboots

Verification

Verify the global override is in place:

flatpak override --user --show

Expected output:

[Context]
devices=all;

When to Use This

This approach is ideal if:

  • You frequently use USB peripherals with flatpak apps
  • You find USB sandboxing more annoying than helpful
  • This is a personal workstation (not a shared/public system)
  • You trust the flatpak applications you install

Reverting the Change

If you want to restore the default sandboxing behavior:

flatpak override --user --reset

This removes all global overrides and returns to default flatpak sandboxing.

Per-Application Alternative

If you prefer to grant USB access only to specific applications:

flatpak override --user --device=all com.example.AppName

Replace com.example.AppName with the actual flatpak application ID.

To find application IDs:

flatpak list --app --columns=application

Security Considerations

Pros:

  • Eliminates USB device detection issues
  • More convenient for hardware peripherals
  • No need to troubleshoot device access per-app

Cons:

  • Reduces sandboxing isolation
  • All flatpak apps can access USB devices
  • Slightly increased security surface area

For personal workstations where you control what gets installed, this tradeoff is usually acceptable.

System Information

  • Tested on: Ubuntu 25.04 with KDE Plasma
  • Flatpak version: Any modern version
  • Persistence: Yes, survives reboots
  • Scope: User-level override (doesn't require sudo)

Related Issues

This fix resolves USB device detection problems for:

  • StreamController (Elgato Stream Deck)
  • OBS Studio (webcams, capture cards)
  • Audacity (USB audio interfaces)
  • Arduino IDE (development boards)
  • Any other flatpak app requiring USB access

This gist was generated by Claude Code. Please validate the information for your specific system configuration.

Comments are disabled for this gist.