Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtiofs not working (VirtioFsSvc can't be started on guest) #979

Closed
yjzzjy4 opened this issue Sep 2, 2023 · 3 comments
Closed

Virtiofs not working (VirtioFsSvc can't be started on guest) #979

yjzzjy4 opened this issue Sep 2, 2023 · 3 comments
Assignees

Comments

@yjzzjy4
Copy link

yjzzjy4 commented Sep 2, 2023

Describe the bug
VirtioFsSvc in windows guest cannot be started.

I set up a windows guest and tried to enable shared filesystem according to Wiki-Virtiofs but with no luck. The VirtioFsSvc just can't be started no matter what setup approach I tried: installer setup or manual setup. The registry items should be correct as I double checked them.

All related screenshots and config info are listed below, please tell me what I did wrong.

What did I do to debug
I turned the debug flags on (-1) and set up the debug log file in registry, and then start VirtioFsSvc manually. Every time I did that 2 lines were appended to the log:

*** VirtFsFuseRequest: >>req: 26 unique: 2 len: 56
*** VirtFsFuseRequest: <<len: 16 error: -22 unique: 2

I can't really tell what those meant. But I'm not first-time user of virtiofs, I've done that on a PC, it is running like a charm and I'm using it every day. Since it is not working on my laptop (Ubuntu 22.04), and that PC runs the same OS with my laptop, so I managed to keep these two devices running on the same kernel version: 5.19.17-051917-generic (before that my laptop runs on 6.2.0-32-generic), but still no luck. My laptop's guest just can't start VirtioFsSvc while my PC can.

The final thing I tried was simply copy-paste the vm files into my PC and use virsh to import the xml. Guess what? Without any modification, it just works on my PC! But it is not working on my laptop!

The kernel, OS and even the vm are the same, the only difference is that my laptop is running on AMD Ryzen 7 4800U and my PC is running on Intel i9-12900T. But how does this affect virtiofs? After googling I've never seen any platform related bugs with virtiofs. Is there anyting else I can do to figure it out?

To Reproduce
Steps to reproduce the behaviour: I don't know.

Expected behavior
VirtioFsSvc should start automatically on guest.

Screenshots
Guest on my laptop:

image

Same guest on my PC (the error logs on top was written when guest being on my laptop):

image

As we can see, clearly it is working on my PC instead of my laptop. No joking, I do copy-paste the vm from laptop to PC, here is the screenshot of virt-manager:

image

Host:

  • Disto: Ubuntu 22.04
  • Kernel version: 6.2.0-32-generic / 5.19.17-051917-generic
  • QEMU version: 6.2.0
  • QEMU command line
  • libvirt version: 8.0.0
  • libvirt XML file:
...
<memoryBacking>
  <source type="memfd"/>
  <access mode="shared"/>
</memoryBacking>
...
<filesystem type="mount" accessmode="passthrough">
  <driver type="virtiofs" queue="1024"/>
  <binary path="/usr/lib/qemu/virtiofsd"/>
  <source dir="/mnt/vmshare-test"/>
  <target dir="vmshare"/>
  <address type="pci" domain="0x0000" bus="0x06" slot="0x00" function="0x0"/>
</filesystem>
...

VM:

  • Windows version: Windows 10 22H2
  • Which driver has a problem: Virtiofs
  • Driver version or commit hash that was used to build the driver: virtio-win-0.1.229 and winfsp-2.0.23075

Additional context
Null.

@viktor-prutyanov
Copy link
Collaborator

Hi @yjzzjy4

Could you please try WinFsp 1.12.22339 and Rust virtiofsd (not from QEMU) ?

@yjzzjy4
Copy link
Author

yjzzjy4 commented Sep 2, 2023

Hi @yjzzjy4

Could you please try WinFsp 1.12.22339 and Rust virtiofsd (not from QEMU) ?

Really appreciate your help! @viktor-prutyanov
I downloaded the CI-built binary of Rust virtiofsd and just did a simple backup-replace op:

sudo mv /usr/lib/qemu/virtiofsd /usr/lib/qemu/virtiofsd.bak
sudo mv virtiofsd /usr/lib/qemu/

Then I started vm from virt-manager and it is working on my laptop! And it works with both WinFsp 1.12.22339 and WinFsp 2.0.23075. Guess I'll stick to the Rust virtiofsd afterwards.

You really saved the day!

Best regards,
yjzzjy4.

@MannyC
Copy link

MannyC commented Sep 5, 2023

FYI this was likely caused by a bug introduced in Ubuntu's version 1:6.2+dfsg-2ubuntu6.13

https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/2033957

The other workaround is to downgrade the upgraded qemu- packages to 1:6.2+dfsg-2ubuntu6.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants