Mailing List Archive

virtualbox /proc/modules warning
Hi!

Each time any of VirtualBox commands started it print this useless warning:

---cut---
libkmod: kmod_module_new_from_loaded: could not open /proc/modules: Permission denied
Error: could not get list of modules: Permission denied
WARNING: The VirtualBox kernel modules are not loaded.
Please load all the needed kernel modules by:

for m in vbox{drv,netadp,netflt}; do modprobe $m; done

You will not be able to start VMs until this problem is fixed.
---cut---

Of course, modules are loaded, but non-root users can't access
/proc/modules because of GrSecurity. So, VirtualBox works fine, but this
multiline warning really annoying. Is it possible to somehow switch it off?

--
WBR, Alex.
Re: virtualbox /proc/modules warning [ In reply to ]
В Чт, 12/09/2013 в 17:45 +0300, Alex Efros пишет:
> Each time any of VirtualBox commands started it print this useless warning:
>
> ---cut---
> libkmod: kmod_module_new_from_loaded: could not open /proc/modules: Permission denied
> Error: could not get list of modules: Permission denied
> WARNING: The VirtualBox kernel modules are not loaded.
> Please load all the needed kernel modules by:
>
> for m in vbox{drv,netadp,netflt}; do modprobe $m; done
>
> You will not be able to start VMs until this problem is fixed.
> ---cut---
>
> Of course, modules are loaded, but non-root users can't access
> /proc/modules because of GrSecurity. So, VirtualBox works fine, but this
> multiline warning really annoying. Is it possible to somehow switch it off?

There are other use-cases where this warning is useless, like running
virtualbox inside openvz container :) /usr/bin/VirtualBox binary is a
shell script that you can easy modify to avoid this warning. That said I
don't think it's worth to have such patch in portage tree - just apply
it locally.

--
Peter.
Re: virtualbox /proc/modules warning [ In reply to ]
Hi!

On Sat, Sep 14, 2013 at 12:16:20AM +0400, Peter Volkov wrote:
> There are other use-cases where this warning is useless, like running
> virtualbox inside openvz container :) /usr/bin/VirtualBox binary is a
> shell script that you can easy modify to avoid this warning. That said I
> don't think it's worth to have such patch in portage tree - just apply
> it locally.

Why is that? How such patch may harm anything?

--- /opt/VirtualBox/VBox.sh.old 2013-09-14 00:45:13.873137602 +0300
+++ /opt/VirtualBox/VBox.sh 2013-09-14 00:45:17.553137565 +0300
@@ -32,7 +32,7 @@

if [ "$1" = "shutdown" ]; then
SHUTDOWN="true"
-elif ! lsmod|grep -q vboxdrv; then
+elif [ -r /proc/modules ] && ! lsmod|grep -q vboxdrv; then
cat << EOF
WARNING: The VirtualBox kernel modules are not loaded.
Please load all the needed kernel modules by:


--
WBR, Alex.
Re: virtualbox /proc/modules warning [ In reply to ]
В Сб, 14/09/2013 в 00:46 +0300, Alex Efros пишет:
> On Sat, Sep 14, 2013 at 12:16:20AM +0400, Peter Volkov wrote:
> > That said I don't think it's worth to have such patch in portage
> > tree - just apply it locally.
>
> Why is that? How such patch may harm anything?
>
> --- /opt/VirtualBox/VBox.sh.old 2013-09-14 00:45:13.873137602 +0300
> +++ /opt/VirtualBox/VBox.sh 2013-09-14 00:45:17.553137565 +0300
> @@ -32,7 +32,7 @@
...
> -elif ! lsmod|grep -q vboxdrv; then
> +elif [ -r /proc/modules ] && ! lsmod|grep -q vboxdrv; then

If /proc/modules is unreadable we don't know if modules are loaded or
not. In such case it's better to show warning. That said, problem with
this check is that it should check for functionality virtualbox requires
(with /dev/vboxdrv) but such change should go upstream.

--
Peter.