Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Sep 2021 15:30:56 -0300
From:      Mario Lobo <lobo@bsd.com.br>
To:        freebsd-virtualization@freebsd.org
Subject:   Re: Running VirtualBox as non-root user
Message-ID:  <CA%2ByoEx-7r1vgf_whFZP_t4Kan8nV-0_K=LMxh=ei7g9B_w8xzA@mail.gmail.com>
In-Reply-To: <20210929181744.GA69504@FreeBSD.org>
References:  <CA%2ByoEx9iL_%2BjHH1tmmt9qAQRYTxq1uO_hscx0VKZ9%2BEL=f0DOQ@mail.gmail.com> <20210929181744.GA69504@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000a1073205cd268863
Content-Type: text/plain; charset="UTF-8"

On Wed, Sep 29, 2021 at 3:17 PM Glen Barber <gjb@freebsd.org> wrote:

> On Wed, Sep 29, 2021 at 03:00:43PM -0300, Mario Lobo wrote:
> > Hi;
> >
> > Here is what I've done so far:
> >
> > - Created user vbox and put it in vboxuser group
> > - Went as far as chown -R vbox:vboxuser /usr/local/lib/virtualbox
> > - Executables are with the SUiD bit set
> > -r-s--x---  1 vbox  vboxusers     32064 Sep 21 22:18 VBoxSDL
> > -r-s--x---  1 vbox  vboxusers     16064 Sep 21 22:18 VBoxNetAdpCtl
> > -r-s--x---  1 vbox  vboxusers     32064 Sep 21 22:18 VBoxNetDHCP
> > -r-s--x---  1 vbox  vboxusers     32064 Sep 21 22:18 VBoxNetNAT
> > -r-s--s---  1 vbox  vboxusers     32352 Sep 22 17:55 VirtualBoxVM
> >
> > - Imported a test VM
> > - Ran the VM as root to make sure it's working
> > - started VirtualBox as user vbox, and it starts fine
> >
> > VirtualBox GUI starts fine as user vbox but when I try to start the test
> VM
> > from it, I get:
> >
> > Effective UID is not root (euid=1001 egid=920 uid=1001 gid=1001) (rc=-10)
> > where: SUPR3HardenedMain what: 2 VERR_PERMISSION_DENIED (-10) -
> Permission
> > denied.
> >
> > Starting it from  VirtualBoxVM --startvm test issues the same error:
> >
> > VirtualBoxVM: Error -10 in SUPR3HardenedMain!
> > VirtualBoxVM: Effective UID is not root (euid=1001 egid=920 uid=1001
> > gid=1001)
> > where: SUPR3HardenedMain
> > what:  2
> > VERR_PERMISSION_DENIED (-10) - Permission denied.
> >
> > Any pointer for anything else I should be doing or is missing?
> >
>
> Add your user to the vboxusers group in /etc/group.
>
> Glen
>
>
Found the problem!

>  Went as far as chown -R vbox:vboxuser /usr/local/lib/virtualbox

I did that because I was blindly following a blog to get phpvirtualbox
working.

What should actually be done is:

chown -R root:vboxusers /usr/local/lib/virtualbox

After doing that, it worked as expected.

Sorry for the noise!

-- 
Mario Lobo
http://www.mallavoodoo.com.br
FreeBSD since version 2.2.8 [not Pro-Audio.... YET!!]

--000000000000a1073205cd268863--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2ByoEx-7r1vgf_whFZP_t4Kan8nV-0_K=LMxh=ei7g9B_w8xzA>