Page MenuHomeFreeBSD

bhyve: allow overriding snapshot socket directory
Needs ReviewPublic

Authored by novel on Sun, Jun 7, 7:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 8, 1:54 AM
Unknown Object (File)
Mon, Jun 8, 1:54 AM
Subscribers

Details

Reviewers
None
Group Reviewers
bhyve
Summary

By default bhyve(8) creates a snapshot socket in
"/var/run/bhyve/" (BHYVE_RUN_DIR).
As this is a system directory not writable by users,
this does not work when bhyve(8) is being started
as a non-root user.

Address that by allowing to override this directory.
In bhyve(8) it is done by setting 'rundir' option
with '-o rundir=<path>'.

In bhyvectl(8) it is done with '--rundir=<path>'.

Test Plan

sudo -u bhyve -g vmm bhyve -M -c 2 -m 4096 -o pci.enable_bars=1 -u -H -P \

-s 0:0,hostbridge -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
-s 2:0,xhci,tablet -s 1:0,lpc \
-s 3:0,ahci,cd:/data/isos/alpine-standard-3.23.4-x86_64.iso \
-s 6:0,fbuf,tcp=127.0.0.1:5901 \
-l com1,stdio \
-o rundir=/tmp/bhyve_run \
alpine

sudo -u bhyve -g vmm bhyvectl --checkpoint=/tmp/vm --vm=alpine --rundir=/tmp/bhyve_run

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 73730
Build 70613: arc lint + arc unit