Using mountsnoop-bpfcc inside the VM:
A failed device attachment:
COMM PID TID MNT_NS CALL
mount 657 657 4026531841 fsopen("virtiofs", MS_RDONLY) = 3
mount 657 657 4026531841 fsconfig(3, FSCONFIG_SET_STRING, "source", "incus_debvm_shared", 0) = 0
mount 657 657 4026531841 fsconfig(3, FSCONFIG_CMD_CREATE, "", "", 0) = -EINVAL
A successful one:
mount 664 664 4026531841 fsopen("virtiofs", MS_RDONLY) = 3
mount 664 664 4026531841 fsconfig(3, FSCONFIG_SET_STRING, "source", "incus_debvm_shared", 0) = 0
mount 664 664 4026531841 fsconfig(3, FSCONFIG_CMD_CREATE, "", "", 0) = 0
mount 664 664 4026531841 fsmount(3, MS_RDONLY, 0x0) = 4
mount 664 664 4026531841 move_mount(4, "", AT_FDCWD, "/host", MOVE_MOUNT_F_EMPTY_PATH) = 0
This is consistent with the “tag not found” error message of course.
When it fails, the incus-agent running in debug mode shows:
Apr 01 20:05:31 debvm incus-agent[577]: time="2025-04-01T20:05:31Z" level=debug msg="API Request\n\t{\n\t\t\"metadata\": {\n\t\t\t\"action\": \"added\",\n\t\t\t\"config\": {\n\t\t\t\t\"path\": \"/host\",\n\t\t\t\t\"source\": \"/root\",\n\t\t\t\t\"type\": \"disk\"\n\t\t\t},\n\t\t\t\"name\": \"debvm_shared\"\n\t\t},\n\t\t\"timestamp\": \"2025-04-01T22:05:32.415517711+02:00\",\n\t\t\"type\": \"device\"\n\t}"
Apr 01 20:05:31 debvm incus-agent[577]: time="2025-04-01T20:05:31Z" level=info msg="Failed to mount hotplug \"incus_debvm_shared\" (Type: \"virtiofs\") to \"/host\""
But that error is not propagated to the host (the device is seen as successfully added on the host).
It really smells like a race condition between virtiofsd’s creation of the share, and incusd asking incus-agent to mount it.