kvm-guest-drivers-windows
kvm-guest-drivers-windows copied to clipboard
[virtio-fs] `rm -rf`'ing a directory silently fails
Describe the bug
rm -rf
'ing a directory via Git Bash (Git for Windows) silently fails.
To Reproduce Steps to reproduce the behaviour:
-
Install & configure virtiofs:
& "C:\Program Files (x86)\WinFsp\bin\fsreg.bat" virtiofs "C:\Program Files\Virtio-Win\VioFS\virtiofs.exe" "-F NTFS -t %1 -m %2" & "C:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" start virtiofs XXXX XXXX \\.\Z:
-
Open Git Bash (
Git-2.41.0-64-bit.exe
) -
Run
cd /z mkdir -p dira/diraa mkdir -p dira/dirab touch dira/diraa/file1.txt rm -rf dira/
-
Observe
dira
and contents still existing.
Expected behavior
The directory and all contents to be rm -rf
'd.
Host:
- Disto: NixOS 23.11.20230914.f2ea252 (Tapir)
- Kernel version:
6.1.52
- QEMU version:
8.1.0
- QEMU command line:
/run/libvirt/nix-emulators/qemu-system-x86_64 -name guest=win10work,debug-threads=on -S -object {"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain-1-win10work/master-key.aes"} -blockdev {"driver":"file","filename":"/run/libvirt/nix-ovmf/OVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"} -blockdev {"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/win10work_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"} -machine pc-q35-6.0,usb=off,vmport=off,dump-guest-core=off,memory-backend=pc.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,hpet=off,acpi=on -accel kvm -cpu host,migratable=on,hv-time=on,hv-passthrough=on -m size=32837632k -object {"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":33625735168} -overcommit mem-lock=off -smp 6,sockets=1,dies=1,cores=3,threads=2 -uuid 42a2cc75-f59c-4bdb-aae4-81b3929211d7 -smbios type=0,vendor=Dell Inc.,version=1.14.0,date=02/13/2020,release=1.14 -smbios type=1,manufacturer=Dell Inc.,product=XPS 15 9550,serial=XXXXXXX,uuid=42a2cc75-f59c-4bdb-aae4-81b3929211d7,sku=06E4,family=XPS -smbios type=2,manufacturer=Dell Inc.,product=0N7TVV,version=A01,serial=/XXXXXXX/XXXXXXXXXXXXXX/ -smbios type=3,manufacturer=Dell Inc.,serial=XXXXXXX,sku=Laptop -no-user-config -nodefaults -chardev socket,id=charmonitor,fd=32,server=on,wait=off -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime,driftfix=slew -global kvm-pit.lost_tick_policy=delay -no-shutdown -global ICH9-LPC.disable_s3=1 -global ICH9-LPC.disable_s4=1 -boot menu=off,strict=on -device {"driver":"pcie-root-port","port":16,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x2"} -device {"driver":"pcie-root-port","port":17,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x2.0x1"} -device {"driver":"pcie-root-port","port":18,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x2.0x2"} -device {"driver":"pcie-root-port","port":19,"chassis":4,"id":"pci.4","bus":"pcie.0","addr":"0x2.0x3"} -device {"driver":"pcie-root-port","port":20,"chassis":5,"id":"pci.5","bus":"pcie.0","addr":"0x2.0x4"} -device {"driver":"pcie-root-port","port":21,"chassis":6,"id":"pci.6","bus":"pcie.0","addr":"0x2.0x5"} -device {"driver":"pcie-pci-bridge","id":"pci.7","bus":"pci.5","addr":"0x0"} -device {"driver":"pcie-root-port","port":8,"chassis":8,"id":"pci.8","bus":"pcie.0","multifunction":true,"addr":"0x1"} -device {"driver":"pcie-root-port","port":9,"chassis":9,"id":"pci.9","bus":"pcie.0","addr":"0x1.0x1"} -device {"driver":"pcie-root-port","port":10,"chassis":10,"id":"pci.10","bus":"pcie.0","addr":"0x1.0x2"} -device {"driver":"qemu-xhci","p2":15,"p3":15,"id":"usb","bus":"pci.2","addr":"0x0"} -device {"driver":"virtio-serial-pci","id":"virtio-serial0","bus":"pci.3","addr":"0x0"} -device {"driver":"ide-cd","bus":"ide.1","id":"sata0-0-1","bootindex":1} -blockdev {"driver":"file","filename":"/var/lib/libvirt/images/win10work.qcow2","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-1-format","read-only":false,"discard":"unmap","driver":"qcow2","file":"libvirt-1-storage","backing":null} -device {"driver":"virtio-blk-pci","bus":"pci.6","addr":"0x0","drive":"libvirt-1-format","id":"virtio-disk0","bootindex":2} -chardev socket,id=chr-vu-fs0,path=/var/lib/libvirt/qemu/domain-1-win10work/fs0-fs.sock -device {"driver":"vhost-user-fs-pci","id":"fs0","chardev":"chr-vu-fs0","tag":"XXXX","bus":"pci.8","addr":"0x0"} -netdev {"type":"tap","fd":"33","vhost":true,"vhostfd":"35","id":"hostnet0"} -device {"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:1a:9d:dc","bus":"pci.1","addr":"0x0"} -chardev pty,id=charserial0 -device {"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0} -chardev spicevmc,id=charchannel0,name=vdagent -device {"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"com.redhat.spice.0"} -device {"driver":"usb-kbd","id":"input2","bus":"usb.0","port":"1"} -audiodev {"id":"audio1","driver":"spice"} -spice port=5900,addr=127.0.0.1,disable-ticketing=on,image-compression=off,seamless-migration=on -device {"driver":"ich9-intel-hda","id":"sound0","bus":"pcie.0","addr":"0x1b"} -device {"driver":"hda-duplex","id":"sound0-codec0","bus":"sound0.0","cad":0,"audiodev":"audio1"} -global ICH9-LPC.noreboot=off -watchdog-action reset -chardev spicevmc,id=charredir0,name=usbredir -device {"driver":"usb-redir","chardev":"charredir0","id":"redir0","bus":"usb.0","port":"2"} -chardev spicevmc,id=charredir1,name=usbredir -device {"driver":"usb-redir","chardev":"charredir1","id":"redir1","bus":"usb.0","port":"3"} -device {"driver":"vfio-pci","id":"hostdev0","sysfsdev":"/sys/bus/mdev/devices/6f33cc3d-6923-4711-b795-795e12455c72","display":"off","bus":"pci.10","addr":"0x0"} -device {"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.4","addr":"0x0"} -acpitable file=/data/vfiotest/SSDT1.dat -acpitable file=/data/vfiotest/msdm.bin -acpitable file=/data/vfiotest/slic.bin -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -object {"qom-type":"memory-backend-file","id":"shmmem-shmem0","mem-path":"/dev/shm/looking-glass","size":33554432,"share":true} -device {"driver":"ivshmem-plain","id":"shmem0","memdev":"shmmem-shmem0","bus":"pci.7","addr":"0x1"} -msg timestamp=on
- libvirt version:
9.7.0
- libvirt XML file:
<domain type='kvm' id='1' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> <name>win10work</name> <uuid>42a2cc75-f59c-4bdb-aae4-81b3929211d7</uuid> <metadata> <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> <libosinfo:os id="http://microsoft.com/win/10"/> </libosinfo:libosinfo> </metadata> <memory unit='KiB'>32837632</memory> <currentMemory unit='KiB'>4194304</currentMemory> <memoryBacking> <source type='memfd'/> <access mode='shared'/> </memoryBacking> <vcpu placement='static'>6</vcpu> <resource> <partition>/machine</partition> </resource> <sysinfo type='smbios'> <bios> <entry name='vendor'>Dell Inc.</entry> <entry name='version'>1.14.0</entry> <entry name='date'>02/13/2020</entry> <entry name='release'>1.14</entry> </bios> <system> <entry name='manufacturer'>Dell Inc.</entry> <entry name='product'>XPS 15 9550</entry> <entry name='serial'>XXXXXXX</entry> <entry name='uuid'>42a2cc75-f59c-4bdb-aae4-81b3929211d7</entry> <entry name='sku'>06E4</entry> <entry name='family'>XPS</entry> </system> <baseBoard> <entry name='manufacturer'>Dell Inc.</entry> <entry name='product'>0N7TVV</entry> <entry name='version'>A01</entry> <entry name='serial'>/XXXXXXX/XXXXXXXXXXXXXX/</entry> </baseBoard> <chassis> <entry name='manufacturer'>Dell Inc.</entry> <entry name='serial'>XXXXXXX</entry> <entry name='sku'>Laptop</entry> </chassis> </sysinfo> <os> <type arch='x86_64' machine='pc-q35-6.0'>hvm</type> <loader readonly='yes' type='pflash'>/run/libvirt/nix-ovmf/OVMF_CODE.fd</loader> <nvram template='/run/libvirt/nix-ovmf/OVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/win10work_VARS.fd</nvram> <bootmenu enable='no'/> <smbios mode='sysinfo'/> </os> <features> <acpi/> <apic/> <hyperv mode='passthrough'> </hyperv> <vmport state='off'/> </features> <cpu mode='host-passthrough' check='none' migratable='on'> <topology sockets='1' dies='1' cores='3' threads='2'/> </cpu> <clock offset='localtime'> <timer name='rtc' tickpolicy='catchup'/> <timer name='pit' tickpolicy='delay'/> <timer name='hpet' present='no'/> <timer name='hypervclock' present='yes'/> </clock> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>destroy</on_crash> <pm> <suspend-to-mem enabled='no'/> <suspend-to-disk enabled='no'/> </pm> <devices> <emulator>/run/libvirt/nix-emulators/qemu-system-x86_64</emulator> <disk type='file' device='cdrom'> <driver name='qemu'/> <target dev='sdb' bus='sata'/> <readonly/> <boot order='1'/> <alias name='sata0-0-1'/> <address type='drive' controller='0' bus='0' target='0' unit='1'/> </disk> <disk type='file' device='disk'> <driver name='qemu' type='qcow2' discard='unmap'/> <source file='/var/lib/libvirt/images/win10work.qcow2' index='1'/> <backingStore/> <target dev='vda' bus='virtio'/> <boot order='2'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/> </disk> <controller type='usb' index='0' model='qemu-xhci' ports='15'> <alias name='usb'/> <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> </controller> <controller type='sata' index='0'> <alias name='ide'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> </controller> <controller type='pci' index='0' model='pcie-root'> <alias name='pcie.0'/> </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x10'/> <alias name='pci.1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/> </controller> <controller type='pci' index='2' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='2' port='0x11'/> <alias name='pci.2'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/> </controller> <controller type='pci' index='3' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='3' port='0x12'/> <alias name='pci.3'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/> </controller> <controller type='pci' index='4' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='4' port='0x13'/> <alias name='pci.4'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/> </controller> <controller type='pci' index='5' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='5' port='0x14'/> <alias name='pci.5'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/> </controller> <controller type='pci' index='6' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='6' port='0x15'/> <alias name='pci.6'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/> </controller> <controller type='pci' index='7' model='pcie-to-pci-bridge'> <model name='pcie-pci-bridge'/> <alias name='pci.7'/> <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/> </controller> <controller type='pci' index='8' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='8' port='0x8'/> <alias name='pci.8'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/> </controller> <controller type='pci' index='9' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='9' port='0x9'/> <alias name='pci.9'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <controller type='pci' index='10' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='10' port='0xa'/> <alias name='pci.10'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> <controller type='virtio-serial' index='0'> <alias name='virtio-serial0'/> <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> </controller> <filesystem type='mount' accessmode='passthrough'> <driver type='virtiofs'/> <binary path='/run/current-system/sw/bin/virtiofsd'/> <source dir='/some/special/directory'/> <target dir='XXXX'/> <alias name='fs0'/> <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/> </filesystem> <interface type='network'> <mac address='52:54:00:1a:9d:dc'/> <source network='default' portid='39ff3b27-fed4-460d-8927-bbf2f811da6e' bridge='virbr0'/> <target dev='vnet0'/> <model type='virtio'/> <link state='up'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </interface> <serial type='pty'> <source path='/dev/pts/1'/> <target type='isa-serial' port='0'> <model name='isa-serial'/> </target> <alias name='serial0'/> </serial> <console type='pty' tty='/dev/pts/1'> <source path='/dev/pts/1'/> <target type='serial' port='0'/> <alias name='serial0'/> </console> <channel type='spicevmc'> <target type='virtio' name='com.redhat.spice.0' state='connected'/> <alias name='channel0'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> <input type='mouse' bus='ps2'> <alias name='input0'/> </input> <input type='keyboard' bus='ps2'> <alias name='input1'/> </input> <input type='keyboard' bus='usb'> <alias name='input2'/> <address type='usb' bus='0' port='1'/> </input> <graphics type='spice' port='5900' autoport='yes' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> <image compression='off'/> </graphics> <sound model='ich9'> <alias name='sound0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/> </sound> <audio id='1' type='spice'/> <video> <model type='none'/> <alias name='video0'/> </video> <hostdev mode='subsystem' type='mdev' managed='yes' model='vfio-pci' display='off' ramfb='off'> <source> <address uuid='6f33cc3d-6923-4711-b795-795e12455c72'/> </source> <alias name='hostdev0'/> <address type='pci' domain='0x0000' bus='0x0a' slot='0x00' function='0x0'/> </hostdev> <redirdev bus='usb' type='spicevmc'> <alias name='redir0'/> <address type='usb' bus='0' port='2'/> </redirdev> <redirdev bus='usb' type='spicevmc'> <alias name='redir1'/> <address type='usb' bus='0' port='3'/> </redirdev> <watchdog model='itco' action='reset'> <alias name='watchdog0'/> </watchdog> <memballoon model='virtio'> <alias name='balloon0'/> <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> </memballoon> <shmem name='looking-glass'> <model type='ivshmem-plain'/> <size unit='M'>32</size> <alias name='shmem0'/> <address type='pci' domain='0x0000' bus='0x07' slot='0x01' function='0x0'/> </shmem> </devices> <seclabel type='dynamic' model='dac' relabel='yes'> <label>+301:+301</label> <imagelabel>+301:+301</imagelabel> </seclabel> <qemu:commandline> <qemu:arg value='-acpitable'/> <qemu:arg value='file=/data/vfiotest/SSDT1.dat'/> <qemu:arg value='-acpitable'/> <qemu:arg value='file=/data/vfiotest/msdm.bin'/> <qemu:arg value='-acpitable'/> <qemu:arg value='file=/data/vfiotest/slic.bin'/> </qemu:commandline> </domain>
VM:
-
Microsoft Windows [Version 10.0.19045.3448]
-
virtio-fs
- Version included in
virtio-win-0.1.240.iso
,07/21/2023,100.93.104.24000
in the INF
Additional context:
Zane@DESKTOP-9I31DUC MINGW64 /z
$ mkdir -p dira/diraa
Zane@DESKTOP-9I31DUC MINGW64 /z
$ mkdir -p dira/dirab
Zane@DESKTOP-9I31DUC MINGW64 /z
$ touch dira/diraa/file1.txt
Zane@DESKTOP-9I31DUC MINGW64 /z
$ rm -rf dira/
Zane@DESKTOP-9I31DUC MINGW64 /z
$ stat dira
File: dira
Size: 0 Blocks: 12 IO Block: 65536 directory
Device: 4ff35ba0h/1341348768d Inode: 8569920397848429488 Links: 1
Access: (0755/drwxr-xr-x) Uid: (197609/ Zane) Gid: (197121/ UNKNOWN)
Access: 2023-09-22 16:51:47.589998000 +1000
Modify: 2023-09-22 16:51:50.859078400 +1000
Change: 2023-09-22 16:51:50.859078400 +1000
Birth: 2023-09-22 16:51:50.859078400 +1000
Zane@DESKTOP-9I31DUC MINGW64 /z
$ rm -rf dira/
Zane@DESKTOP-9I31DUC MINGW64 /z
$ echo $?
0
Zane@DESKTOP-9I31DUC MINGW64 /z
$ stat dira
File: dira
Size: 0 Blocks: 12 IO Block: 65536 directory
Device: 4ff35ba0h/1341348768d Inode: 8569920397848429488 Links: 1
Access: (0755/drwxr-xr-x) Uid: (197609/ Zane) Gid: (197121/ UNKNOWN)
Access: 2023-09-22 16:51:47.589998000 +1000
Modify: 2023-09-22 16:51:50.859078400 +1000
Change: 2023-09-22 16:51:50.859078400 +1000
Birth: 2023-09-22 16:51:50.859078400 +1000
Forgot to add, the directory can be deleted via Explorer, and rm -rf
'ing in Git Bash works on a non-virtiofs drive.
virtiofsd version, please
Can't reproduce with Git Bash 2.33.1.1
virtiofsd version, please
There's no version info in the resources, and no --version
flag or equivalent that I can find.
Not sure if it helps:
Name: virtiofs.exe
Size: 231432 bytes (226 KiB)
CRC32: FF185EB9
CRC64: EFD9407467CAD562
SHA256: 96e37085ac1f039bf1827ff017686f903426785aff7f13e9a5e22276aaf91d62
SHA1: 865d36610711f9f92bb55a1903d9b6f10a61eeed
BLAKE2sp: 6d53bda222650adf00de868df87dcfe17293e273809efd1b298867f0bc95b1c6
This is in virtio-win-0.1.240.iso
from here.
Name: virtio-win-0.1.240.iso
Size: 627519488 bytes (598 MiB)
CRC32: 537F31A0
CRC64: EBA9E44F8E31BEA8
SHA256: ebd48258668f7f78e026ed276c28a9d19d83e020ffa080ad69910dc86bbcbcc6
SHA1: fc7522b0079f2d1563e5658deabd6dbed04d641c
BLAKE2sp: b74fe3d57ecf03efc59b04a78c8533bc3b2b8d1b4557ecffd4cab46e005f02b8
Can't reproduce with Git Bash 2.33.1.1
Here's a log from when I hit <ENTER> on the rm -rf
. The command used was:
& "C:\Program Files\Virtio-Win\VioFS\virtiofs.exe" -d -1 -D - -F NTFS -t XXXX -m \\.\Z:
Virtiofsd is the host daemon
Virtiofsd is the host daemon
Oh derp, my bad:
$ virtiofsd --version
virtiofsd 1.8.0
The exact revision is the v1.8.0
tag from Git:
nix-repl> nixosConfigurations.MORNINGSTAR.pkgs.virtiofsd.src.gitRepoUrl
"https://gitlab.com/virtio-fs/virtiofsd.git"
nix-repl> nixosConfigurations.MORNINGSTAR.pkgs.virtiofsd.src.rev
"v1.8.0"
I can reproduce this issue with Git-2.42.0.2-64-bit.exe @viktor-prutyanov I'll report an internal bug and let you know it.
This issue seems gone with the following pkgs.
virtio-win-prewhql-0.1-247 virtiofsd-1.7.2-1.el9.x86_64 qemu-kvm-8.2.0-2.el9.x86_64 host kernel: 5.14.0-408.el9.x86_6 guest: win11 23h2 Git-2.43.0-64-bit.exe/Git-2.35.3-64-bit.exe
A screeshot of the result
Since I filed this issue, my host has updated, but the VM remains untouched and the problem remains. Host:
$ virtiofsd --version
virtiofsd 1.10.1
$ nix repl
Welcome to Nix 2.18.1. Type :? for help.
nix-repl> :lf .
Added 18 variables.
nix-repl> nixosConfigurations.MORNINGSTAR.pkgs.virtiofsd.src.gitRepoUrl
"https://gitlab.com/virtio-fs/virtiofsd.git"
nix-repl> nixosConfigurations.MORNINGSTAR.pkgs.virtiofsd.src.rev
"v1.10.1"
nix-repl>
$ uname -srv
Linux 6.6.14 #1-NixOS SMP PREEMPT_DYNAMIC Thu Jan 25 23:36:01 UTC 2024
Are there binaries of the updated drivers somewhere I could download? I'm not set up to build them currently.
I'm reluctant to update anything else on the host as this specific software combination is a good reproducer.