From nobody Wed Sep 29 18:00:43 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 AAD3917D6ABA for ; Wed, 29 Sep 2021 18:00:57 +0000 (UTC) (envelope-from lobo@bsd.com.br) Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) (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 4HKPLc1f1wz4cNQ for ; Wed, 29 Sep 2021 18:00:56 +0000 (UTC) (envelope-from lobo@bsd.com.br) Received: by mail-io1-xd2b.google.com with SMTP id q205so4218416iod.8 for ; Wed, 29 Sep 2021 11:00:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsd.com.br; s=capeta; h=mime-version:from:date:message-id:subject:to; bh=R6WvxNQXZ+BlN5ely8y/dcTn966YlTXu89YhE++KbPI=; b=AXySAUIkigfr2P5w7B/Y+dnszsv34HgVZFhXSitPfFjKJDwvEiJR1ReynrJWzoKEII vOEdshOQBd46mcIUsBlsPWso8+yZfWCVHEPKZMU/BcyNUkYVCBV/fYnnxaWB+MzEZcom Lw0KZqZ3ZRIMBX7PPgAv7vTQbJXi7KTVuegpM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=R6WvxNQXZ+BlN5ely8y/dcTn966YlTXu89YhE++KbPI=; b=rQq2Z93DvZffwV5re+cTZsmIeMFsLofSwnGf18tuSRlAvSfzE4UF9zjGimhJgEgYaw sP5oTqWZGQTJzfcuQfYuJXGKy0fa6eqpcC+oMM4ZEPcElzgQZQkhFD17RjaoDuKKRsIk x1KWrAgU/ZrplEkJHdgD9QCWvhy0CNR/t3fjIRta/O37DSw0GDsef3Nrk4alaa5zfm+7 TbOFqb8Nd8xwwyP0DXBNE4eusepgk5Z5ItFKpP77pk/MDk1MITOonGt7z9Jf4CIWbKa8 yzRykOCYj9OrRm1w/vaqVfTBZRsZFx+GQm99FYDPkgv3a4PUAGHexjRL7Z/uaKkhFxxg yCVw== X-Gm-Message-State: AOAM531S5jvcuB36yUnqoXjvZAtqnZNUxBAmNkZeSY7FqEDdhnLGaE99 3rxM9alVeqjTBKS00v3JEm2gKhXJ8oCTAmNe1is0Et5xO/ujIQ== X-Google-Smtp-Source: ABdhPJx+tJY4i6nGn4MU84xps3nc5nX+qifb4RDuPZfubB/AVBNM8JdthSlLpekfJhbwClb7nv5HSwZGTMrT1inouVs= X-Received: by 2002:a5e:c00e:: with SMTP id u14mr790235iol.13.1632938455427; Wed, 29 Sep 2021 11:00:55 -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 From: Mario Lobo Date: Wed, 29 Sep 2021 15:00:43 -0300 Message-ID: Subject: Running VirtualBox as non-root user To: "freebsd-questions@freebsd.org" , freebsd-virtualization@freebsd.org Content-Type: multipart/alternative; boundary="00000000000093880f05cd261cb0" X-Rspamd-Queue-Id: 4HKPLc1f1wz4cNQ X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsd.com.br header.s=capeta header.b=AXySAUIk; dmarc=none; spf=pass (mx1.freebsd.org: domain of lobo@bsd.com.br designates 2607:f8b0:4864:20::d2b as permitted sender) smtp.mailfrom=lobo@bsd.com.br X-Spamd-Result: default: False [-3.49 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsd.com.br:s=capeta]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-virtualization@freebsd.org]; DMARC_NA(0.00)[bsd.com.br]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsd.com.br:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::d2b:from]; NEURAL_HAM_SHORT(-0.99)[-0.988]; 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 --00000000000093880f05cd261cb0 Content-Type: text/plain; charset="UTF-8" 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? Thanks, -- Mario Lobo http://www.mallavoodoo.com.br FreeBSD since version 2.2.8 [not Pro-Audio.... YET!!] --00000000000093880f05cd261cb0--