LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-30-2008, 08:13 PM   #1
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Question VirtualBox GUI will not start for non-root user


I am completely new to VirtualBox and have built VirtualBox 2.0.6 from a SlackBuild script on a clean Slackware 12.1 install. I built and installed acpica, dev86, virtualbox-ose (with addons ISO) and virtualbox-kernel.

No compile errors.

I created the vboxusers group and added my user to it and logged out/in - group shows in output of groups command.

I made rc.vboxdrv and rc.vboxnet executable and started them both.

When I attemtpt to start the GUI as normal user with /usr/bin/VirtualBox3 I get:

Callee RC: NS_ERROR_FACTORY_NOT_REGISTERED

And it fails to run.

If I do the same as root user it starts OK.

I have re-re-read the VB documentation and Slackbuild notes but feel I must be missing something simple - path or permission maybe?

Any VirtualBox gurus with the quick answer?

Thanks in advance.
 
Old 12-01-2008, 01:35 AM   #2
quiss42
LQ Newbie
 
Registered: Nov 2003
Location: Windeck, Germany
Distribution: SuSE 11.0
Posts: 2

Rep: Reputation: 0
Try deleting /tmp/.vbox-*.
 
Old 12-01-2008, 01:41 AM   #3
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Check the permissions of /dev/vboxdrv. Chances are that it's root/root. A suggested way is to have the group id be vboxusers, and add vboxusers to the group list of anyone you want to give access to VirtualBox.

Added:

Sorry, it's late. I see that you've added vboxusers, but did you set the group id for /dev/vboxdrv to that?

Last edited by Quakeboy02; 12-01-2008 at 01:42 AM.
 
Old 12-01-2008, 01:46 AM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263

Original Poster
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Smile Problem solved...

The startup error message...

Callee RC:
NS_ERROR_FACTORY_NOT_REGISTERED (0x80040154)

...did not return any significant info on google, and I initially dismissed the error that appeared in the startup terminal window as a side-effect of the the other...

Wrong owner (0) of '/tmp/.vbox-slacker-ipc'.

...mostly because...

ls -al /tmp

...did not show any such file or directory, and ...and all other permissions including /drv/vboxdrv appeared to be correct according to the docs.

But it was operator error I suppose because after coming back to it after a break I found...

drwx------ 2 root root 4096 2008-11-30 17:26 /tmp/.vbox-slacker-ipc/

I simply removed this as root (OK according to TFM), then tried again - all works!

So, for others having trouble starting VirtualBox 2.0.6 - look for...

/tmp/.vbox-<username>-ipc/ owned by root - delete it and try again!

[EDIT]Thanks Quiss42 - we must have been typing at the same time! As I posted here, that was the problem![/EDIT]

Last edited by astrogeek; 12-01-2008 at 01:49 AM.
 
Old 12-01-2008, 08:53 AM   #5
cowyn
Member
 
Registered: Oct 2006
Location: Hangzhou, China
Distribution: Slackware
Posts: 49

Rep: Reputation: 15
So, you enabled hardening by default.
But the SlackBuild of vbox-ose from SBo should have set suid.
try: chmod 4511 <path-to-`VirtualBox'-in-vbox-lib-dir>
 
Old 12-01-2008, 01:40 PM   #6
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263

Original Poster
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by Cherife View Post
So, you enabled hardening by default.
But the SlackBuild of vbox-ose from SBo should have set suid.
try: chmod 4511 <path-to-`VirtualBox'-in-vbox-lib-dir>
Yes I enabled hardening by default. As I said, I am completely new to VirtualBox and it is my understanding that hardening basically means that access permissions to the vboxdrv is restricted - seemed like a good idea to me. It looks to me like the SBo script only passes the --enable-hardening parameter to the VirtualBox configure script but does not make any changes of it's own, unless the udev rules do it... is that correct?

I have not found any explanation of why my 'executable' is VirtualBox3 instead of VirtualBox - is that related to hardening also? Oh well, I am learning...

In any event - I am happily virtualizing now!

Thanks!
 
Old 12-02-2008, 03:39 AM   #7
ppr:kut
Slackware Contributor
 
Registered: Aug 2006
Location: Netherlands
Distribution: Slackware
Posts: 631

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
Quote:
Yes I enabled hardening by default. As I said, I am completely new to VirtualBox and it is my understanding that hardening basically means that access permissions to the vboxdrv is restricted - seemed like a good idea to me. It looks to me like the SBo script only passes the --enable-hardening parameter to the VirtualBox configure script but does not make any changes of it's own, unless the udev rules do it... is that correct?
Hardening means that access to VirtualBox, in all ways, is restricted to users of the vboxusers group. Not only the kernel module, but also all (frontend) apps. Therefore the script does not only pass "--enable-hardening" to configure, but also forces the use of the vboxusers group and installs the affected binaries suid root (affected apps check for UID 0 on startup). With hardening disabled but vboxusers enabled, binaries are not installed suid root and can be run by any user in the vboxusers group.

Honestly, although I understand the vboxusers-configuration (and think it's a good idea), I still don't get what the benefit in security should be by forcing the VirtualBox binaries to run as root. But upstream requested it as default, so....

Quote:
I have not found any explanation of why my 'executable' is VirtualBox3 instead of VirtualBox - is that related to hardening also? Oh well, I am learning...
It's called "VirtualBox3" because it's using the Qt3 GUI. If you have enabled the Qt4 GUI as well/instead you'll have a "VirtualBox" binary (which is the upstream default by now). Qt3 GUI is the default in the SlackBuild for two reasons. First, Slackware 12.1 does not ship Qt4, so users would need to install it as well to run the GUI. Not necessary if the user doesn't want to and an alternative is available. Second, as the Qt4 GUI was presented as default with VirtualBox 2.0.0 is was way more unstable than the Qt3 GUI, so there wasn't much sense in setting it as default. However, in the meantime both GUIs are equally stable and one should preferably use the Qt4 GUI by now as the Qt3 one might be removed from upstream anytime.

Hope this clears things up a bit

Last edited by ppr:kut; 12-02-2008 at 03:44 AM.
 
Old 12-02-2008, 12:59 PM   #8
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263

Original Poster
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by ppr:kut View Post
Hope this clears things up a bit
Thanks ppr:kut - that is the only direct explanation of those items that I have found anywhere! I appreciate you taking the time to write it for me!
 
Old 12-03-2008, 03:57 PM   #9
jsmith6
Member
 
Registered: Feb 2006
Distribution: Slackware 13.1 / 13.37
Posts: 91

Rep: Reputation: 16
Hi ppr:kut!

I am trying to compile VirtualBox with your SlackBuild using this syntax:

Code:
HARDENING=no VBOXUSERS=yes ./virtualbox-ose.SlackBuild
But I still can't run it as a normal user, nor I can cd /usr/lib/virtualbox. The root suid is there, and the "world" flags don't allow read or execute.

For now, I just hacked it off with:

Code:
chmod -s /usr/lib/virtualbox/
chmod -s /usr/lib/virtualbox/* -R
chmod 755 /usr/lib/virtualbox
chmod 755 /usr/lib/virtualbox/* -R
but I would like to know how I can build this package the right way.
 
Old 12-03-2008, 04:10 PM   #10
ppr:kut
Slackware Contributor
 
Registered: Aug 2006
Location: Netherlands
Distribution: Slackware
Posts: 631

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
Actually you don't need to explicitly define VBOXUSERS, as it's set to "yes" by default.

Quote:
But I still can't run it as a normal user, nor I can cd /usr/lib/virtualbox. The root suid is there, and the "world" flags don't allow read or execute.
That doesn't make sense, as the relevant code in the script is *only* executed when hardening is enabled. I suspect the generated package being right as you want, but maybe something on install is not working as expected. Anyway, it's rather late here, I'll have a look at it tomorrow.
 
Old 12-03-2008, 05:35 PM   #11
jsmith6
Member
 
Registered: Feb 2006
Distribution: Slackware 13.1 / 13.37
Posts: 91

Rep: Reputation: 16
Let me add one more thing.

When I try to run a VM that I previously created with Vbox 1.6.x I get this message:

Quote:
VirtualBox kernel driver is not accessible, permission problem. If you have built VirtualBox yourself, make sure that you do not have the vboxdrv kernel module from a different build or installation loaded. Also, make sure the vboxdrv udev rule gives you the permission you need to access the device..

VBox status code: -1909 (VERR_VM_DRIVER_NOT_ACCESSIBLE).
I think this appeared after I tried to change the permitions of /dev/vboxdrv but it keeps popping after re-installing and re-starting.

VBox runs fine as root.

I think hack didn't actually work :P

Last edited by jsmith6; 12-03-2008 at 10:02 PM.
 
Old 12-04-2008, 02:50 PM   #12
ppr:kut
Slackware Contributor
 
Registered: Aug 2006
Location: Netherlands
Distribution: Slackware
Posts: 631

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
Alright, after taking a closer look at the script again, and also on your two posts I think you missunderstood some things. I try to explain the options again in detail:

Code:
HARDENING=yes VBOXUSERS=yes
- UPSTREAM / SLACKBUILD DEFAULT
- binaries installed suid root: yes
- user must be part of group vboxusers: yes
- VirtualBox runnable for users not in vboxusers: no

Code:
HARDENING=no VBOXUSERS=yes
- binaries installed suid root: no
- user must be part of group vboxusers: yes
- VirtualBox runnable for users not in vboxusers: no

Code:
HARDENING=no VBOXUSERS=no
- binaries installed suid root: no
- user must be part of group vboxusers: no
- VirtualBox runnable for users not in vboxusers: yes

As you now probably know, you seem to have configured virtualbox in another way then what you expected it to be. Your errors are all caused by the fact, that your user is not part of the vboxusers group. As you told the script to use the vboxusers group by passing "VBOXUSERS=yes" to the script, that would be the expected behavior and there is nothing wrong.
 
Old 12-05-2008, 07:56 AM   #13
jsmith6
Member
 
Registered: Feb 2006
Distribution: Slackware 13.1 / 13.37
Posts: 91

Rep: Reputation: 16
You are right! I compiled again with:

Code:
HARDENING=NO ./virtualbox-ose.SlackBuild
KERNEL=2.6.24.5-smp ./virtualbox-kernel.SlackBuild
And I can run it as a normal user but when I try to launch a VM I get this error:

Code:
VirtualBox kernel driver is not accessible, permission problem. If you have built VirtualBox yourself, make sure that you do not have the vboxdrv kernel module from a different build or installation loaded. Also, make sure the vboxdrv udev rule gives you the permission you need to access the device..
VBox status code: -1909 (VERR_VM_DRIVER_NOT_ACCESSIBLE).

Result Code: 
NS_ERROR_FAILURE (0x80004005)
Component: 
Console
Interface: 
IConsole {e3c6d4a1-a935-47ca-b16d-f9e9c496e53e}
Here is a screenshot of it.

I do not get this message as root, and I can boot my VMs just fine as root. I am sure I executed /etc/rc.d/rc.vboxdrv and rc.vboxnet.

Is it an issue of permitions on /dev/vboxdrv? Here is my permitions:

Code:
crw-rw---- 1 root vboxusers 10, 60 2008-12-04 15:54 /dev/vboxdrv
 
Old 12-05-2008, 08:04 AM   #14
ppr:kut
Slackware Contributor
 
Registered: Aug 2006
Location: Netherlands
Distribution: Slackware
Posts: 631

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
you are in vboxusers group?
 
Old 12-05-2008, 08:53 AM   #15
jsmith6
Member
 
Registered: Feb 2006
Distribution: Slackware 13.1 / 13.37
Posts: 91

Rep: Reputation: 16
Quote:
Originally Posted by ppr:kut View Post
you are in vboxusers group?
Yes, I added myself with vigr:

Code:
vboxusers:x:215:jsmith
Edit: I just re-compiled with

Code:
HARDENING=no VBOXUSERS=no ./virtualbox-ose.SlackBuild
but I still get the same error.

Last edited by jsmith6; 12-05-2008 at 09:04 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
One user login cannot start scim, other user logins and root OK allend Slackware 3 05-08-2008 07:25 PM
Start a program for a user as root, with process belonging to user gnashley Programming 4 03-19-2007 01:58 PM
Only root user can start a gui session landev Linux - Enterprise 6 02-12-2007 10:45 AM
no gui for normal/root user.. aaru_ali SUSE / openSUSE 0 10-24-2004 12:37 AM
Loggin into my GUI as root user MackH Mandriva 6 06-08-2004 11:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration