Disabling build-in camera on Linux

I had my laptop for a while now. The built-in camera died meanwhile, or rather there was a circuit when tilting the screen causing the video calls to apps to crash. Not ideal, when working remotely. I have another USB camera, however, at times the system struggles to decide which one to use.

I couldn’t find the BIOS option on my XPS 13 to disable the camera. After a while of Googling, I found this neat solution https://karlcode.owtelse.com/blog/2017/01/09/disabling-usb-ports-on-linux/

In short:

1. Identify the USB device/port

for device in $(ls /sys/bus/usb/devices/*/product); do echo $device;cat $device;done

Note “/sys/bus/usb/devices/1-5/product
Integrated_Webcam_HD” next to “Integrated_Webcam_HD”.

2. Unbind the port

echo '1-5' | sudo tee /sys/bus/usb/drivers/usb/unbind

3. Set up cron, to disable the camera when system starts

sudo crontab -e
@reboot echo '1-5' | sudo tee /sys/bus/usb/drivers/usb/unbind

Reboot the system.