virtio-win / kvm-guest-drivers-windows

Windows paravirtualized drivers for QEMU\KVM
https://www.linux-kvm.org/page/WindowsGuestDrivers
BSD 3-Clause "New" or "Revised" License
2.04k stars 387 forks source link

virtio-fs/windows troubleshooting #574

Closed fubar-1 closed 3 years ago

fubar-1 commented 3 years ago

Trying to get virtio-fs working, ubuntu-21.04 host + windows 10 guest. Am using hugepages not shm.

Everything appears to run, no errors. Just no shared folder in the windows guest. Details:

Starting guest results in following command line:

/usr/lib/qemu/virtiofsd --fd=34 -o source=/mnt/Data/Shared

/usr/bin/qemu-system-x86_64 \
(... irrelevant details omitted ...)
-object memory-backend-file,id=ram-node0,mem-path=/dev/hugepages/libvirt/qemu/4-gpu-template,share=yes,prealloc=yes,size=2147483648 \
-numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \
-chardev socket,id=charmonitor,fd=34,server,nowait \
-mon chardev=charmonitor,id=monitor,mode=control \
-chardev socket,id=chr-vu-fs0,path=/var/lib/libvirt/qemu/domain-4-gpu-template/fs0-fs.sock \
-device vhost-user-fs-pci,chardev=chr-vu-fs0,tag=Shared,bus=pci.8,addr=0x0 \
-netdev tap,fd=37,id=hostnet0,vhost=on,vhostfd=38 \
-object memory-backend-file,id=shmmem-shmem0,mem-path=/dev/shm/looking-glass,size=67108864,share=yes \
-device ivshmem-plain,id=shmem0,memdev=shmmem-shmem0,bus=pci.11,addr=0x1 \

which generates the following machine -fs0-virtiofsd.log log:

virtio_session_mount: Waiting for vhost-user socket connection...
virtio_session_mount: Received vhost-user socket connection
virtio_loop: Entry
fv_queue_set_started: qidx=0 started=1
fv_queue_thread: Start for queue 0 kick_fd 8
fv_queue_set_started: qidx=0 started=0
fv_queue_thread: kill event on queue 0 - quitting
fv_remove_watch: TODO! fd=8
virtio_loop: Unexpected poll revents 11
virtio_loop: Exit

in the guest, starting virtio-fs with C:\Program Files\Virtio-Win\VioFS\virtiofs.exe -d -1 -D - in an administrator cmd shell outputs:

*** VirtFsFuseRequest: >>req: 26 unique: 2 len: 56
*** VirtFsFuseRequest: <<len: 80 error: 0 unique: 2
The service VirtIO-FS has been started.

Problem is, no shared files.

Notes / thoughts that may or may not be important: Path to shared files on host are all 777. Shared folder is the root of a ZFS filesystem. I'm using this in combination with shm shared graphics called looking-glass. Conflict? Is hugepages ready / recommended for machines using vfio passthrough?

Any suggestions for how to debug this since I'm seeing what appear to be no errors in the logs?

fubar-1 commented 3 years ago

Can anyone provide suggestions for steps to troubleshoot this issue? So far I've tried switching from hugepage to shm configuration but am getting the same results. Are there any additional debug settings or logs to look at to gain insight at where / why it's failing?

hammerg commented 3 years ago

Hi Dave,

When running virtiofs.exe manually, it should be from a non-admin command prompt. Also adding "-d" to virtiofsd's command prompt might provide some more information.

Thanks,

Gal.
fubar-1 commented 3 years ago

Ok I got it working. In my case it was that the 2GB of memory defined in the <numa> XML node added to enable this feature was silently overriding the <memory> node and 2GB was apparently insufficient.

I might suggest the developers consider outputting an error somewhere rather than just silently refusing to work.

Of course this led to a new problem, I can't seem to define a numa node with 32GB of RAM, which is what I need. 24GB works though (??) so good enough for now. But this is not a virtio-win issue so I'll close this bug.