how does kvm mount host floder
- User
how does kvm mount host floder
- Assistant
KVM can mount a host folder by using the virtiofsd daemon to create a shared file system between the host and the guest operating system.
To mount a host folder in KVM, you can follow these steps:
-
First, make sure that the virtiofsd daemon is installed on the host system.
-
Then, create a directory on the host system that will be used as the shared folder.
-
Start the virtiofsd daemon with the following command:
sudo virtiofsd --socket-path=/run/virtiofsd-socket -o source=<path-to-shared-folder>,allow_otherReplace
<path-to-shared-folder>with the actual path to the shared folder. -
In the KVM guest operating system, install the virtio-fs driver.
-
Mount the shared folder in the guest operating system using the following command:
sudo mount -t virtiofs none /mount/pointReplace
/mount/pointwith the desired mount point in the guest operating system. -
The shared folder should now be accessible in the KVM guest operating system.
-