From nobody Thu Feb 19 17:16:31 2026 X-Original-To: dev-commits-src-main@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 4fH0R40xpnz6S733 for ; Thu, 19 Feb 2026 17:16:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fH0R369Y8z3FMn for ; Thu, 19 Feb 2026 17:16:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771521391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GBgzOWNaiToqzlQQ3Xl0kQBVV9VG27OtWIGXRwULBTQ=; b=exzkUI1aNJLEf5ZEIR4+Zqksw2APYCtuK/NUBxABbFl8AoK/21iWUhbHrzBWMWycqnpLgk R5SqtOL7qCUjJd9VGZOEG3nEVUOn2q5fTeB28VPvxZhT/HeDWWhpMaLzKVZV/cTBBzxAuA 17bLbYq1azBfo/8cnQFCCjjOh7WyLs04GvZvaXg1KYcBB+24wK+O2U2Z6S7xCNj3p8CmVd RLrlnPmRyV9X+/X8q7ECuV37S3RhneRw3X0pBc+enr3iUcIwM54XrDqr5IfKtEC9+nmylB PzeA/K5ZppN5KqJHqh5p40Y6oVQ1BbpDY7Ft1X4kMocwVt7kbrhc357kp5k67g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1771521391; a=rsa-sha256; cv=none; b=yCu+WZzojGKGfDaRSk3cw/NKvVeoerl4Axlyk8U7HG2whFi/NifQcwBlpPMXMVj51u+402 uA1mca1+uFVqsxdxZRDiWMTeyRFEOTevwT9mvvrWP+webRgxtaygyQXMt1jNpzFN/Tkg0m +cjDSjmYvmcP0YxcnobXzP69JqkX5r/3ALn2Y9BcjLjh65qlX8ZGN1AbeVnlbVGgJwJoQM HiG0BALmzP5pjupMLFIk9VvYxXToGbSV+nThSl+q6JauLvrZDKhQsrfAIaP/XB/widWMF3 l9QvgpFxs8dalf6nb+BAH5Co+cny6MvdCZH9zYdd80RA2v3oImtUqWoRfKbsDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771521391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GBgzOWNaiToqzlQQ3Xl0kQBVV9VG27OtWIGXRwULBTQ=; b=DWXhgmOFkzYOtHzhfB248ykTRSMSO5n6cSH1Djzh0Mr8mjpbIFmlmg2z7KATmGnnl5yUZf Vv1fhlbzOtg9IRhVhN1JRNuBAI849QprRbYusH1TXFuX2N4A9qiMBBbxBIMYBoS3pim2ye DOlgJZBkWFZssc++MI+za1NV2+5zI1kRX2WEw3F/ENVsOe3oJxF5iLRz1loz+UHvdE2q/5 yNv7U+Ph/eoWpjKIoZSUWDqgYtidNTE9ZIZxJaCT16OanvSjbD77cmVonW970ymsizWYfu nY9HGiuxHjuA1Yj71+ChKxAJjfw6TNfg163AlN0egolPac9BH5uV1YouEkaOJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fH0R35PvHzrqw for ; Thu, 19 Feb 2026 17:16:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3931b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 19 Feb 2026 17:16:31 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d26c8ae527bb - main - vmm.4: Add information on VM access control List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d26c8ae527bbf2cc3da98c0857f634f162622752 Auto-Submitted: auto-generated Date: Thu, 19 Feb 2026 17:16:31 +0000 Message-Id: <6997456f.3931b.6742114e@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d26c8ae527bbf2cc3da98c0857f634f162622752 commit d26c8ae527bbf2cc3da98c0857f634f162622752 Author: Mark Johnston AuthorDate: 2026-02-19 14:38:59 +0000 Commit: Mark Johnston CommitDate: 2026-02-19 17:16:15 +0000 vmm.4: Add information on VM access control Add a section to vmm.4 explaining how vmm device file ownership works. MFC after: 2 months Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D54742 --- share/man/man4/vmm.4 | 39 +++++++++++++++++++++++++++++++++++++++ usr.sbin/bhyve/bhyve.8 | 25 ++++++++++++++++++++----- 2 files changed, 59 insertions(+), 5 deletions(-) diff --git a/share/man/man4/vmm.4 b/share/man/man4/vmm.4 index 07c40541f404..9c16bff8398a 100644 --- a/share/man/man4/vmm.4 +++ b/share/man/man4/vmm.4 @@ -59,6 +59,29 @@ riscv: The CPUs must implement the H (hypervisor) RISC-V ISA extension. .Pp PCI device passthrough to a virtual machine requires hardware with VT-d support and is available only on amd64. +.Sh ACCESS CONTROL +Only the super-user and processes with write access to the +.Pa /dev/vmmctl +device file may create and destroy virtual machines. +By default, members of the +.Va vmm +group have such access. +Once created, a virtual machine may be destroyed only by that user or +the super-user. +.Pp +Unprivileged users must use +.Dq monitor mode +to run the virtual machine; in this mode, the virtual machine is automatically +destroyed when its device file is closed. +When running +.Xr bhyve 8 , +this mode can be selected by specifying the +.Fl M +flag. +.Pp +Virtual machines can be created in a jail if the jail has the +.Va allow.vmm +flag set. .Sh PCI PASSTHROUGH On amd64 where the hardware supports VT-d, PCI devices can be reserved for use by the hypervisor. @@ -99,6 +122,12 @@ The and .Va pptdevs3 variables can be used for additional entries. +.Pp +In general, PCI passthrough cannot be used when running +.Xr bhyve 8 +as an unprivileged user or in a jail, as this feature requires write +access to +.Pa /dev/pci . .Sh LOADER TUNABLES Tunables can be set at the .Xr loader 8 @@ -109,6 +138,14 @@ prompt before booting the kernel or stored in Maximum number of virtual CPUs. The default is the number of physical CPUs in the system. .El +.Sh FILES +.Bl -tag -width /dev/vmmctl -compact +.It Pa /dev/vmmctl +control interface for creating and destroying virtual machines. +.It Pa /dev/vmm/* +device interface for individual virtual machines. +.It Pa /dev/vmm.io/* +device interface for device memory mapped into virtual machines. .Sh EXAMPLES Reserve three PCI devices for use by the hypervisor: bus 10 slot 0 function 0, bus 6 slot 5 function 0, and bus 6 slot 5 function 1. @@ -143,8 +180,10 @@ back: .Xr bhyve 4 , .Xr loader.conf 5 , .Xr bhyve 8 , +.Xr bhyvectl 8 , .Xr bhyveload 8 , .Xr devctl 8 , +.Xr jail 8 , .Xr kldload 8 .Sh HISTORY .Nm vmm.ko diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 4c73a119b1ed..be906419d74e 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 5, 2026 +.Dd January 23, 2026 .Dt BHYVE 8 .Os .Sh NAME @@ -117,8 +117,23 @@ on arm64 the package provides a U-Boot image that can be used to boot the guest. .Pp .Nm -runs until the guest operating system reboots or an unhandled hypervisor -exit is detected. +runs until the guest operating system reboots (if +.Ql monitor +mode is not enabled) or halts, or an unhandled hypervisor exit is +detected. +.Pp +Generally +.Nm +must be run by the super-user, but users belonging to the +.Va vmm +group can create and run virtual machines as well. +See +.Xr vmm 4 . +When run by an unprivileged user, +.Nm +must have access to any required resources such as disk images or +network devices. +PCI passthrough cannot be used by unprivileged users. .Sh OPTIONS .Bl -tag -width 10n .It Fl a @@ -605,8 +620,8 @@ addressing rules. The .Cm slirp backend can be used to provide a NATed network to the guest. -This backend has poor performance but does not require any network -configuration on the host system. +This backend has limited performance but does not require any network +configuration on the host system and can be used by unprivileged users. It depends on the .Pa net/libslirp port.