Canonical Snapcraft
Menu Close menu
  • Snap Store
  • About Snapcraft
  • Learn
    • Blog
    • Build
    • Docs
    • Tutorials
  • IoT
  • Forum
  • My account
    • My published snaps
    • My validation sets
    • My stores
    • Account details
    • Sign out
  • Sign in
Toggle side navigation
Toggle side navigation

Snap documentation

Use snaps

  • Snap tutorials
    • Get started
    • Install the daemon
      • AlmaLinux OS
      • Arch Linux
      • Debian
      • Elementary OS
      • Fedora
      • Linux Mint
      • Manjaro Linux
      • Raspberry Pi OS
      • openSUSE
      • Pop!_OS
      • Rocky Linux
      • Ubuntu
  • Snap how-to guides
    • Work with snaps
      • Manage updates
      • Connect interfaces
      • Configure snaps
      • Apps and aliases
    • Manage snaps
      • Create data snapshots
      • Use resource quotas
      • Disk space awareness
      • Set system options
      • Control services
      • Using components
      • Configure snaps with confdb
      • Manage validation sets
      • Snap deltas
      • Use the REST API
      • Use snapctl
    • Fix common issues
      • Test snapd fixes
      • Debug snaps
  • Snap reference
    • Operations
      • Glossary
      • System options
      • System architecture
      • Interfaces
        • Hardware interfaces
        • Media interfaces
        • Network interfaces
        • Security interfaces
        • System interfaces
        • Super-privileged interfaces
    • Administration
      • Network requirements
      • Distribution support
    • Development
      • Supported snap hooks
      • Environment variables
      • REST API
        • snapd REST API
        • Error responses
      • YAML schemas
        • The snap format
        • The gadget snap
        • The kernel snap
    • Release notes
  • Snap explanation
    • How snaps work
      • Refresh awareness
      • Channels and tracks
      • Revisions
      • Transactional updates
      • Validation sets
      • Confdb configuration mechanism
      • Snap components
      • Snap performance
    • Interfaces
      • All about interfaces
      • Interface auto-connection
      • Interface hooks
    • Security
      • Security policies
      • Snap confinement
      • Classic confinement
      • Assertions
      • Snapd release process

Build snaps

Contribute to our docs

The hardware-observe interface

On this page

  • Developer details
    • Path access
    • Binary access
    • Capability access
    • Socket access

The hardware-observe interface allows for getting hardware information from the system.

hardware-observe grants read-only access to many files and directories, primarily in /sys and /proc. Additionally, it provides access to many utility files and binaries such as lspci, lsusb, and hwinfo.

hardware-observe is a more general and broad interface. If more specific hardware access is required, such as for GPIO or I2C devices, See the gpio and i2c interfaces.

Interface documentation:

See Interface management and Supported interfaces for further details on how interfaces are used.


Developer details

Auto-connect: no

Path access

hardware-observe grants read access to the following paths:

  • For tools like hwinfo --short to get hardware information:
    /proc/ioports
    /proc/dma
    /proc/tty/driver/{,*}
    /proc/sys/dev/cdrom/info

  • For tools like lshw -quiet to get hardware information:
    /proc/devices
    /proc/ide/{,**}
    /proc/scsi/{,**}
    /proc/device-tree/{,**}
    /sys/kernel/debug/usb/devices
    /proc/sys/abi/{,*}

  • For tools like lspci -A linux-sysfs to get information on files in /sys:
    /sys/{block,bus,class,devices,firmware}/{,**}

  • For tools like lspci -A linux-proc to get information on /proc:
    /bus/pci/{,**} /{,usr/}lib/modprobe.d/{,*}

  • For tools like lspci -k to get information on loaded modules:
    Examples: /etc/modprobe.d/{,*},

  • For tools like lsusb to get USB information:
    /var/lib/usbutils/usb.ids
    /dev/
    /dev/bus/usb/{,**/}
    /etc/udev/udev.conf
    Note: lsusb and its database have to be shipped in the snap if not on classic

  • For tools like sensors to get sensor information:
    /etc/sensors3.conf
    /etc/sensors.d/{,*}

  • For tools like udevadm to get device information:
    /run/udev/data/**

  • For hugepage and transparent_hugepage statuses (but not the pages themselves):
    /sys/kernel/mm/{hugepages,transparent_hugepage}/{,**}

  • For information on available input devices:
    /proc/bus/input/devices

  • For power information:
    /sys/power/{,**}
    /run/udev/data/+power_supply:*

  • For interrupts:
    /proc/interrupts

  • For loaded kernel module information:
    /proc/modules

  • For VM information:
    /proc/cpuinfo
    /proc/sysinfo
    /proc/xen/capabilities
    /proc/1/sched
    /sys/hypervisor/properties/features
    /sys/hypervisor/type

  • For container information:
    /run/systemd/container

Binary access

hardware-observe grants executable access to the following binaries:

  • For tools provided by util-linux:
    /{,usr/}bin/lsblk
    /{,usr/}bin/lscpu
    /{,usr/}bin/lsmem

  • For tools like lsusb:
    /{,usr/}bin/lsusb

  • For tools like systemd-detect-virt:
    /{,usr/}bin/systemd-detect-virt

Capability access

hardware-observe grants the following capabilities:

  • For tools like lscpu and lspci -A to inspect specific PCI access methods:
    capability sys_rawio
    capability sys_admin

Socket access

hardware-observe grants the following socket access:

  • For udevadm to read netlink:
    network netlink raw

The test code for the interface is in the snapd repository: https://github.com/canonical/snapd/blob/master/interfaces/builtin/hardware_observe_test.go

The source code for the interface is in the snapd repository: https://github.com/canonical/snapd/blob/master/interfaces/builtin/hardware_observe.go


Last updated 9 months ago.

Help improve this document in the forum.

Back to top

© 2025 Canonical Ltd.

Ubuntu and Canonical are registered trademarks of Canonical Ltd.
Powered by Charmed Kubernetes

Join the forum, contribute to or report problems with, snapd, Snapcraft, or this site.

  • Terms of Service
  • Data privacy
  • Manage your tracker settings
  • Service status
  • Other functions
  • Share on Twitter
  • Share on Facebook
  • Share on YouTube