Skip to content

modprobe: ERROR: could not insert 'v4l2loopback': Operation not permitted #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kuzdogan opened this issue Apr 16, 2020 · 6 comments
Closed

Comments

@kuzdogan
Copy link

OS Version

Ubuntu 19.10

When I'm trying to run bash run.sh I see following errors:

Creating virtual camera /dev/video9 (sudo privelege required)
modprobe: ERROR: could not insert 'v4l2loopback': Operation not permitted
0: ./avatars/einstein.jpg
... #similar lines
7: ./avatars/schwarzenegger.png
load checkpoints..
cam_fomm.py:34: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  config = yaml.load(f)
--- Make sure the v4l2loopback kernel module is loaded ---
sudo modprobe v4l2loopback devices=1
Traceback (most recent call last):
  File "cam_fomm.py", line 230, in <module>
    stream = pyfakewebcam.FakeWebcam(f'/dev/video{opt.virt_cam}', frame.shape[1], frame.shape[0])
  File "/root/miniconda3/envs/avatarify/lib/python3.8/site-packages/pyfakewebcam/pyfakewebcam.py", line 31, in __init__
    raise FileNotFoundError('device does not exist: {}'.format(video_device))
FileNotFoundError: device does not exist: /dev/video9

I am not familiar with conda environments so maybe it could be the problem. On terminal I see it's running the base environment:

(base) kuzdogan@kuzdogan-UX331UN

Another thing to notice is I can only run bash run.sh as a root user so after sudo -i. If I run sudo bash run.sh I get

run.sh: line 9: conda: command not found
run.sh: line 9: /etc/profile.d/conda.sh: No such file or directory
run.sh: line 10: conda: command not found

Thank you

@alievk
Copy link
Owner

alievk commented Apr 17, 2020

Normally you don't have to run run.sh as sudo, it will ask you sudo pass for loading v4l2loopback kernel module. Does this happen?

@potassium-chloride
Copy link

potassium-chloride commented Apr 17, 2020

I have the same problem in Cinnamon 19.3 (kernel: 5.3.0-46-generic). I catched #37 and tried to solve it. install.sh cloned and made v4l2loopback driver successfully but module was not signed.

I tried sudo echo x > /proc/sysrq-trigger but it has no effect and dmesg said:

[236654.822141] Lockdown: modprobe: Loading of unsigned module is restricted; see man kernel_lockdown.7
[237401.229309] sysrq: HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z) 
[239238.910641] sysrq: HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)

I don't want to recompile my kernel

@kuzdogan
Copy link
Author

@alievk yes I am getting exactly the same error

@SSantiagoDev
Copy link

same issue here

@alievk
Copy link
Owner

alievk commented Apr 19, 2020

@potassium-chloride
Copy link

@alievk this method equivalents sudo echo x > /proc/sysrq-trigger and causes same effect (help line in dmesg). This problem is related to security boot and security police in last versions of Linux Kernel. Module should be signed. I think the true way would be to ask the v4l2loopback developers about this and publish signed v4l2loopback module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants