---
---
Lima supports several methods for mounting the host filesystem into the guest.
The default mount type is shown in the following table:
Lima Version | Default |
---|---|
< 0.10 | reverse-sshfs + Builtin SFTP server |
>= 0.10 | reverse-sshfs + OpenSSH SFTP server |
>= 0.17 | reverse-sshfs + OpenSSH SFTP server for QEMU, virtiofs for VZ |
>= 1.0 | 9p for QEMU (on non-Windows), virtiofs for VZ |
Mount types
reverse-sshfs
The "reverse-sshfs" mount type exposes the host filesystem by running an SFTP server on the host. While the host works as an SFTP server, the host does not open any TCP port, as the host initiates an SSH connection into the guest and let the guest connect to the SFTP server via the stdin.
An example configuration: {{< tabpane text=true >}} {{% tab header="CLI" %}}
{{% /tab %}} {{% tab header="YAML" %}}
{{% /tab %}} {{< /tabpane >}}
The default value of sftpDriver
has been set to "openssh-sftp-server" since Lima v0.10, when an OpenSSH SFTP Server binary such as /usr/libexec/sftp-server
is detected on the host. Lima prior to v0.10 had used "builtin" as the SFTP driver.
Caveats
A mount is disabled when the SSH connection was shut down.
A compromised
sshfs
process in the guest may have access to unexposed host directories.
9p
The "9p" mount type is implemented by using QEMU's virtio-9p-pci devices. virtio-9p-pci is also known as "virtfs", but note that this is unrelated to virtio-fs.
An example configuration: {{< tabpane text=true >}} {{% tab header="CLI" %}}
{{% /tab %}} {{% tab header="YAML" %}}
{{% /tab %}} {{< /tabpane >}}
The "9p" mount type requires Lima v0.10.0 or later.
Caveats
The "9p" mount type is known to be incompatible with CentOS, Rocky Linux, and AlmaLinux as their kernel do not support
CONFIG_NET_9P_VIRTIO
.
virtiofs
Warning "virtiofs" mode is experimental on Linux hosts
⚡ Requirement | Lima >= 0.14, macOS >= 13.0 | Lima >= 0.17.0, Linux, QEMU 4.2.0+, virtiofsd (Rust version) |
---|
The "virtiofs" mount type is implemented via the virtio-fs device by using apple Virtualization.Framework shared directory on macOS and virtiofsd on Linux. Linux guest kernel must enable the CONFIG_VIRTIO_FS support for this support.
An example configuration: {{< tabpane text=true >}} {{% tab header="CLI" %}}
{{% /tab %}} {{% tab header="YAML" %}}
{{% /tab %}} {{< /tabpane >}}
Caveats
For macOS, the "virtiofs" mount type is supported only on macOS 13 or above with
vmType: vz
config. See alsovmtype
.For Linux, the "virtiofs" mount type requires the Rust version of virtiofsd. Using the version from QEMU (usually packaged as
qemu-virtiofsd
) will not work, as it requires root access to run.
wsl2
Warning "wsl2" mode is experimental
⚡ Requirement | Lima >= 0.18 + (Windows >= 10 Build 19041 OR Windows 11) |
---|
The "wsl2" mount type relies on using WSL2's native disk sharing, where the root disk is available by default at /mnt/$DISK_LETTER
(e.g. /mnt/c/
).
An example configuration: {{< tabpane text=true >}} {{% tab header="CLI" %}}
{{% /tab %}} {{% tab header="YAML" %}}
{{% /tab %}} {{< /tabpane >}}
Caveats
WSL2 file permissions may not work exactly as expected when accessing files that are natively on the Windows disk (more info)
WSL2's disk sharing system uses a 9P protocol server, making the performance similar to Lima's 9p mode (more info)
Mount Inotify
Warning "mountInotify" is experimental
⚡ Requirement | Lima >= 0.21.0 |
---|
The mountInotify
support enables inotify support for all different mountTypes like 9p, virtiofs etc.
When mountInotify is enabled,
hostagent will listen and send inotify events from host machine to guest.
Guest will modify the file to trigger inotify on guest side
This support will be enabled only for writable mounts because only for writable mount guest will be able to trigger inotify
An example configuration: {{< tabpane text=true >}} {{% tab header="CLI" %}}
{{% /tab %}} {{% tab header="YAML" %}}
{{% /tab %}} {{< /tabpane >}}
Caveats
For
mountType: 9p
, Inotify events are not triggered for nested files from the listening directory.Inotify events are not triggered when files are removed from host