Attach cdrom to an AppVM

I’m having similar trouble to the following topic to attach a cdrom to an AppVM and could not find how to solve it.

Qvm-block attach vmname source:loopdevice_for_iso -o devtype=cdrom

I tried to attach the cdrom using the following command in dom0 as indicated in the docs:

qvm-block attach media sys-usb:sr0 -o devtype=cdrom
Got empty response from qubesd. See journalctl in dom0 for details.

The result is the same using root access or not. These are the results in journalctl:

Jun 04 23:38:12 dom0 libvirtd[3410]: internal error: No device with bus 'xen' and target 'xvdi'
Jun 04 23:38:12 dom0 qubesd[3860]: unhandled exception while calling src=b'dom0' meth=b'admin.vm.device.block.Attac>
Jun 04 23:38:12 dom0 qubesd[3860]: Traceback (most recent call last):
Jun 04 23:38:12 dom0 qubesd[3860]:   File "/usr/lib/python3.8/site-packages/qubes/api/__init__.py", line 288, in re>
Jun 04 23:38:12 dom0 qubesd[3860]:     response = await self.mgmt.execute(
Jun 04 23:38:12 dom0 qubesd[3860]:   File "/usr/lib/python3.8/site-packages/qubes/api/admin.py", line 1318, in vm_d>
Jun 04 23:38:12 dom0 qubesd[3860]:     await self.dest.devices[devclass].attach(assignment)
Jun 04 23:38:12 dom0 qubesd[3860]:   File "/usr/lib/python3.8/site-packages/qubes/devices.py", line 249, in attach
Jun 04 23:38:12 dom0 qubesd[3860]:     await self._vm.fire_event_async('device-pre-attach:' + self._bus,
Jun 04 23:38:12 dom0 qubesd[3860]:   File "/usr/lib/python3.8/site-packages/qubes/events.py", line 227, in fire_eve>
Jun 04 23:38:12 dom0 qubesd[3860]:     sync_effects, async_effects = self._fire_event(event,
Jun 04 23:38:12 dom0 qubesd[3860]:   File "/usr/lib/python3.8/site-packages/qubes/events.py", line 164, in _fire_ev>
Jun 04 23:38:12 dom0 qubesd[3860]:     effect = func(self, event, **kwargs)
Jun 04 23:38:12 dom0 qubesd[3860]:   File "/usr/lib/python3.8/site-packages/qubes/ext/block.py", line 282, in on_de>
Jun 04 23:38:12 dom0 qubesd[3860]:     vm.libvirt_domain.attachDevice(
Jun 04 23:38:12 dom0 qubesd[3860]:   File "/usr/lib/python3.8/site-packages/qubes/app.py", line 103, in wrapper
Jun 04 23:38:12 dom0 qubesd[3860]:     return attr(*args, **kwargs)
Jun 04 23:38:12 dom0 qubesd[3860]:   File "/usr/lib64/python3.8/site-packages/libvirt.py", line 606, in attachDevice
Jun 04 23:38:12 dom0 qubesd[3860]:     if ret == -1: raise libvirtError ('virDomainAttachDevice() failed', dom=self)
Jun 04 23:38:12 dom0 qubesd[3860]: libvirt.libvirtError: internal error: No device with bus 'xen' and target 'xvdi'
Jun 04 23:38:12 dom0 qrexec-policy-daemon[3866]: qrexec: admin.vm.device.block.Available+: sys-usb -> sys-usb: allo>
Jun 04 23:38:12 dom0 qrexec-policy-daemon[3866]: qrexec: admin.vm.device.block.Available: sys-usb -> sys-usb: denie>

I have also tried to attach the device using the device widget and this also does not work. In that case, the /dev/xvdi device appears in the target AppVM, but I can’t mount it (got Buffer I/O error in dmesg when trying to mount).

Does anybody know how to advance?
Thanks.

This wiki article hasn’t been updated in years, but may be helpful.

https://wiki.xenproject.org/wiki/CD_Rom_Support_in_Xen