btrfs icon indicating copy to clipboard operation
btrfs copied to clipboard

Using within KVM

Open apss-pohl opened this issue 2 years ago • 3 comments

I`d like to use a BTRFS partition as a shared storage between my host (Ubuntu) and VM (W11). Therefore i did a raw disk passthrough:

<disk type="block" device="disk">
  <driver name="qemu" type="raw" cache="none" io="native" discard="unmap"/>
  <source dev="/dev/disk/by-partuuid/2a571eb7-7c27-4ab1-a012-1257c9009b1d" index="2"/>
  <backingStore/>
  <target dev="vdc" bus="virtio"/>
  <alias name="virtio-disk2"/>
  <address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0"/>
</disk>

And installed WinBTRFS using choco. I added the upgradbale regkey and the regekey for the mappings. Also set the autodicover flag. I do see the disk in the manager: image

And i have the BTRFS controller: image

But i cant mount the device. What am i missing?

apss-pohl avatar Jul 05 '23 12:07 apss-pohl

If you use the same setup to boot Linux instead, does it work? I don't know much about libvirt, which I assume that XML is from, so I can't tell you if there's a problem with your config file.

maharmstone avatar Jul 06 '23 22:07 maharmstone

I do passthrough a second disk the same way, but it is a NTFS partition. This is recognized and working by the VM. Should the BTRFS driver appear here? image

apss-pohl avatar Jul 07 '23 06:07 apss-pohl

Hi, you cannot pass through a partition like that using KVM, doing it like that will make the VM treat the partition as a disk instead of as a partition, you would have to pass through the entire disk or format the partition to make a nested disk, if you want to pass through a single partition then the best option is Filesystem Pass through, which is a bit more complicated, you can find a tutorial here https://www.debugpoint.com/kvm-share-folder-windows-guest/#A_note_about_virtiofs or just pass through the entire disk

Snivine avatar Sep 06 '23 04:09 Snivine