I am looking for a way to disable the webcam that is integrated into my laptop. The webcam is using uvcvideo module but I do not want to blacklist it since it is also being used by an external webcam I have.

Is there any way of disabling the device itself without touching the modules list?

This is how the webcams are listed by lsusb. The first one is an integrated one (It is identified by some apps as BisonCam NB Pro), the second one is the external Logitech C525:

Bus 002 Device 004: ID 5986:0361 Acer, Inc 
Bus 003 Device 002: ID 046d:0826 Logitech, Inc. 

I have already checked BIOS - there is no way of disabling the webcam from there. Besides I would love to learn how to disable the device by ID anyway.


  • Crossposted this on LinuxQuestions. What I eventually did was to hack the uvc_driver.c kernel module by forcing an error when this particular device is found. This is not really a solution but a dirty workaround, but it works for me. I described it here: linuxquestions – AtomHeartFather Oct 18 '12 at 20:24

It's quite simple. The hard work is working out what the path to the USB device is. We need to start by finding which device we want to disable. We can do this with lsusb:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0402:5602 ALi Corp. M5602 Video Camera Controller
Bus 001 Device 003: ID 045e:0723 Microsoft Corp. LifeCam VX-7000 (UVC-compliant)

Change 1-6 to your device ports to be disabled. The port often isn't logical (it's physical) but you can get a port mapping with lsusb -t. Once you think you have it, you can test it with:

cat /sys/bus/usb/devices/1-6/id{Vendor,Product} 

This gives me 0402 and 5602, vendor and product IDs for the right device (as listed in lsusb).

Now we've found it, turning it off is simple:

echo "0" > /sys/bus/usb/devices/1-6/bConfigurationValue

After making sure it works as desired, make it load every startup (for example, in /etc/rc.local.)

| improve this answer | |
  • 1
    Brilliant, clean solution. Thank you very much for sharing that! – AtomHeartFather Dec 1 '12 at 19:50
  • 1
    This technique no longer appears to work in 14.10. No file "bConfigurationValue" exists, and if one attempts to write one either as user or root, permission is denied. – lysdexia Apr 2 '15 at 16:02
  • I didn't understand what 'change 1-6 to your device port' means. I couldn't find a dir named 1-6 – surajck Apr 21 '15 at 13:15
  • In Ubuntu 14.04, even if I do echo "0" > /sys/bus/usb/devices/1-6/bConfigurationValue with sudo, this does not work. The value does not stay there, the file contains nothing. The webcam still works. – soham Aug 31 '17 at 19:35
  • Okay, it works after I add echo "0" > /sys/bus/usb/devices/1-6/bConfigurationValue line to /etc/rc.local. – soham Aug 31 '17 at 19:42

@surjack: 1-6 depends on your port mapping. If you type lsusb -t you will get it and then compare it with the output of lsusb. For me i get the following outputs:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 5986:0525 Acer, Inc 
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 012: ID 413c:2107 Dell Computer Corp. 


lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
    |__ Port 1: Dev 2, If 0, Class=Video, Driver=uvcvideo, 5000M
    |__ Port 1: Dev 2, If 1, Class=Video, Driver=uvcvideo, 5000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M
    |__ Port 3: Dev 9, If 0, Class=Vendor Specific Class, Driver=hdm_usb, 480M
    |__ Port 4: Dev 10, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 3: Dev 11, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 4: Dev 12, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
        |__ Port 3: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
        |__ Port 3: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M

Now just find the right Bus which is 04 in my case because the Acer, Inc is the camera. The port mapping shows the camera is located at Bus 04.Port 1. This means instead of using 1-6 I have to use 4-1. I am not a Linux/Ubuntu expert but this gives me the impression that you have to use Bus-Port and simply use the numbers. If you want to be 100% sure use the cat command as described:

cat /sys/bus/usb/devices/<Bus>-<Port>/id{Vendor,Product} 

and compare it with lsusb.

In my case:

cat /sys/bus/usb/devices/4-1/id{Vendor,Product}

which is identically to the lsusb output: 5986:0525.

Now you found your internal webcam.

But unfortunately lysdexia is right and the echo command does not work because Permission denied.

Is there another solution available?

| improve this answer | |
  • 3
    sudo -i and later echo "0" > .... – sygi Mar 27 '17 at 23:46
  • Or sudo echo "0" > sudo /sys/bus/usb/devices/... – soham Aug 31 '17 at 19:25

If you want to enable only the external one when it's attached, but have the internal one enabled if the external one isn't attached, here's a script for that. It's based on Wildneuro's answer, but can figure out the device path for you given the ID.

I use it because some apps I depend on don't seem to offer a way to easily pick your preferred camera. You can easily customize with your own camera IDs (from lsusb).

Code here: https://gist.github.com/shimon/12cd1080fb8669549aadc2b5408922bc

| improve this answer | |
  • Since the content of links can change, please add the relevant content of the linked page here. – Chai T. Rex Jan 25 '18 at 23:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.