---
name: "virtio_p9fs"
section: "4"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/p9fs"
---

# virtio\_p9fs(4)

9P file system

Part of [p9fs(4)](/p9fs/4.md).

## NAME

**p9fs**, **virtio\_p9fs** – 9P file system

## SYNOPSIS

To use this filesystem, either add the following to the kernel config:

**options P9FS** **device virtio\_p9fs**

Alternatively, load the driver as a kernel module, either at boot time by adding the following to [loader.conf(5)](/loader.conf/5.md):

```
virtio_p9fs_load="YES"
```

or on system startup using the command:

```
# sysrc kld_list+=virtio_p9fs
```

## DESCRIPTION

The **p9fs** filesystem uses the 9P protocol to mount a host file system directory into a [bhyve(8)](/bhyve/8.md) guest. Multiple host directories can be accessed using the [bhyve(8)](/bhyve/8.md) virtio-9p virtual PCI device. Each device is configured with a share name and a host directory path. The share name can be used with [mount(8)](/mount/8.md) to mount the host directory in the guest:

```
# mount -t p9fs mysharename /mnt
```

Host directories can be mounted on system startup using [fstab(5)](/fstab/5.md) like this:

```
mysharename	/mnt	p9fs	rw	0	0
```

Using **p9fs** as a root file system is supported by adding the following to [loader.conf(5)](/loader.conf/5.md):

```
vfs.root.mountfrom="p9fs:mysharename"
```

## LIMITATIONS

The 9P protocol relies on stateful file opens which map protocol-level FIDs to host file descriptors. The FreeBSD vnode interface doesn't support this and **p9fs** uses heuristics to guess the right FID to use for file operations.

This can be confused by privilege lowering and does not guarantee that the FID created for a given file open is always used, even if the calling process is using the file descriptor from the original open call.

In particular, accessing unlinked files using open file descriptor may not work correctly. If **p9fs** is the root filesystem, it is recommended to use with [tmpfs(5)](/tmpfs/5.md) to ensure that temporary files created in */tmp* or */var/tmp* have the expected semantics.

## SEE ALSO

[fstab(5)](/fstab/5.md), [mount(8)](/mount/8.md)

## HISTORY

The 9P protocol first appeared in the Plan 9 operating system. More recently, the protocol has been widely used with virtual machines to allow the use of host file resources inside a guest VM.

## AUTHORS

This is derived from software released by Juniper Networks, Inc. with many improvements and fixes from Steve Wills.

This manual page was written by Doug Rabson ⟨*dfr@FreeBSD.org*⟩.

## BUGS

A better name for this filesystem would be *9pfs* but for technical reasons, the names of filesystems must be valid C identifiers. As a compromise, the filesystem is named **p9fs**.
