Unable to Stop virtualbox kernel modules

Discussions related to using VirtualBox on Linux hosts.
tigerjack89
Posts: 13
Joined: 13. Jan 2012, 10:52
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Windows xp, Arch Linux, CentOs

Unable to Stop virtualbox kernel modules

Post by tigerjack89 »

Hi all!
I tried to install VirtualBox 4.1.8 on Ubuntu 11.10 64 bit, but I have a lot of problems.

During installation, I have a black screen with a bunch of codes that I haven't be able to copy. I think it is the tty terminal. After that, the screen crashed and I was forced to reboot pc.

At the start, tty terminal opens again with a lot of codes and errors and I was able to login only pressing ctrl + f7 to return to graphical interface.

When I first opened virtualbox and created a virtual machine and tried to start it, I had this error
Kernel driver not installed (rc=-1908)The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing'/etc/init.d/vboxdrv setup'as root. If it is available in your distribution, you should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.
I tried to execute

Code: Select all

sudo /etc/init.d/vboxdrv setup
but I had the same black screen again.

I think the error is in Virtualbox kernel modules.

Indeed, I finally decide to remove virtualbox, but I can't do that!!
When I type

Code: Select all

sudo apt-get remove --purge virtualbox-4.1
it crashes on:
Stopping virtualbox kernel modueles.

I also tried to delete the vdboxusers group, but I have no result.

I don't know what to do, especially because system is very unstable: I can't shutdown it normally, many programs don't open or don't respond, many web pages crashes, also virtualbox doesn't open.

Any toughts?
tigerjack89
Posts: 13
Joined: 13. Jan 2012, 10:52
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Windows xp, Arch Linux, CentOs

Re: Unable to Stop virtualbox kernel modules

Post by tigerjack89 »

If I do an upgrade of whatever other software, the aptitude program tries to reinstall or repair virtualbox, but it crashes at this point

Code: Select all

addgroup: Il gruppo «vboxusers» già esiste come gruppo di sistema. Uscita. 
That in English is something like "addgroup: vboxusers group yet exists as system group. Exit."
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Unable to Stop virtualbox kernel modules

Post by Sasquatch »

Check the status with the dkms command, like this:

Code: Select all

dkms status
That will show you if the module is installed properly. If it is listed there and working fine, and you still get the error, then remove the module using the dkms remove option. Read the dkms man-page for more information on it's usage. Once you have removed the module, you should be able to restart and shut down the system normally again without things hanging.

What you are describing is that the configuring step of VB somehow failed and you got a broken installation. You can mark it for reinstall or use one of the following commands as root:

Code: Select all

aptitude reinstall virtualbox-4.1
OR
dpkg-reconfigure virtualbox-4.1
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
tigerjack89
Posts: 13
Joined: 13. Jan 2012, 10:52
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Windows xp, Arch Linux, CentOs

Re: Unable to Stop virtualbox kernel modules

Post by tigerjack89 »

Sasquatch wrote:Check the status with the dkms command, like this:

Code: Select all

dkms status
That will show you if the module is installed properly. If it is listed there and working fine, and you still get the error, then remove the module using the dkms remove option. Read the dkms man-page for more information on it's usage. Once you have removed the module, you should be able to restart and shut down the system normally again without things hanging.

What you are describing is that the configuring step of VB somehow failed and you got a broken installation. You can mark it for reinstall or use one of the following commands as root:

Code: Select all

aptitude reinstall virtualbox-4.1
OR
dpkg-reconfigure virtualbox-4.1
Thanks for your reply!!
I am totally inexpert of virtualbox and kernel modules, this was the first time I tried to install it.
Here the output of your command

Code: Select all

dkms status
vboxhost, 4.1.8: added
I don't know what it means and which module I have to stop and how :oops:
Can you help me?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Unable to Stop virtualbox kernel modules

Post by Sasquatch »

This means that the module is added to the DKMS tree, but it's not build, nor installed. So you're missing some packages or the dkms build procedure got aborted. VB will hang at trying to unload it's modules, because there are none.
To fix the bunch, we can ask dkms to build and install the modules. This is done with the following commands, but please bear in mind that the kernel version may differ and cause the commands to fail. You have to fix that yourself with the --help and manpage output. Either switch to the root user, or run every command with sudo.

Code: Select all

dkms build -m vboxhost -v 4.1.8 -k `uname -r`
dkms install -m vboxhost -v 4.1.8 -k `uname -r`
That should do it. Then you can run this command to start the modules:

Code: Select all

/etc/init.d/vboxdrv start
You may need to use 'restart' instead. You can also use the 'service' command, which would look like this:

Code: Select all

service vboxhost start
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
tigerjack89
Posts: 13
Joined: 13. Jan 2012, 10:52
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Windows xp, Arch Linux, CentOs

Re: Unable to Stop virtualbox kernel modules

Post by tigerjack89 »

Sasquatch wrote:This means that the module is added to the DKMS tree, but it's not build, nor installed. So you're missing some packages or the dkms build procedure got aborted. VB will hang at trying to unload it's modules, because there are none.
To fix the bunch, we can ask dkms to build and install the modules. This is done with the following commands, but please bear in mind that the kernel version may differ and cause the commands to fail. You have to fix that yourself with the --help and manpage output. Either switch to the root user, or run every command with sudo.

Code: Select all

dkms build -m vboxhost -v 4.1.8 -k `uname -r`
dkms install -m vboxhost -v 4.1.8 -k `uname -r`
That should do it. Then you can run this command to start the modules:

Code: Select all

/etc/init.d/vboxdrv start
You may need to use 'restart' instead. You can also use the 'service' command, which would look like this:

Code: Select all

service vboxhost start
I succesfully ran the first two command, but when I tried to restart vboxdrv service, it crashes, stopping at the first step

Code: Select all

 /etc/init.d/vboxdrv restart
 * Stopping VirtualBox kernel modules   
EDIT: here the status of the dkms status command

Code: Select all

dkms status
vboxhost, 4.1.8, 3.2.0-030200-generic, x86_64: installed (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!)
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Unable to Stop virtualbox kernel modules

Post by Sasquatch »

Oh, you run the kernel mainline version 3.2. That can be the problem. I suggest you boot into the distro shipped kernel instead. For Ubuntu 11.10, that's 3.0.0.14.16. VB hasn't been made compatible with the Ubuntu 3.2 kernel yet.

But, the error itself shows what the problem is. You can use the earlier used commands (with some modifications) to remove the module and set them up again with 'service 'vboxdrv setup'.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
tigerjack89
Posts: 13
Joined: 13. Jan 2012, 10:52
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Windows xp, Arch Linux, CentOs

Re: Unable to Stop virtualbox kernel modules

Post by tigerjack89 »

Sasquatch wrote:Oh, you run the kernel mainline version 3.2. That can be the problem. I suggest you boot into the distro shipped kernel instead. For Ubuntu 11.10, that's 3.0.0.14.16. VB hasn't been made compatible with the Ubuntu 3.2 kernel yet.

But, the error itself shows what the problem is. You can use the earlier used commands (with some modifications) to remove the module and set them up again with 'service 'vboxdrv setup'.
So, I have to run something like

Code: Select all

dkms remove -m vboxhost -v 4.1.8 -k 3.2.0-030200-generic
Insn't it?

EDIT: or

Code: Select all

dkms remove -m vboxhost -v 'uname -r'
That should be the same.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Unable to Stop virtualbox kernel modules

Post by Sasquatch »

You can also provide '-k all' as a remove option to remove it for every kernel, but that doesn't matter much as you have only one kernel with the modules.

All in all, it's worth a shot to rebuild the modules. When it hangs at stopping the modules, you can leave it and it will eventually continue. Only when you're more experienced with Linux may you take a look at the init script and attempt a manual build.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
tigerjack89
Posts: 13
Joined: 13. Jan 2012, 10:52
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Windows xp, Arch Linux, CentOs

Re: Unable to Stop virtualbox kernel modules

Post by tigerjack89 »

Sasquatch wrote:You can also provide '-k all' as a remove option to remove it for every kernel, but that doesn't matter much as you have only one kernel with the modules.

All in all, it's worth a shot to rebuild the modules. When it hangs at stopping the modules, you can leave it and it will eventually continue. Only when you're more experienced with Linux may you take a look at the init script and attempt a manual build.
I used the dkms remove option and it seems to worked fine. Then, I tried to reinstall or remove virtualbox package. The problem is that it hangs always at the same point

Code: Select all

 * Stopping VirtualBox kernel modules
and I can't stop it with ctrl +c or ctrl +z, but I have to search for all vbox and virtualbox instances in processes and manually kill them.

Code: Select all

ps aux | grep vbox
ps aux | grep virtualbox
How can I proceed??
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Unable to Stop virtualbox kernel modules

Post by Sasquatch »

Run the following two commands to remove the startup of the modules and do a forced shutdown. As root or with sudo of course.

Code: Select all

update-rc.d -f vboxdrv remove
shutdown -rf now
The first removes the startup of the VB modules, so it's status should never go to 'running' or something like that. The script to stop the modules should then, after the reboot (second command), exit right away because the modules were never started, thus not running.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
tigerjack89
Posts: 13
Joined: 13. Jan 2012, 10:52
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Windows xp, Arch Linux, CentOs

Re: Unable to Stop virtualbox kernel modules

Post by tigerjack89 »

Sasquatch wrote:Run the following two commands to remove the startup of the modules and do a forced shutdown. As root or with sudo of course.

Code: Select all

update-rc.d -f vboxdrv remove
shutdown -rf now
The first removes the startup of the VB modules, so it's status should never go to 'running' or something like that. The script to stop the modules should then, after the reboot (second command), exit right away because the modules were never started, thus not running.
Eureka!! I was finally able to remove virtualbox! I think that I will try it on Ubuntu 12.04, when the new kernel are fully supported.
Thanks a lot for your help!!! :)
Just one late question: when I shutdown the system with your code I have this messagges:

Code: Select all

ata1: softreset failed (device not ready)
ata2: softreset failed (device not ready)
SP5100 TCO timer: mmio address 0xfec000f0 already in use
* stopping save messagges [OK]
At this point it hangs; if I press ctrl +alt + canc I have another message

Code: Select all

* Stopping save system clock to hardware clock
And it hangs again!! I was forced to mechanically reboot the system. After the virtualbox uninstall and the system restart, I have the first three messagges again, but the system doesn't hangs.
Do you think it is due to something in virtualbox configuration?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Unable to Stop virtualbox kernel modules

Post by Sasquatch »

The softreset things are not caused by VB. They can be caused by bugs in the driver, buggy BIOS/firmware or defective hardware. Unless you have issues with anything, I wouldn't care much about it.

You know what the real cause was for the problem? I think it's the kernel you were running. Normally, 11.10 comes with 3.0 and VB is not made for 3.2 yet.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
tigerjack89
Posts: 13
Joined: 13. Jan 2012, 10:52
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Windows xp, Arch Linux, CentOs

Re: Unable to Stop virtualbox kernel modules

Post by tigerjack89 »

Sasquatch wrote:The softreset things are not caused by VB. They can be caused by bugs in the driver, buggy BIOS/firmware or defective hardware. Unless you have issues with anything, I wouldn't care much about it.

You know what the real cause was for the problem? I think it's the kernel you were running. Normally, 11.10 comes with 3.0 and VB is not made for 3.2 yet.
Yes, I think so. I have just to wait for the full VB compatibility with the new kernels; and I think I'll waiting anyway to try it on the upcoming 12.04 LTS release :)
Thanks a lot for your help! You were very helpful and I learned a lot on different stuffs in this little thread :)
WildWeasel
Posts: 3
Joined: 3. Sep 2016, 18:53

Re: Unable to Stop virtualbox kernel modules

Post by WildWeasel »

I may have a similar problem. My vbox 5.1 on Debian Jessie no longer works. Everything I've tried has been as root.
I have tried to reinstall and remove followed by install and other approaches. There's no visible sign that I can see that it's installed. With synaptic, and apt-get, I get a message that VirtualBox is running, even after a reboot. I've used "service VBoxSVC stop", I the response is that the service is not loaded.
I just tried "apt-get install virtualbox" and got the "running" message again. I closed the error window and apt ended by displaying:
/var/lib/dpkg/info/virtualbox-5.1.postinst: /usr/lib/virtualbox/postinst-common.sh: not found
Errors were encountered while processing:
virtualbox-5.1
E: Sub-process /usr/bin/dpkg returned an error code (1)

I short, every attempt I have made to restore vbox has been blocked by an already running vbox.

Can anyone help me get past this problem?

WildWeasel
Post Reply