Linux

qemu/kvm中映射主机文件夹进win虚拟机方法

虚拟机中安装winfsp

https:////github.com/winfsp/winfsp/releases/

qemu中内存打开共享开关,或者xml中添加

  <memoryBacking>
    <access mode='shared'/>
  </memoryBacking>

fs文件系统的xlm中需要制定driver

<filesystem type="mount" accessmode="passthrough">
  <driver type="virtiofs"/>
  <binary path="/usr/lib/qemu/virtiofsd"/>
  <source dir="/media/raidhdd"/>
  <target dir="raidhdd"/>
  <alias name="fs0"/>
  <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
</filesystem>


win中启动服务Virtofs,或创建该服务

sc create VirtioFsSvc binpath="C:\Program Files\Virtio-Win\VioFS\virtiofs.exe" start=auto depend="WinFsp.Launcher/VirtioFsDrv" DisplayName="Virtio FS Service"

留言