Skip to content

Commit e532034

Browse files
authored
Merge pull request #1613 from AkihiroSuda/vz-virtiofs-default
vz: enable virtiofs by default
2 parents e5c198b + 9579659 commit e532034

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

docs/mount.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ Lima supports several methods for mounting the host filesystem into the guest.
44

55
The default mount type is shown in the following table:
66

7-
| Lima Version | Default |
8-
| ---------------- | ----------------------------------- |
9-
| < 0.10 | reverse-sshfs + Builtin SFTP server |
10-
| >= 0.10 | reverse-sshfs + OpenSSH SFTP server |
11-
| >= 1.0 (Planned) | 9p for QEMU, virtiofs for VZ |
7+
| Lima Version | Default |
8+
| ---------------- | ------------------------------------------------------------- |
9+
| < 0.10 | reverse-sshfs + Builtin SFTP server |
10+
| >= 0.10 | reverse-sshfs + OpenSSH SFTP server |
11+
| >= 0.17 | reverse-sshfs + OpenSSH SFTP server for QEMU, virtiofs for VZ |
12+
| >= 1.0 (Planned) | 9p for QEMU, virtiofs for VZ |
1213

1314
## Mount types
1415

examples/default.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ mounts:
9696

9797
# Mount type for above mounts, such as "reverse-sshfs" (from sshocker), "9p" (EXPERIMENTAL, from QEMU’s virtio-9p-pci, aka virtfs),
9898
# or "virtiofs" (EXPERIMENTAL, needs `vmType: vz`)
99-
# 🟢 Builtin default: "reverse-sshfs"
99+
# 🟢 Builtin default: "reverse-sshfs" (for QEMU), "virtiofs" (for vz)
100100
mountType: null
101101

102102
# Lima disks to attach to the instance. The disks will be accessible from inside the

pkg/limayaml/defaults.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,11 @@ func FillDefault(y, d, o *LimaYAML, filePath string) {
565565
y.MountType = o.MountType
566566
}
567567
if y.MountType == nil || *y.MountType == "" {
568-
y.MountType = pointer.String(REVSSHFS)
568+
if *y.VMType == VZ {
569+
y.MountType = pointer.String(VIRTIOFS)
570+
} else {
571+
y.MountType = pointer.String(REVSSHFS)
572+
}
569573
}
570574

571575
// Note: DNS lists are not combined; highest priority setting is picked

pkg/limayaml/defaults_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ func TestFillDefault(t *testing.T) {
372372
expect.HostResolver.Hosts = map[string]string{
373373
"default": d.HostResolver.Hosts["default"],
374374
}
375-
expect.MountType = pointer.String(REVSSHFS)
375+
expect.MountType = pointer.String(VIRTIOFS)
376376
expect.CACertificates.RemoveDefaults = pointer.Bool(true)
377377
expect.CACertificates.Certs = []string{
378378
"-----BEGIN CERTIFICATE-----\nYOUR-ORGS-TRUSTED-CA-CERT\n-----END CERTIFICATE-----\n",

0 commit comments

Comments
 (0)