Skip to content

fix: use virtiofs mount type for krunkit vm type - #1641

Open
bigbitbox wants to merge 1 commit into
abiosoft:mainfrom
bigbitbox:fix/krunkit-mount-type
Open

bigbitbox wants to merge 1 commit into
abiosoft:mainfrom
bigbitbox:fix/krunkit-mount-type

Conversation

@bigbitbox

Copy link
Copy Markdown

Problem

colima start --vm-type krunkit (without an explicit --mount-type) fails to boot the VM:

Failed to set config  error="rpc error: code = Unknown desc = field `mountType` must be `virtiofs` or `reverse-sshfs` for krunkit driver, got `9p`"
level=fatal msg="failed to create driver instance: ... failed to set config"

Reproduced with colima v0.10.3 on macOS 26.3.2 (Apple Silicon), krunkit 1.3.2.

Cause

cmd/start.go already knows krunkit is a virtiofs VM type (it does not downgrade virtiofs to sshfs for krunkit, and it rewrites 9p to virtiofs), but environment/vm/lima/yaml.go resolves the Lima mount type as:

default:
	if l.VMType == limaconfig.VZ {
		l.MountType = limaconfig.VIRTIOFS
	} else { // qemu
		l.MountType = limaconfig.NINEP
	}

so for krunkit the mount type ends up as 9p, which the krunkit driver rejects.

Fix

Resolve virtiofs for krunkit the same way as for vz. qemu keeps using 9p.

Tests

Added Test_config_MountType covering krunkit/vz/qemu with virtiofs, 9p and sshfs.
Without the fix the new test fails with:

--- FAIL: Test_config_MountType/krunkit_virtiofs
    yaml_test.go:140: mount type = 9p, want virtiofs

Workaround until this is released: colima start --vm-type krunkit --mount-type sshfs.

The krunkit driver only supports virtiofs and reverse-sshfs, but the mount
type was resolved to 9p for krunkit, so the VM failed to start with:

    field `mountType` must be `virtiofs` or `reverse-sshfs` for krunkit driver, got `9p`

cmd/start.go already treats krunkit as a virtiofs VM type (it rewrites 9p to
virtiofs for krunkit), so resolve the mount type the same way in yaml.go.

Add Test_config_MountType covering krunkit, vz and qemu.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant