Skip to content

Commit

Permalink
qemu: use 9p by default
Browse files Browse the repository at this point in the history
Templates for the following distro are updated to continue using reverse-sshfs,
as 9p is not available on them.
- AlmaLinux
- CentOS Stream
- Debian
- openSUSE
- Oracle Linux
- Rocky Linux

Close issue 971

Signed-off-by: Akihiro Suda <[email protected]>
  • Loading branch information
AkihiroSuda committed Jul 2, 2024
1 parent 912d29b commit 854a0a0
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 3 deletions.
2 changes: 2 additions & 0 deletions examples/almalinux-8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ images:
arch: "x86_64"
- location: "https://repo.almalinux.org/almalinux/8/cloud/aarch64/images/AlmaLinux-8-GenericCloud-latest.aarch64.qcow2"
arch: "aarch64"
# The mount type is set to reverse-sshfs because 9p (default for QEMU) is not supported by the guest kernel. VZ users should specify `--mount-type=virtiofs` on `limactl create` for better performance.
mountType: "reverse-sshfs"
mounts:
- location: "~"
- location: "/tmp/lima"
Expand Down
2 changes: 2 additions & 0 deletions examples/almalinux-9.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ images:
arch: "x86_64"
- location: "https://repo.almalinux.org/almalinux/9/cloud/aarch64/images/AlmaLinux-9-GenericCloud-latest.aarch64.qcow2"
arch: "aarch64"
# The mount type is set to reverse-sshfs because 9p (default for QEMU) is not supported by the guest kernel. VZ users should specify `--mount-type=virtiofs` on `limactl create` for better performance.
mountType: "reverse-sshfs"
mounts:
- location: "~"
- location: "/tmp/lima"
Expand Down
2 changes: 2 additions & 0 deletions examples/centos-stream-9.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ images:
arch: "x86_64"
- location: "https://cloud.centos.org/centos/9-stream/aarch64/images/CentOS-Stream-GenericCloud-9-latest.aarch64.qcow2"
arch: "aarch64"
# The mount type is set to reverse-sshfs because 9p (default for QEMU) is not supported by the guest kernel. VZ users should specify `--mount-type=virtiofs` on `limactl create` for better performance.
mountType: "reverse-sshfs"
mounts:
- location: "~"
- location: "/tmp/lima"
Expand Down
2 changes: 2 additions & 0 deletions examples/debian-11.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ images:
- location: "https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-arm64.qcow2"
arch: "aarch64"

# The mount type is set to reverse-sshfs because 9p (default for QEMU) is not supported by the guest kernel. VZ users should specify `--mount-type=virtiofs` on `limactl create` for better performance.
mountType: "reverse-sshfs"
mounts:
- location: "~"
- location: "/tmp/lima"
Expand Down
2 changes: 2 additions & 0 deletions examples/debian-12.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ images:
- location: "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-arm64.qcow2"
arch: "aarch64"

# The mount type is set to reverse-sshfs because 9p (default for QEMU) is not supported by the guest kernel. VZ users should specify `--mount-type=virtiofs` on `limactl create` for better performance.
mountType: "reverse-sshfs"
mounts:
- location: "~"
- location: "/tmp/lima"
Expand Down
2 changes: 1 addition & 1 deletion examples/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ mounts:

# Mount type for above mounts, such as "reverse-sshfs" (from sshocker), "9p" (EXPERIMENTAL (until Lima v1.0), from QEMU’s virtio-9p-pci, aka virtfs),
# or "virtiofs" (EXPERIMENTAL, needs `vmType: vz`)
# 🟢 Builtin default: "reverse-sshfs" (for QEMU), "virtiofs" (for vz)
# 🟢 Builtin default: "9p" (for QEMU, since Lima v1.0), "virtiofs" (for vz)
mountType: null

# Enable inotify support for mounted directories (EXPERIMENTAL)
Expand Down
2 changes: 2 additions & 0 deletions examples/experimental/opensuse-tumbleweed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ images:
- location: "https://provo-mirror.opensuse.org/ports/aarch64/tumbleweed/appliances/openSUSE-Tumbleweed-ARM-JeOS-efi.aarch64.qcow2"
arch: "aarch64"

# The mount type is set to reverse-sshfs because 9p (default for QEMU) is not supported by the guest kernel. VZ users should specify `--mount-type=virtiofs` on `limactl create` for better performance.
mountType: "reverse-sshfs"
mounts:
- location: "~"
- location: "/tmp/lima"
Expand Down
2 changes: 2 additions & 0 deletions examples/opensuse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ images:
arch: "x86_64"
- location: "https://download.opensuse.org/distribution/leap/15.5/appliances/openSUSE-Leap-15.5-Minimal-VM.aarch64-Cloud.qcow2"
arch: "aarch64"
# The mount type is set to reverse-sshfs because 9p (default for QEMU) is not supported by the guest kernel. VZ users should specify `--mount-type=virtiofs` on `limactl create` for better performance.
mountType: "reverse-sshfs"
mounts:
- location: "~"
- location: "/tmp/lima"
Expand Down
2 changes: 2 additions & 0 deletions examples/oraclelinux-8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ images:
- location: "https://yum.oracle.com/templates/OracleLinux/OL8/u10/aarch64/OL8U10_aarch64-kvm-cloud-b100.qcow2"
arch: "aarch64"
digest: "sha256:def7b8055e275507a593f07dc6076a2adc5967af046c003072b479e69f25f407"
# The mount type is set to reverse-sshfs because 9p (default for QEMU) is not supported by the guest kernel. VZ users should specify `--mount-type=virtiofs` on `limactl create` for better performance.
mountType: "reverse-sshfs"
mounts:
- location: "~"
- location: "/tmp/lima"
Expand Down
2 changes: 2 additions & 0 deletions examples/oraclelinux-9.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ images:
- location: "https://yum.oracle.com/templates/OracleLinux/OL9/u4/aarch64/OL9U4_aarch64-kvm-cloud-b90.qcow2"
arch: "aarch64"
digest: "sha256:1f4e20190e87c76e8c3b4a9e15e660972386cbfa4f128e5cdcd8faa43a713d44"
# The mount type is set to reverse-sshfs because 9p (default for QEMU) is not supported by the guest kernel. VZ users should specify `--mount-type=virtiofs` on `limactl create` for better performance.
mountType: "reverse-sshfs"
mounts:
- location: "~"
- location: "/tmp/lima"
Expand Down
2 changes: 2 additions & 0 deletions examples/rocky-8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ images:
arch: "x86_64"
- location: "https://dl.rockylinux.org/pub/rocky/8/images/aarch64/Rocky-8-GenericCloud.latest.aarch64.qcow2"
arch: "aarch64"
# The mount type is set to reverse-sshfs because 9p (default for QEMU) is not supported by the guest kernel. VZ users should specify `--mount-type=virtiofs` on `limactl create` for better performance.
mountType: "reverse-sshfs"
mounts:
- location: "~"
- location: "/tmp/lima"
Expand Down
2 changes: 2 additions & 0 deletions examples/rocky-9.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ images:
arch: "x86_64"
- location: "https://dl.rockylinux.org/pub/rocky/9/images/aarch64/Rocky-9-GenericCloud.latest.aarch64.qcow2"
arch: "aarch64"
# The mount type is set to reverse-sshfs because 9p (default for QEMU) is not supported by the guest kernel. VZ users should specify `--mount-type=virtiofs` on `limactl create` for better performance.
mountType: "reverse-sshfs"
mounts:
- location: "~"
- location: "/tmp/lima"
Expand Down
3 changes: 3 additions & 0 deletions hack/test-templates/test-misc.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# The test template for testing misc configurations:
# - disk
# - snapshots
# - (More to come)
#
# This template requires Lima v0.14.0 or later.
Expand All @@ -18,6 +19,8 @@ images:
- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img"
arch: "aarch64"

# 9p is not compatible with `limactl snapshot`
mountType: "reverse-sshfs"
mounts:
- location: "~"
writable: true
Expand Down
7 changes: 5 additions & 2 deletions pkg/limayaml/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,12 @@ func FillDefault(y, d, o *LimaYAML, filePath string) {
y.MountType = o.MountType
}
if y.MountType == nil || *y.MountType == "" {
if *y.VMType == VZ {
switch *y.VMType {
case VZ:
y.MountType = ptr.Of(VIRTIOFS)
} else {
case QEMU:
y.MountType = ptr.Of(NINEP)
default:
y.MountType = ptr.Of(REVSSHFS)
}
}
Expand Down
19 changes: 19 additions & 0 deletions website/content/en/docs/faq/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ weight: 6
- [Filesystem sharing](#filesystem-sharing)
- ["Filesystem is slow"](#filesystem-is-slow)
- ["Filesystem is not writable"](#filesystem-is-not-writable)
- ["Filesystem is unmounted after upgrading Lima to v1.0 (pre-release)"](#filesystem-is-unmounted-after-upgrading-lima-to-v10-pre-release)
- [External projects](#external-projects)
- ["I am using Rancher Desktop. How to deal with the underlying Lima?"](#i-am-using-rancher-desktop-how-to-deal-with-the-underlying-lima)
- ["Hints for debugging other problems?"](#hints-for-debugging-other-problems)
Expand Down Expand Up @@ -230,6 +231,24 @@ mounts:

Run `limactl edit <INSTANCE>` to open the YAML editor for an existing instance.

#### "Filesystem is unmounted after upgrading Lima to v1.0 (pre-release)"

Lima v1.0 (pre-release) changed the default mount driver for QEMU from `reverse-sshfs` to `9p`.

This change is known to be incompatible with the following guest operating systems:
- AlmaLinux, CentOS Stream, Oracle Linux, and RockyLinux
- Debian GNU/Linux
- openSUSE

A new instance of these OS still use `reverse-sshfs` by default, however,
an existing instance created with a previous version of Lima needs running the following command:

```
limactl edit --mount-type=reverse-sshfs <NAME>
```

Ubuntu users are not affected by this issue.

### External projects
#### "I am using Rancher Desktop. How to deal with the underlying Lima?"

Expand Down

0 comments on commit 854a0a0

Please sign in to comment.