From nobody Wed Sep 29 18:30:56 2021 X-Original-To: freebsd-virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EABB117D9F6C for ; Wed, 29 Sep 2021 18:31:15 +0000 (UTC) (envelope-from lobo@bsd.com.br) Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKQ1Z6kRzz4gmh for ; Wed, 29 Sep 2021 18:31:14 +0000 (UTC) (envelope-from lobo@bsd.com.br) Received: by mail-il1-x131.google.com with SMTP id r9so3917960ile.5 for ; Wed, 29 Sep 2021 11:31:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsd.com.br; s=capeta; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=C8aeWWaRo7QuUl9nqN0UOPcuT0cehUMtsSFDgVaTvMg=; b=AnNEy68lOBluZ4dKjRRBGWq+/K0EpvaVAYSNxrI6rcxVcaxwhJ841VizyDtKeNyjaj cZm+1zNFhUk1ZtNV7Sgknc8lfn4uGmuyxwB2RUT90I/dy+6nRlW0I8gZsihNv0O/zTLc KQ9gZoSGONbMJRKlEye5glNxUq79D0Oeencto= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=C8aeWWaRo7QuUl9nqN0UOPcuT0cehUMtsSFDgVaTvMg=; b=3PHsN+RR8NrtnHqPHGn2MA+Crlfml1+7ZYFc7yC0GbJ4T2uHBtj3wdsSa3/VwrR7K2 0iPzhYRdOB6gDU9v08JCiGT3zFDCT4nr8ojfrq1/9p6fufFYFRPMXpyE/syiKEON295q 5B7evErDxfE7pldju2FpiDDWYv4Ho4gzNZYSqVPcMr/uKkbbjTSsCg4XhMSZVJexzFQU oLd1PmwcMA0th7nqrL3/xhz2Us0scBgXL0vOGLqh4rhtccycyha8mv6pZzlUl/Ar2Eba y8xunS5gQhAeXE8gG0/ng/WlAeP8QyyhQ0K9z+HXEKoSDaCQ9Gd1Vadk2reHL+ezbnph KJ8Q== X-Gm-Message-State: AOAM531Ha9IRQkAF4X7vMTDLPTDTwcD/w9hJkwGeJiwA2otdi9nBkLgW 9s4QKUiuqgsnfMlzkZMD364UomORvhWVlLYlBbfXDTfkXKvr4Q== X-Google-Smtp-Source: ABdhPJwHLFxo/jsyqAwcLjH7GFGvtCzQtNQbREON9giS3zntliCbXaVv8eBoViZms1hquSZk3u/mn+USEJYL8LDWYZc= X-Received: by 2002:a92:c264:: with SMTP id h4mr908759ild.16.1632940268253; Wed, 29 Sep 2021 11:31:08 -0700 (PDT) List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org MIME-Version: 1.0 References: <20210929181744.GA69504@FreeBSD.org> In-Reply-To: <20210929181744.GA69504@FreeBSD.org> From: Mario Lobo Date: Wed, 29 Sep 2021 15:30:56 -0300 Message-ID: Subject: Re: Running VirtualBox as non-root user To: freebsd-virtualization@freebsd.org Content-Type: multipart/alternative; boundary="000000000000a1073205cd268863" X-Rspamd-Queue-Id: 4HKQ1Z6kRzz4gmh X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsd.com.br header.s=capeta header.b=AnNEy68l; dmarc=none; spf=pass (mx1.freebsd.org: domain of lobo@bsd.com.br designates 2607:f8b0:4864:20::131 as permitted sender) smtp.mailfrom=lobo@bsd.com.br X-Spamd-Result: default: False [-3.40 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[bsd.com.br:s=capeta]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-virtualization@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; DMARC_NA(0.00)[bsd.com.br]; DKIM_TRACE(0.00)[bsd.com.br:+]; NEURAL_HAM_SHORT(-0.90)[-0.900]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::131:from]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N --000000000000a1073205cd268863 Content-Type: text/plain; charset="UTF-8" On Wed, Sep 29, 2021 at 3:17 PM Glen Barber 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--