qemu/kvm/virt-manager 无法与windows虚拟机共享文件;挂载多磁盘

Windows 无法启动VirtIO-FS Service服务,错误1053:服务没有及时响应启动或控制请求

需要安装WinFSP
参考:https://forums.unraid.net/topic/140129-vm-windows-10-virtio-fs-service-cannot-start/

virtiofs 与 kvmfr 冲突,改用samba

Netboy3
网络男孩3 — 2024/08/03 07:15
virtiofs breaks with kvmfr. It's a QEMU issue. Search for virtiofs on this server to see some of the comments and alternatives recommendations
virtiofs 与 kvmfr 冲突。这是 QEMU 问题。在此服务器上搜索 virtiofs 以查看一些评论和替代方案建议

用samba网络共享

sudo vim /etc/samba/smb.conf

[pub]
   comment = 共享文件夹,登录后可写,nolcq.trim(0,4)
   path = /media/n/data/
   browsable = yes
   read only = no
   public = yes
   valid users = @n
   write list = @n
   create mask = 0664
   directory mask = 0775
   force user = n
   force group = n
   guest ok = no
   unix extensions = no
   follow symlinks = yes
   hosts allow = 127.0.0.1/24
   hosts deny = 0.0.0.0/0

[public]
   comment = 共享文件夹,匿名仅可读
   path = /media/n/data/pub
   browsable = yes
   read only = yes
   public = yes
   guest ok = yes
   force user = nobody
   force group = nogroup

添加用户与密码

# sudo rm /var/lib/samba/private/passdb.tdb
sudo pdbedit -a -u <username>
sudo pdbedit -L # 列举现有samba用户

win刷新缓存

net use * /delete

Ghosthree3
鬼三3 — 2024/06/02 23:05
i just have a basic drop dir to share things between the two systems
我只有一个基本的目录来在两个系统之间共享东西
if i need some other big directory, instead of adding another share for it i just symlink it into the drop dir
如果我需要其他一些大目录,我只需将其符号链接到放置目录中,而不是为其添加另一个共享

挂载多个磁盘

https://virtio-win.github.io/Knowledge-Base/Virtiofs:-Shared-file-system
https://github.com/virtio-win/kvm-guest-drivers-windows/issues/590

virtio.bat

:: sc stop VirtioFsSvc
:: sc config VirtioFsSvc start=demand
:: "C:\Program Files (x86)\WinFsp\bin\fsreg.bat" virtiofs "C:\Program Files\Virtio-Win\VioFS\virtiofs.exe" "-t %1 -m %2"

set winfsp="C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe"
%winfsp% start virtiofs data data Y:
%winfsp% start virtiofs linux linux Z:
pause
%winfsp% stop virtiofs data
%winfsp% stop virtiofs linux

参考教程

如何在 Linux 主机和 KVM 中的 Windows 客户机之间共享文件夹

looking glass, Assertion failed: index < vector->size && "Out of bounds access"

检查是否设置qemu参数,要同时设置domainqemu:commandline

<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">
...
<qemu:commandline>
    <qemu:arg value="-device"/>
    <qemu:arg value="{&quot;driver&quot;:&quot;ivshmem-plain&quot;,&quot;id&quot;:&quot;shmem0&quot;,&quot;memdev&quot;:&quot;looking-glass&quot;}"/>
    <qemu:arg value="-object"/>
    <qemu:arg value="{&quot;qom-type&quot;:&quot;memory-backend-file&quot;,&quot;id&quot;:&quot;looking-glass&quot;,&quot;mem-path&quot;:&quot;/dev/kvmfr0&quot;,&quot;size&quot;:33554432,&quot;share&quot;:true}"/>
  </qemu:commandline>
posted @ 2024-05-08 18:20  Nolca  阅读(467)  评论(0)    收藏  举报