minikube/pkg
Nir Soffer 96229adc41 drivers: Add Virtiofs mounts for vfkit and krunkit
Replace 9p mounts with virtiofs for vfkit and krunkit. Testing shows
that virtiofs mount is 23 times faster with krunkit, and 8 times faster
with vfkit.

vfkit and krunkit support multiple virtiofs mounts but minikube
--mount-* flags are not ready for multiple mounts. We have the same
issue with KIC drivers, supporting multiple mounts but using only one.
We hope to improve this in the next release.

Example usage:

    minikube start --mount-string ~/models:/mnt/models

The arguments are parsed and validated when configuring the driver, so
invalid arguments fail quickly without starting the driver. The
validated mounts are stored in the machine config:

    $ jq '.Driver.VirtiofsMounts' < ~/.minikube/machines/minikube/config.json
    [
      {
        "HostPath": "/Users/joe/models",
        "GuestPath": "/mnt/models",
        "Tag": "f845b54d-00e3-493d-9541-3b37490b96db"
      }
    ]

Minikube generates a new random UUID for every virtiofs mount to
identify the file system inside the guest. In krunkit and vfkit, every
mount is add as:

    --device virtio-fs,sharedDir=/host-path,mountTag=f845b54d-00e3-493d-9541-3b37490b96db

When the guest is started the shared directory is mounted via SSH using:

    sudo mkdir -p /mnt/models
    sudo mount -t virtiofs f845b54d-00e3-493d-9541-3b37490b96db /mnt/models

Example mount:

    $ minikube ssh findmnt /mnt/models
    TARGET      SOURCE                               FSTYPE   OPTIONS
    /mnt/models f845b54d-00e3-493d-9541-3b37490b96db virtiofs rw,relatime

More work is needed to add VirtioFS to qemu. I'm starting with vfkit and
krunkit since they have identical interface (krunkit was designed as
drop-in replacement for vfkit).
2025-08-20 21:12:45 -07:00
..
addons new: add kubetail addon (#20345) 2025-06-05 10:39:36 -07:00
drivers drivers: Add Virtiofs mounts for vfkit and krunkit 2025-08-20 21:12:45 -07:00
generate build: address all lint issues by v2 (#20804) 2025-05-23 17:31:28 -07:00
gvisor addons gvisor: Add arm64 support 2024-01-30 15:11:54 -08:00
kapi build: address all lint issues by v2 (#20804) 2025-05-23 17:31:28 -07:00
minikube drivers: Add Virtiofs mounts for vfkit and krunkit 2025-08-20 21:12:45 -07:00
network spelling: Fix spelling errors with codespell (#21273) 2025-08-11 11:27:20 -07:00
perf/monitor Update go-github from v73.0.0 to v74.0.0 (#21234) 2025-08-04 12:36:45 -07:00
provision improve docker service reliability, update docker systemd files (#21174) 2025-08-09 14:49:55 -07:00
storage build: address all lint issues by v2 (#20804) 2025-05-23 17:31:28 -07:00
trace Fix typos 2022-06-10 15:26:35 -07:00
util fix bug in parsing proxies with dashes (#20648) 2025-05-13 12:58:10 -07:00
version bump go mod libs manually 2021-06-29 15:24:59 -04:00