VirtioFS Support Page


Recommended Posts

  • 2 weeks later...
  • 3 weeks later...

Hey there, I'm trying to get this to work on an uBuntu 22.04 Server VM (Unraid Server verion 6.11.5).

 

I have the config done and I've enabled sharing in the xml.

 

Could the QEMU issue noted in this thread be why I can't seem to even get the drive working, or is there a fix in the later version of unraid?

 

My share is not visible (at all) and I can't seem to find any install scripts or any way to troubleshoot this any further.

 

any help would be great.

 

Vin

Link to comment
4 hours ago, Vinster411 said:

Hey there, I'm trying to get this to work on an uBuntu 22.04 Server VM (Unraid Server verion 6.11.5).

 

I have the config done and I've enabled sharing in the xml.

 

Could the QEMU issue noted in this thread be why I can't seem to even get the drive working, or is there a fix in the later version of unraid?

 

My share is not visible (at all) and I can't seem to find any install scripts or any way to troubleshoot this any further.

 

any help would be great.

 

Vin

Did you mount the share mount -t virtiofs mount_tag /mnt/mount/path

Link to comment
20 hours ago, SimonF said:

Did you mount the share mount -t virtiofs mount_tag /mnt/mount/path

Do I do that in unraid or in the VM?

 

In my VM settings (Form View) I have the mode set to 9P, added the share, the source path and a Mount tag.

 

I edited the XML and updated

 

<memoryBacking>
    <source type='memfd'/>
    <access mode='shared'/>
  </memoryBacking>

 

after I added the XML update (not sure how I initially missed it, I can see a VirtIO drive, but it's a size of zero bytes and errors when I open it.

 

Vin

Edited by Vinster411
Link to comment
1 hour ago, Vinster411 said:

Do I do that in unraid or in the VM?

 

In my VM settings (Form View) I have the mode set to 9P, added the share, the source path and a Mount tag.

 

I edited the XML and updated

 

<memoryBacking>
    <source type='memfd'/>
    <access mode='shared'/>
  </memoryBacking>

 

after I added the XML update (not sure how I initially missed it, I can see a VirtIO drive, but it's a size of zero bytes and errors when I open it.

 

Vin

Memory backing is only required for virtiofs. For both options you will need to mount the device for 9p it is in this format.

 

mount -t 9p -o trans=virtio [mount tag] [mount point] -oversion=9p2000.L

 

This will be inside the VM OS not on unraid.

Link to comment
  • 2 weeks later...
  • 4 weeks later...
2 hours ago, 30zal said:

Hello, I've been trying to mount multiple shared folders in my Windows 11 VM with no luck. I tried to do the following.

C:\Windows\System32>"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" start virtiofs viofsY mount_tag T:
KO launcher: error 183

 

I am not sure you can use that method if you want multiple.

 

Maybe create a batch file and run as a startup. it would be virtiofsd -m z: -t mounttagname

 

image.png

Link to comment

I made a little batch script

cd "C:\Program Files\Virtio-Win\VioFS>
virtiofs -m P: -t name1
virtiofs -m W: -t name2
virtiofs -m S: -t name3
virtiofs -m Y: -t name4

However, it just hangs at the screen below.

 

This was the guide I was originally following before asking for help here. https://github.com/virtio-win/kvm-guest-drivers-windows/wiki/Virtiofs:-Shared-file-system#multiple-virtiofs-instances

image.png

Link to comment

Well I'm chiming in at the end of all this to report that the issues still exist but oddly enough its worse on my personal server versus one I have deployed. On mine I have a VM running Blue Iris that is recording to the array (non cache) and it'll crash overnight. For the other install it almost the same setup but instead the data is offloaded to the array at intervals instead of direct recording. The second server hasn't crashed from what I've seen and its running a lot less things in general as its a customer site. For now on mine I've disabled the direct share in favor of a SMB share but will install a temp SSD to record to later to be similar to the remote site. 

 

EDIT: After checking it turns out that the remote server is also having the same issues but nowhere near as bad as my personal server. 

Edited by Coastal Custom Tech
Link to comment
On 9/2/2023 at 1:41 PM, mackid1993 said:

I scripted the setup here:

sc stop VirtioFsSvc
ping 127.0.0.1
sc config VirtioFsSvc start=demand
ping 127.0.0.1
cmd /c ""C:\Program Files (x86)\WinFsp\bin\fsreg.bat" virtiofs "C:\Program Files\Virtio-Win\VioFS\virtiofs.exe" "-t %%1 -m %%2""
echo Confirm data was properly entered into HKLM\SOFTWARE\WOW6432Node\WinFsp\Services\virtiofs
pause

 

This is the mount script I use:

 

"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" start virtiofs viofsJ tag1 J:
"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" start virtiofs viofsl tag2 l:
"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" start virtiofs viofsM tag3 m:
"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" start virtiofs viofsS tag4 s:
"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" start virtiofs viofsT tag5 T:
"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" start virtiofs viofsU tag6 U:
"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" start virtiofs viofsV tag7 V:
"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" start virtiofs viofsY tag8 Y:

 

Beware of the issues with Virtiofs currently, we are waiting for QEMU to be upgraded to 7.2 to hopefully patch a non-paged pool memory leak that causes Windows to lock up.

 

Edit: I forgot to add my unmount script for anyone that may need it:

"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" stop virtiofs viofsJ
"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" stop virtiofs viofsl
"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" stop virtiofs viofsM
"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" stop virtiofs viofsS
"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" stop virtiofs viofsT
"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" stop virtiofs viofsU
"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" stop virtiofs viofsV
"C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" stop virtiofs viofsY

 

Just save any of these into a batch file (obviously modify with your tags and preferred drive letters and run. I like to set my mount script to run as a scheduled task every hour just incase something breaks and it unmounts.

Thank you for sharing that script! I'll be able to use it on the Windows VM. :)

 

 

Link to comment
1 hour ago, 30zal said:

Thank you for sharing that script! I'll be able to use it on the Windows VM. :)

 

 

No problem. I just want to again caution against Virtiofs in Windows at this time. It's known to cause lockups. We are hoping that when Limetech decides to upgrade QEMU to 7.2 or newer it will be more stable.

 

I just recently set up a VLAN on my server and bound a secondary virtual NIC to it to keep SMB traffic between my VM and Unraid within the server and not dependent on my home network.

Link to comment
22 minutes ago, 30zal said:

So, I tried mounting my drives in an Arch VM following this guide https://blog.siglerdev.us/setup-unraidos-virtual-machine-with-virtiofs-share/ .

 

All the mount points that I put in give a "mount point does not exist" error, not sure what to do since little information seems to be available on how to set it up for Linux.

You need to create a mount point in linux. https://docs.kernel.org/filesystems/virtiofs.html

Link to comment
8 minutes ago, 30zal said:

It just gives me the following error

mount: /mnt: wrong fs type, bad option, bad superblock on myfs, missing codepage or helper program, or other error.

 

image.png

 

On Debian VM

 

image.png

 

root@computenode:~# cd /mnt/user/ecole-test/
root@computenode:/mnt/user/ecole-test# ls
test
root@computenode:/mnt/user/ecole-test# cat test
Test
root@computenode:/mnt/user/ecole-test# 
 

 

  • Thanks 1
Link to comment

The virtiofs support is working great with my ubuntu VM. I just had one small problem which I managed to solve with a workaround. Ubuntu could not automount via fstab an unraid share with the tag "media". I don't exactly know why. DMESG in the vm looked like this:

 

[   24.644594] systemd[1]: Mounting /mnt/unraid/ben...
[   24.647784] systemd[1]: Mounting /mnt/unraid/media...
[   24.669726] virtiofs virtio0: virtio_fs_setup_dax: No cache capability
[   24.679994] virtiofs virtio1: virtio_fs_setup_dax: No cache capability
[   24.685471] virtio-fs: tag </media> not found

 

I tried additional shares, and all of them worked - but not the "media" share. I tried changing the order of the shares in fstab - same result. If I ran "sudo mount -av" at a command prompt, ubuntu would mount the "media" share no problem - but never at bootup.

 

The workaround was to specify the "media" share manually in the vm config, using some other tag like "xmedia" - and suddenly ubuntu had no problem automounting the share.

 

Now if only I didn't have to resort to xml or virt-manager to add a virtual sound card to a vm in unraid...

Edited by benfishbus
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.