Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 594978 - app-emulation/virtualbox-bin causes kernel panic on suspend
Summary: app-emulation/virtualbox-bin causes kernel panic on suspend
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: masterzorag
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-24 02:02 UTC by OzTiram
Modified: 2016-10-02 14:22 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description OzTiram 2016-09-24 02:02:44 UTC
I am using Virtaulbox-Bin app-emulation/virtualbox-bin-5.1.6.110634. 
Everytime I try to suspend the machine while Virtualbox is running, I get a kernel panic (my kernel versions is  3.18.25-gentoo. 

I have spend a few hours trying to find a work around. For example:

 $ cat /etc/pm/config.d/gentoo 
HOOK_BLACKLIST="01grub 90clock"
SUSPEND_MODULES="vboxdrv vboxnetflt vboxnetadp vboxpci"

Which does not work. 

Or trying to shutdown all the machines before remove the kernel module (removing the kernel modules while a machines is running, causes a kernel panic):

$ cat /etc/pm/sleep.d/03stop_running_vms 
#!/bin/bash
#
# 90virtualbox: scan for active virtual machines and pause them on host suspend
case $1 in
    hibernate|suspend)
        LOG=/var/log/suspend.log
	;;
    *)  
        LOG=/var/log/resume.log
        ;;
esac

exec > $LOG
exec 2>&1

date; echo $1

PATH=$PATH:/opt/bin

VBOXMANAGE=`which VBoxManage`
SUSPEND_MODULES="vboxpci vboxnetflt vboxnetadp vboxdrv"

function stop_machines(){
	for user in `users`; do
		su $user $VBOXMANAGE list runningvms | while read line; do 
		su $user $VBOXMANAGE controlvm "$(expr match "$line" '"\(.*\)"')" pause;
		done
	done
}



case $1 in
    hibernate)
	    stop_machines
	    sleep 5
	    pkill VBox
	    sleep 5
    ;;
    suspend)
	    stop_machines
	    sleep 5
	    pkill VBox
	    sleep 5
    ;;
    thaw)
    ;;
    resume)
    ;;
    *)  echo "Somebody is calling me totally wrong."
    ;;
esac


When running the above script per hand, and then suspending the machine, I don't get a kernel panic.

I can't find a reasonable work around, so I suspect this a re-incarnation of https://www.virtualbox.org/ticket/9305.

I would appreciate it if someone would help fix this issue.
Comment 1 Marek Szuba (RETIRED) archtester gentoo-dev 2016-09-26 08:48:30 UTC
Just to be sure, could you run modinfo on all the virtualbox module and confirm their version is the same as that of the userspace part?
Comment 2 OzTiram 2016-09-26 09:00:01 UTC
Just to add some more info, I have another gentoo installation with VirtualBox (kernel version 4.4.6-gentoo) which shares the same binary packages.
The only thing that differs between the machines is the kernel versions and the and the Wireless Chip (the one with 4.4.6 kernel has an Intel Chip  Wireless 3160, the other one has Intel N1000), so maybe it's something related to that?
Comment 3 OzTiram 2016-09-27 04:25:34 UTC
I was wrong about the Intel Chip. One the machine where I experience            
Kernel Panics, I have the following Wireless Chip:

*-network
                description: Wireless interface
                product: Wireless 7260
                vendor: Intel Corporation
                physical id: 0
                bus info: pci@0000:02:00.0
                logical name: wlp2s0
                version: 73
                serial: fc:f8:ae:61:19:53
                width: 64 bits
                clock: 33MHz
                capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
                configuration: broadcast=yes driver=iwlwifi driverversion=3.18.25-gentoo-r1-09-07-2016 firmware=23.15.10.0 ip=192.168.2.102 latency=0 link=yes multicast=yes wireless=IEEE 802.11bgn
                resources: irq:46 memory:b2400000-b2401fff
Comment 4 OzTiram 2016-09-27 04:25:58 UTC
(In reply to Marek Szuba from comment #1)
> Just to be sure, could you run modinfo on all the virtualbox module and
> confirm their version is the same as that of the userspace part?

$ for mod in `lsmod |grep vbox| cut -d " " -f 1` ; do
> sudo modinfo $mod
> done
filename:       /lib/modules/3.18.25-gentoo-r1-09-07-2016/misc/vboxpci.ko
version:        5.1.6 r110634
license:        GPL
description:    Oracle VM VirtualBox PCI access Driver
author:         Oracle Corporation
srcversion:     180E04A13887316064A89E0
depends:        vboxdrv
vermagic:       3.18.25-gentoo-r1-09-07-2016 SMP mod_unload modversions 
filename:       /lib/modules/3.18.25-gentoo-r1-09-07-2016/misc/vboxnetflt.ko
version:        5.1.6 r110634 ((0xA2CDe001U))
license:        GPL
description:    Oracle VM VirtualBox Network Filter Driver
author:         Oracle Corporation
srcversion:     D686CF2E1879C70DBB1488B
depends:        vboxdrv
vermagic:       3.18.25-gentoo-r1-09-07-2016 SMP mod_unload modversions 
filename:       /lib/modules/3.18.25-gentoo-r1-09-07-2016/misc/vboxnetadp.ko
version:        5.1.6 r110634 ((0xA2CDe001U))
license:        GPL
description:    Oracle VM VirtualBox Network Adapter Driver
author:         Oracle Corporation
srcversion:     29B5552C5D92B8323EE00BD
depends:        vboxdrv
vermagic:       3.18.25-gentoo-r1-09-07-2016 SMP mod_unload modversions 
filename:       /lib/modules/3.18.25-gentoo-r1-09-07-2016/misc/vboxdrv.ko
version:        5.1.6 r110634 (0x00260000)
license:        GPL
description:    Oracle VM VirtualBox Support Driver
author:         Oracle Corporation
srcversion:     5CBEE2EE66F9E1A181A04B6
depends:        
vermagic:       3.18.25-gentoo-r1-09-07-2016 SMP mod_unload modversions 
parm:           force_async_tsc:force the asynchronous TSC mode (int)
[31] oznt@yeni2:~/Software/oz123.github.com/media/uploads  [master]  $ equery u virtualbox
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for app-emulation/virtualbox-5.1.6:
 U I
 + + alsa                     : Add support for media-libs/alsa-lib (Advanced Linux Sound Architecture)
 - - debug                    : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see
                                https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
 - - doc                      : Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
 - - headless                 : Build without any graphic frontend
 - - java                     : Add support for Java
 - - libressl                 : Use dev-libs/libressl as SSL provider (might need ssl USE flag), packages should not depend on this USE flag
 - - lvm                      : Build VBoxVolInfo that needs devicemapper from sys-fs/lvm2.
 + + opengl                   : Add support for OpenGL (3D graphics)
 + + pam                      : Add support for PAM (Pluggable Authentication Modules) - DANGEROUS to arbitrarily flip
 + + pulseaudio               : Add support for PulseAudio sound server
 - - python                   : Add optional support/bindings for the Python language
 + + python_targets_python2_7 : Build with Python 2.7
 + + qt5                      : Add support for the Qt 5 application and UI framework
 + + sdk                      : Enable building of SDK
 + + udev                     : Controls installation of special USB udev rules.
 - - vboxwebsrv               : Build and install the VirtualBox webservice
 - - vnc                      : Enable VNC (remote desktop viewer) support
Comment 5 OzTiram 2016-10-01 20:02:43 UTC
So, I finally got to upgrade the kernel on the machine where I experienced the kernel panics:

I am now using kernel version 4.4.6-gentoo with VirtualBox 5.1.6.110634, and I do not experience any kernel panic when suspending the computer.

I guess the bug can be closed, maybe the developers of VirualBox did not mean it to be used on such old kernel (3.18.25-gentoo)?
Comment 6 masterzorag 2016-10-01 20:34:53 UTC
was looking at upstream documentation, check 2.3.2
https://www.virtualbox.org/manual/ch02.html#install-linux-host
and quoting:
"and making sure that all system updates are installed and that the system is running the most up-to-date kernel included in the distribution. The version numbers of the header file packages must be the same as that of the kernel you are using."

yes, my advice would be update HOST kernel

also, your
$ equery u virtualbox
it's unrelated, since you are... "using Virtaulbox-Bin app-emulation/virtualbox-bin-5.1.6.110634."

for me can be closed
Comment 7 masterzorag 2016-10-02 14:22:35 UTC
so, not a bug.
closing now