Skip to main content

How to Check If Your Hardware Works With Linux

Most computers run Linux without extra steps, but a few parts can cause trouble: Wi-Fi cards, fingerprint readers and new graphics cards are common examples. A live USB stick lets you test Linux without changing anything on your computer. After that, a few commands show which driver each device uses.

What it means

Every part of a computer needs a driver. A driver is a small program that tells the operating system how to use that part. On Windows, drivers usually come from the company that made the hardware. On Linux, most drivers are already part of the kernel, the core of the system, so most hardware works as soon as Linux is installed.

Trouble starts when a part is very new, or when its maker does not help Linux developers. The driver may then be missing. It may also lack some features.

You can find out before you install anything. Think of a live USB stick as a test drive. You start the computer from the stick and try everything. When you remove the stick, your computer is exactly as it was before.

So test the live system first, and check the screen, sound, Wi-Fi, webcam, touchpad and sleep mode. Parts that work there will almost certainly work after the install.

Back to top

How to use it

Start a live system and open a terminal. Then use the commands below.

This lists the devices inside your computer, together with the driver each one uses:

lspci -k

Look for the line Kernel driver in use. A device without that line has no working driver.

USB devices are listed separately. That includes webcams, Bluetooth adapters and many Wi-Fi sticks:

lsusb

Some devices load firmware when they start: a small program that runs on the device. This command looks for firmware problems:

sudo dmesg | grep -i -e firmware -e error

A message such as failed to load firmware means a firmware file is missing. Many distributions ship these files in a package called linux-firmware, while Debian calls it firmware-linux-nonfree. On Ubuntu, extra drivers are in Software & Updates > Additional Drivers.

For a short overview of all your hardware, run:

sudo lshw -short

Many users send reports to the Linux Hardware Database (linux-hardware.org). Search there for your laptop model or device, and you can see whether other people got it working.

Back to top

How it works

Each PCI and USB device reports two numbers, a vendor ID and a device ID. lspci -nn and lsusb show them in the form 8086:51f0. Every kernel driver carries a list of the IDs it supports. When the kernel finds a device, udev looks up the matching driver module and loads it.

These commands show the loaded modules and the details of one of them:

lsmod | head
modinfo iwlwifi

In the modinfo output, you find the firmware files the driver needs. You also find the aliases that hold the device IDs it supports.

A driver and firmware are not the same thing. The driver runs in the kernel. Firmware runs on the device itself, for example inside the Wi-Fi chip. Many devices need firmware files that are not open source, which is why some distributions ship them separately. The kernel loads firmware from /lib/firmware.

Some common pitfalls:

  • Very new hardware can need a newer kernel than your distribution offers. A newer release, or a distribution that ships newer kernels, often solves this.
  • NVIDIA graphics cards often run better with the NVIDIA driver than with the open nouveau driver. Most distributions make it easy to install.
  • Secure Boot can block drivers that are not signed, such as some drivers built with DKMS. To use them, you sign them or enroll a key.
  • Sleep and hibernation problems often come from firmware bugs in the laptop. They are the hardest to fix, so test them early.
Back to top

Sources

Back to top
The welovelinux penguin

The byline of welovelinux news articles. AI helps us write the first draft, and a human editor, Peter Martin, checks every article against its sources before it is published.

Frequently asked questions

Use a live USB stick. You start the computer from the stick, and Linux runs without changing your computer. Check the screen, the sound, the Wi-Fi, the webcam, the touchpad and the sleep mode. If they work in the live system, they will almost certainly work after you install it.

Most computers work without extra steps. Problems are more common with Wi-Fi cards, fingerprint readers and new graphics cards, and with parts whose maker does not help Linux developers. Very new hardware may also need a newer kernel than your distribution has.

Run lspci -k in a terminal and look at the line Kernel driver in use. If a device has no such line, it has no working driver. For USB devices, such as webcams, Bluetooth adapters and many Wi-Fi sticks, use lsusb.

It means that a firmware file is missing. Firmware is a small program that runs on the device itself, for example inside a Wi-Fi chip. Many distributions put these files in a package called linux-firmware. Debian calls it firmware-linux-nonfree.

The Linux Hardware Database at linux-hardware.org collects reports from many users. Search for your laptop model or device there to see whether others got it working.