I wanted to install a Linux distro inside a disk image located in dom0 home, using QEMU in an AppVM.
I've created a new disk image in dom0, set it up (dos partition label and a primary ext4 partition) and attached it with `kpartx` to loopX, but `qvm-block` doesn't list it in the exposed block devices.
So, in order to understand better how Qubes handles this, I've tried to do the same in a VM and see if the dom0 would catch the event, but nothing.
Strangely, when I detached the disk image, both the 'AppVM:loopX - IMG_PATH is available' and 'AppVM:loopX - IMG_PATH is removed' notifications appeared on the screen.
I've read a lot about it, but I think what I found was all related to a < R4.0 version, so I don't know if this issue is related to a intended design or a bug.
Procedure:
[user@dom0 ~]$ dd if=/dev/zero of=/home/user/table.raw bs=2048 count=1
[user@dom0 ~]$ dd if=/dev/zero of=/home/user/root.raw bs=3GB count=1
[user@dom0 ~]$ mkfs.ext4 /home/user/root.raw
[user@dom0 ~]$ cat /home/user/{table,root}.raw > /home/user/root.img
[user@dom0 ~]$ rm /home/user/{table,root}.raw
[user@dom0 ~]$ truncate -s 3GB /home/user/root.img
[user@dom0 ~]$ fdisk /home/user/root.img
o new DOS partition table
n new partition
p primary
1 first
2048 first sector
\n to the end
[user@dom0 ~] fdisk -l /home/user/root.img
Disk /home/user/root.img: 2.8 GiB, 3000000000 bytes, 5859375 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xda159b44
Device Boot Start End Sectors Size Id Type
root.img1 2048 5859374 5857327 2.8G 83 Linux
[user@dom0 ~] sudo kpartx -a /home/user/root.img
[user@dom0 ~] losetup -l
NAME SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE DIO
/dev/loop40 0 0 0 0 /home/user/root.img
0
[user@dom0 ~] ls /dev/mapper
control loop40p1 ...
I've checked with `udevadm info -q all` and I've noticed loop devices don't have the 'QUBES_EXPOSED' property.
Can you try to reproduce my situation and show me your `udevadm` output for your loop device?
Thanks a lot.