VirtualBox used to work, now it fails with permission denied

I am trying to use VirtualBox which worked just a week ago (I haven’t changed anything with it) but now it fails. When I try to start it (from the command line) with /usr/bin/VirtualBox, as a regular user, it fails with:

/usr/bin/VirtualBox: line 72: /usr/lib/virtualbox/VirtualBox: Permission denied
/usr/bin/VirtualBox: line 72: exec: /usr/lib/virtualbox/VirtualBox: cannot execute: Permission denied

When I try to start it with “sudo” it fails with:

Failed to open the X11 display!

I checked the permissions and it tells me:

-rwsr-x--- 1 root vboxusers 22192 2009-11-17 03:15 /usr/lib/virtualbox/VirtualBox

My “regular user” (which I am logged in as) is a member of vboxusers (I just double checked to be sure)

Any idea what’s going on here?

I was able to get it to work but only with two changes:

  1. chmod +x
  2. recompile for the kernel with “/etc/init.d/vboxdrv setup”

I know why I had to do step #2, but why step 1? I never touched Virtual Box and certainly never changed the permissions and it worked the last time I used it. Why/how would the permissions on it change?

chmod +x “nothing” does not do anything. You need to be a member of vboxusers, as you see they can already execute Virtualbox: -rwsr–x
The second part is what’s done it: you probably updated your kernel. Vbox kernel module then needs rebuilding against the new kernel, that’s what you did with the second action.

Um, I think you misunderstood me. I didn’t do chmod +x without a file name, I did:

sudo chmod +x /usr/lib/virtualbox/VirtualBox

THAT enabled VirtualBox to run, which then gave the kernel error. I know why the kernel one occurred, my point was that it couldn’t even get to that because of the permission issue, but there was no permission issue a week ago - the last time I ran it! Why did the permissions change? (Or the permission req’s?)

The second step is NOT what enabled it to run. I could not even GET to that error (telling me I needed to “/etc/init.d/vboxdrv setup”) until I did the chmod.

Maybe are not really in the group vboxusers? Because these are the permissions on my VirtualBox binary and as you can see, no world execute permission is needed and it works fine for me.

-rwsr-x— 1 root vboxusers 23096 2009-12-18 02:41 /usr/lib/virtualbox/VirtualBox

All you need for VirtualBox to work :

  • recompile the kernel module after eack kernel update with : /etc/init.d/vboxdrv setup

  • be member of the vboxusers group

  • if several members of this group (including root) access your virtual machines, regularly restore the permissions with:
    find /srv/vbox -type d -exec chmod 775 “{}” “;” -exec chown “root:vboxusers” “{}” “;” ; find /srv/vbox -type f -exec chmod 664 “{}” “;” -exec chown “root:vboxusers” “{}” “;”’
    where /srv/vbox in this example is the directory where vbox virtual machines are stored.

This just happened to me too. I was running VirtualBox, shut down my vm to modify network settings. I tried to start the vm again and got a permission denied error trying to start a process. I closed VirtualBox and tried to restart it but got a permission denied error.

Here are the permissions on VirtualBox:

-rwsr-x--- 1 root vboxusers  23K 2010-03-25 17:04 VirtualBox

Here are my groups:

daniel : users video vboxusers

I just needed to get back to work so I added the all execute bit and everything was fine.

Group membership didn’t seem to work at this time.