From nobody Tue Sep 9 13:48:04 2025 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 4cLlWr1GGnz66xPQ for ; Tue, 09 Sep 2025 13:48:08 +0000 (UTC) (envelope-from ivy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cLlWr0lpWz3tcW for ; Tue, 09 Sep 2025 13:48:08 +0000 (UTC) (envelope-from ivy@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757425688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PrTNu5I3waOpLvDkxUkQ0NCNApSgcX37CtpP3ty+6R8=; b=IS+vR/7lyd8gsTMcZsYiXTfempkhFqP9CuHc3uGFvATy4ERLfBCs2En88LoJziK8g5w3Zq Sxuo5eQj4hdDBIPZzIqzD6PJNRCOiqSQiu3H/aGsGyrkNt3ieCevMN8kkP+yuV8lvhObDH ArSuXhB3zCs7EmP+ESBmO2r3Ei/H8y0c9Nv/0h/Q22iqAIbbWdRHPObBvr6UiuVY3d49N3 GHLF1tEeDw/IV0RJBsT/KXnGOiIplCy2DozpTTTM7daiLHDTbt9lfPxHSRQCKuzTJ9nrn1 PfZvkz+VGxc59pQDaKgxD4ZvWMd+1tElvvOqM2BtlQ8B6Hj0GTamT9uuzLJUqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757425688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PrTNu5I3waOpLvDkxUkQ0NCNApSgcX37CtpP3ty+6R8=; b=kDFtXILd6qvE5c0YQKPptBz/j3CEXwDvMHMu6/U9Y/u0ehMe7dm+AGWfT+XLpeokZqXJZR FuATiAl08M2RUba0aKQbEE72gyUdETlovaIut+R32oxVE78KC3iWDvc6bxeQlHTJ+4mN/l mrlfp3PKYh7xdsIk65yWwyDHJASoQ6EeeBShd0gE0wjngNQQK3NwPLJdc4ltdcWbTU1A12 sITywk8gT07TIILHimsHDBe3cSdTpDqK4No5sPaU6wNIQ/kSFBYmgndti4kETh/Ea7y6e5 h2+5HmelbhkkbAw9COiIlt+34Krhiv9yJSZzhZdPbZglxNMx724SgSyzQRVMHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757425688; a=rsa-sha256; cv=none; b=VB6AKpBw4HIdYgjQMYBkkbfitSrx9lCB4YZ49kPCTPcdS/lsXdEJFLWYHwvaI2LTxWYlgM ZGXPmvXjbC1o11cgzWVxpNUtf/eqqsN/xf6EoD9GXfSP8ofDdEWR0xzrpl4lIzm+xlwiQJ O6T5x0f0h3REVfID4vzwJM05rigJXOkFejmqR6v43VPDN1mwoXxD581NMFGmwIcIPKCIiS 9DMziQuKu0lu3foPSNz7kDgAC3Ic+tghWVq5rIz0Wqr83Wo73ITXUKkP5MWJcXcu+6PoXG a61QvsMwrK+naOjOjYJfKqap1GVWcl/vzHJo1+JPi6iu8gEevWx+GfktZWsfVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from amaryllis.le-fay.org (amaryllis.le-fay.org [IPv6:2a00:1098:6b:400::9]) (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 did not present a certificate) (Authenticated sender: ivy/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4cLlWq55vRz17GS for ; Tue, 09 Sep 2025 13:48:07 +0000 (UTC) (envelope-from ivy@freebsd.org) Date: Tue, 9 Sep 2025 14:48:04 +0100 From: Lexi Winter To: freebsd-virtualization@freebsd.org Subject: Re: bhyve rw access to host filesystem? Message-ID: Mail-Followup-To: freebsd-virtualization@freebsd.org References: List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-virtualization@freebsd.org Sender: owner-freebsd-virtualization@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="PU+L0fM/35rm4EcR" Content-Disposition: inline In-Reply-To: --PU+L0fM/35rm4EcR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline void: > I'd like to have one bhyve vm access the bhyve *host's* filesystem this is what p9fs(4) is for. > I can't seem to find instructions how to do this, although 9p looks > promising, am not sure this can be accessed from the host. p9fs exports an existing directory tree from the host (similar to the NFS server), so the host can always access the files by definition. to export the filesystem, add a virtio-9p device to bhyve: bhyve [...] -s 5:0,virtio-9p,myshare=/some/path,rw 'myshare' should be replaced with a descriptive name for the share, and change 'rw' to 'ro' to make it read-only. in the guest, mount the filesystem as normal in /etc/fstab using the same share name: myshare /myshare p9fs rw 0 0 note that unlike NFS, this doesn't work automatically for descendent mountpoints on the host (e.g., ZFS filesystem hierarchies); instead you need to export and mount each child filesystem separately. this is compatible on both the host and guest side with virtio-9p in Linux and other operating systems, but not with the newer version which i can't remember the name of (VirtFS?). --PU+L0fM/35rm4EcR Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSyjTg96lp3RifySyn1nT63mIK/YAUCaMAwEQAKCRD1nT63mIK/ YJTsAP9rRjJtXwesFIHCCeYl4IhdU6zGM/jVaN8MJK55gjIVKgEAlnrsStp34o1H HxBm2erlpE2OGEi4DSh+QZkjFKgcrQU= =LmyY -----END PGP SIGNATURE----- --PU+L0fM/35rm4EcR--