From nobody Tue Sep 9 18:34:09 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 4cLst82cMNz67HNT for ; Tue, 09 Sep 2025 18:34:24 +0000 (UTC) (envelope-from eduardo@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 4cLst809lxz3qcx for ; Tue, 09 Sep 2025 18:34:24 +0000 (UTC) (envelope-from eduardo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757442864; 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=hskvZLUiqNoEnJv2RKAkZRuCjd6mgGsrbS7tox+tdEc=; b=i85y2XnWoVa9QP3vpmfkBjH6y9VEckPlPnJfn2j6UugxhWVsl/nL/w3KLNSNikbO1ZKQno kBYCyXSPnS7xNuZOuQU35TB27+bAotXLs+zfjuGLo515DPvoZ+VmJFkRB/iL4vxdCC0JJ4 PNyhZtYvawYD61zW+74SirUX5miInVw+HlIV+7ZJEgxZv6qPv9BF9XLPmEnimePfssRWMX nDTsOhuIU/xMIKT1ZqZbg6tn1WsgWS9wqN0ClIy0TiqXJZAvkUgLKALnfxB1aPDjwMpvy+ lT35DK7AQA72fu7ON1nTFzuBzb8a48YbfwP0IuE93riHEdWlsVb+njfICFA8Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757442864; 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=hskvZLUiqNoEnJv2RKAkZRuCjd6mgGsrbS7tox+tdEc=; b=n2tmSc5Le4O7uqNmkShouoL7IZXErG+RFtM6PAb+k94orj8khvXFpVx0la7vlcg51aMDaD XAi0/7TVuFy/4bUI0DQrVORZtKovqp/Z3ofpxLDhOdLeHtavjtgSW0oEZR8r9g5gV5+Zs+ 4YkQVXDPTTSmjezqEn7L4MZZPFLeesceYyOyY93ef0X8ItYiOFA1lbadoaJYayDBSHzaig txQ1ex2u06j3paKiOpiog1Y9VCcBeQwMUt7hKmJnNxVM8sCMNqsxxP1qNzKddenwLgHTTh Rmi+fmUUsrx5eTkld+M0mE9V8HZan8HtQTn5cvfxlaRvIWznrYbkfS2/WNc1xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757442864; a=rsa-sha256; cv=none; b=iQ0WXsfGySaoU/1csHDZXV0pBDZ439LX4pFfgfhQ4lJ8SUSxCLY6nBTmDlbT0JWfjHNmU0 S9IfZbuANSdYXwa3NnaxMxTfJicKu1G8aRA01VdLhpqRl1wplaJ8jboWDCITMrOjh7bWVt fO8oJqgENjksLug4oHamx+0QF9DtXfvxh8uQ4kLJ+ikLgxN5GNsCwkdR50MlX2uXPuU3IX l0lbDsmLC1+DjabL+q2r37dHsVOt/x5MDlLGJO0sc8sV3orgPJCEr41SiTdfrBzUg0CaBw Kl/Ol5nZDaW5VoR5xd4AofLF+Vr/9gQVvjbijdvP1ZgpwabQYmHk8JDI7foAHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (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 "WR4" (verified OK)) (Authenticated sender: eduardo) by smtp.freebsd.org (Postfix) with ESMTPSA id 4cLst76QF0zCh for ; Tue, 09 Sep 2025 18:34:23 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-8143bdd15e1so19597985a.1 for ; Tue, 09 Sep 2025 11:34:23 -0700 (PDT) X-Gm-Message-State: AOJu0YzeCiEYmZOd7aNgyKVju0AJeux9aaYeqIVbuDzFg0CTL9TZbIqM H0s3sM8hC1sfM86daIqzSBRaw9vKP+2aw63kJMUSzuZDoyjGhR+3lsViDK5H513vQ/U8zOp7OHO LtpoF0tL0uqyrG861SORiUEskda7A8G8= X-Google-Smtp-Source: AGHT+IEdTOV9z0WdG2u+Tv+qBPSFQJ0YmQzSOab/EwbIni6q+lvIAXKC7Ho+0PpkGot6MgjkvaM/Wctqq0WHIq72Hi0= X-Received: by 2002:a05:620a:a510:b0:817:7f37:6b30 with SMTP id af79cd13be357-8177f377194mr497685585a.11.1757442863236; Tue, 09 Sep 2025 11:34:23 -0700 (PDT) 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 References: In-Reply-To: From: Nuno Teixeira Date: Tue, 9 Sep 2025 19:34:09 +0100 X-Gmail-Original-Message-ID: X-Gm-Features: Ac12FXxoDiwMCBoPvtZ5Dyx5hEoZnhRdYd1GlCfOgjK549S3XLCFHDmNsQ7_qOY Message-ID: Subject: Re: bhyve rw access to host filesystem? To: freebsd-virtualization@freebsd.org Content-Type: multipart/alternative; boundary="00000000000093af71063e628db0" --00000000000093af71063e628db0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, I have have already tried it with a linux (debian) guest and it works fine too. I'm looking for p9fs support on windows guests but for what I digged, there is no 9p support yet but I also found that microsoft uses it on linux subsystem... If you know a program that do 9p on windows, please share. Thanks, Lexi Winter escreveu (ter=C3=A7a, 9/09/2025 =C3=A0(s) 14:= 48): > 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=3D/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?). > --=20 Nuno Teixeira FreeBSD UNIX: Web: https://FreeBSD.org --00000000000093af71063e628db0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

I have have alread= y tried it with a linux (debian) guest and it works fine too.
I= 9;m looking for p9fs support on windows guests but for what I digged, there= is no 9p support yet but I also found that microsoft uses it on linux subs= ystem...

If you know a program that do 9p on windows, please s= hare.

Thanks,

Lexi Winter <ivy@freebsd.org> escreveu (ter=C3=A7a, 9/09/= 2025 =C3=A0(s) 14:48):
void:
> I'd like to have one bhyve vm access the bhyve *host's* filesy= stem

this is what p9fs(4) is for.

> I can't seem to find instructions how to do this, although 9p look= s
> 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:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 bhyve [...] -s 5:0,virtio-9p,myshare=3D/some/pa= th,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:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 myshare=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/mysha= re=C2=A0 =C2=A0 =C2=A0 =C2=A0 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?).


--
Nuno Teixeira
=
FreeBSD UNIX:=C2=A0 <eduardo@FreeBSD.org>=C2=A0 =C2=A0Web:=C2=A0 https://Fr= eeBSD.org
--00000000000093af71063e628db0--