vnd(4)

vnd4

Vnode disk driver

Usage

pseudo-device vnd [count]

Overview

The vnd driver provides a disk-like interface to a file. This is useful for a variety of applications, such as building miniroot or floppy disk images.

This document assumes familiarity with how to generate kernels and how to properly configure disks and pseudo-devices in a kernel configuration file.

In order to compile in support for vnd devices, a line similar to the following must be present in the kernel configuration file:

pseudo-device	vnd	4	# vnode disk driver

The count argument is how many vnds memory is allocated for at boot time. In this example, no more than 4 vnds may be configured.

There is a run-time utility that is used for configuring vnds. See vnconfig(8) for more information.

Ioctl interface

The following ioctl(2) calls are defined in ⟨dev/vndioctl.h⟩:

VNDIOCSET struct vnd_ioctl *

Associate the file vnd_file with a vnd pseudo device, optionally encrypted using the Blowfish cipher and the key specified in vnd_key of length vnd_keylen. The size of the configured device is returned in vnd_size.

struct vnd_ioctl {
	char	*vnd_file;
	off_t	vnd_size;
	u_char	*vnd_key;
	int	vnd_keylen;
};
VNDIOCCLR struct vnd_ioctl *

Disassociate a vnd device.

VNDIOCGET struct vnd_user *

Get the associated file name, device, inode number, and unit number of a vnd device. If vnu_unit is -1, information on the vnd device corresponding to the file descriptor passed to ioctl(2) will be returned. Otherwise, vnu_unit may contain the unit number of another vnd device. This allows for opening just vnd0 and querying all available devices.

struct vnd_user {
	char	vnufile[VNDNLEN];
	int	vnu_unit;
	dev_t	vnu_dev;
	ino_t	vnu_ino;
};

Additionally, some disklabel(8) related ioctl(2) calls defined in ⟨sys/dkio.h⟩ are available: DIOCGDINFO, DIOCSDINFO, and DIOCWDINFO. They are documented in sd(4).

Files

/dev/{,r}vnd*

vnd device special files

Releases

61 releases since OpenBSD 2.1; the text changed 15 times.

  1. 2.1–2.2
  2. 2.3
  3. 2.4–2.5
  4. 2.6
  5. 2.7
  6. 2.8–2.9
  7. 3.0–3.1
  8. 3.2–3.3
  9. 3.4
  10. 3.5–3.6
  11. 3.7–4.1
  12. 4.2–4.3
  13. 4.4–4.9
  14. 5.0–5.4
  15. 5.5
  16. 5.6–8.0

From man 8.0-current-20261101 in OpenBSD 8.0-current (2026-11-01). Parsed by carta from the page's mdoc source.