Fixing gphoto2: Could not claim the USB device

Fixing gphoto2: Could Not Claim the USB Device

If you’re using gphoto2 on a Raspberry Pi to control a DSLR and you see this error:

Could not claim interface 0 (Device or resource busy)

…and you don’t have physical access to the Pi or the camera, here’s the quickest SSH-safe fix.

This is extremely common. The cause is almost always GVFS auto-grabbing the camera over USB.


The Problem (Briefly)

On Raspberry Pi OS, GVFS treats cameras like removable storage.

Two processes are involved:

  • gvfs-gphoto2-volume-monitor — detects cameras

  • gvfsd-gphoto2actually opens and locks the USB device

Most guides only deal with the first one.
The second one is what breaks gphoto2 --capture-image.

That’s why:

  • gphoto2 --auto-detect works

  • gphoto2 --capture-image fails

  • Rebooting doesn’t help

  • You can’t unplug the camera


The Fix (One Command)

From SSH, just run:

pkill -9 gphoto2

That’s it.

This immediately kills gvfsd-gphoto2, releases the USB interface, and allows gphoto2 to claim the camera.

Now run:

gphoto2 --capture-image

It should work right away.


Why This Works

  • gvfsd-gphoto2 is spawned under the gphoto2 process name

  • Killing it releases /dev/bus/usb/*

  • No reboot required

  • No physical access required

  • Safe to do remotely


TL;DR

If gphoto2 says the USB device is busy:

pkill -9 gphoto2 

Then retry your capture. 

Comments