Cannot attach dm-1 in one VM to another VM

I attach a LUKS device to drives-vm. It contains 2 partitions, dm-1 and dm-2. I’m trying to attach dm-1 to node-vm.

I tried from the systray and also from dom0. It doesn’t give me any error, but node-vm doesn’t create /dev/xvdi. It just fails silently.

It throws an error in journalctl in dom0 when detaching dm-1 saying it doesn’t find /dev/xvdi.

This used to work fine on Qubes OS 4.1.

Try to create test loopback device in drives-vm and attach it to node-vm.
In drives-vm:

dd if=/dev/zero of=tmp.img bs=1M count=100
sudo losetup -fP --show tmp.img

And attach this block device from drives-vm to node-vm.
If it’ll work then try the same for loopback device created from dm-1 in drives-vm:

sudo losetup -fP --show /dev/mapper/dm-1

Thanks for the help and sorry for the belated reply.

I have a clue of what is happening.

I have two templates template-debian and template-kicksecure. If I create to disposable VMs of template-debian, I can attach the device from one to another. But if the VM where I create the test loopback device is of template-kicksecure, then /dev/xvdi will not show up after attaching the test loopback device.

I don’t think it’s a problem with Kicksecure. I’ve probably installed or uninstalled something that I shouldn’t have. Maybe there’s some Qubes-specific package I’m missing.

What can it be?

You can try to recreate a new clean kicksecure template by following the official guide without your custom modifications and check block device attachment there.