12

I am not new to linux and have had to face the occasional odd package or install situation but this tops all of them. At this point I just want to kill it with fire!

I have Virtualbox-5.1 in a somewhat messed up state. It seems something went wrong when i tried to upgrade to it a couple of months back and I never bothered to investigate. Ever since trying to install it I get error messages every time I upgrade packages. To be specific:

Running VMs found

VirtualBox is currently running. Please close it and try again. Please note that it can take up to ten seconds for VirtualBox (in particular the VBoxSVC daemon) to finish running.

Now I did the usual ps -aux | grep vbox and ps -aux | grep virtualbox and I can assure you, no vbox processes are running.

I also checked /tmp for any lock files which should be named '.vbox-username-ipc'. It is not there.

I have no idea how i got my system in this state but I would very much like to remove virtualbox without having to reinstall. Any input ?

| improve this question | | | | |
  • That message should be displayed only if a running VBoxSVC process was detected. Please check again and also take care of appropriate capitals. – Takkat Sep 21 '16 at 7:43
  • no matter the capitalization, no prozess containing "VB", "vb" or "virutalbox" is running. – Klaus Steinhauer Sep 22 '16 at 4:13
  • That's weird... the virtualbox code responsible for this message checks for pidof VBoxSVC. There is a single report of erroneous settings in /etc/vbox in virtualbox forums but I can't reproduce this. – Takkat Sep 22 '16 at 6:22
  • I hadn't found that thread before. But: the directory is empty. – Klaus Steinhauer Sep 23 '16 at 6:37
18

I had the same problem, but just a little bit differently. I tried to reinstall virtualbox (switching from distro to official release) and it failed to uninstall, so I could not remove or install the new copy. I managed to fix the issue by creating an empty file: /usr/lib/virtualbox/prerm-common.sh

Edit: Make the file executable with chmod +x /usr/lib/virtualbox/prerm-common.sh

Then running sudo apt-get remove virtualbox

| improve this answer | | | | |
  • 5
    brilliant! Thank you so much! after creating that file and chmod +x the removal finally worked! – Klaus Steinhauer Oct 12 '16 at 12:41
  • Glad it worked for you too! – TheBat Oct 12 '16 at 13:49
  • worked for me, thanks – Cattani Simone Aug 30 '19 at 7:48
  • That was the only thing that worked for me after a ton of hair pulling. Thanks! – wunderdojo Sep 19 '19 at 23:16
12

I had the same problem. I solved it by killing all the VB processes.

  • get all the processes containing VB

    ps -A | grep VB
    
  • then kill all processes with the command

    sudo kill <pid>
    

replace <pid> with the process IDs of the processes you got from above command.

  • then run

    sudo apt-get remove virtualbox-* --purge
    
| improve this answer | | | | |
  • 1
    That's the perfect answer. – DevonDahon Nov 24 '17 at 4:39
1

I tried everything suggested here and anywhere else but nothing worked. It kept saying that Running VMs found. What it turned out to be in the end was the fact, that there was autostart.cfg file in /etc/vbox.

After I removed/moved this file the installation went smoothly. Hard to believe that I spent such a long time trying to resolve this.

The answer was hidden in the post Upgrade and Uninstall Failing.

| improve this answer | | | | |
0

Run the following commands:

$ whereis vbox

copy all the folders in the output

$ sudo rm -rf (all the folders)

$ whereis virtualbox

copy all the folders in the output

$ sudo rm -rf (all folders)

$ sudo apt-get remove virtualbox-* --purge

This is how i removed it. Hope it helps.

| improve this answer | | | | |
0

You may have VirtualBox's auto-start service running. Check by running the command below.

sudo systemctl status vboxautostart-service

If it is running then stop it.

sudo systemctl stop vboxautostart-service

Then find and kill all the processes running with the commands below. (Should be about three (3))

ps -A | grep VB
sudo kill <pid>

Finally, remove and purge VirtualBox

sudo apt-get remove virtualbox-* --purge
| improve this answer | | | | |

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.