Subject: Re: bug#35584: CDs and DVDs aren't auto-mounted

From: Maxim Cournoyer <[email-masked]>
Date: Mon, 24 Mar 2025 09:34:48 +0900

Hi,

Luis Felipe <[email-masked]> writes:

> Hi, Danny.
>
>>     In order to debug this problem, please try setting the environment variable
>>     before starting nautilus, like this:
>>
>>     killall nautilus
>>     export LIBMOUNT_FSTAB=/etc/fstab
>>     nautilus
>>
>>     Then check whether detecting changes in CD/DVD state work fine like this.
>>
>
> Unfortunately not. I got this:
>
> $ killall nautilus
> nautilus: no process found
>
> So I closed any visible instance of Nautilus instead, exported the
> LIBMOUNT_FSTAB variable, started nautilus, inserted a DVD, and it
> didn't work.

4 years later, the problem persists!

Here's how I've been trying to debug it further:

1. Generate a VM image of our GNOME desktop template:
./pre-inst-env guix system image --image-type=efi-raw
gnu/system/examples/desktop.tmpl

(note that to boot it you'll have to select the EFI firmware, and you'll
probably want bug#77110 applied to make this easier)

2. Copy it somewhere, e.g. /tmp/guix-gnome-desktop.raw
3. Make it writable: chmod +w /tmp/guix-home-desktop.raw
4. Install a new VM from this image in virt-manager.  In my case I've
named it 'guix-gnome-desktop'.   Make sure to turn
on 3D acceleration by selecting the virtio driver for the video device,
checking '3D acceleration' (otherwise, virtualized GNOME is barely
usable and frequently hangs for long bouts of time)
5. Add a CDROM storage device (SATA) via the virt-manager GUI
6. Start the VM, the fun can start!
7. Find the path to the CDROM drive via:

--8<---------------cut here---------------start------------->8---
virsh -c qemu:///system domblklist guix-gnome-desktop
 Target  Source
--------------------------------------
 vda     /tmp/guix-gnome-desktop.raw
 sda     -
--8<---------------cut here---------------end--------------->8---

As you can see the device name of the CDROM in my case is 'sda'.  That
can also be seen in the XML of the device in the virt-manager GUI.

We'll now insert a virtual CDROM via virsh:

--8<---------------cut here---------------start------------->8---
virsh -c qemu:///system change-media guix-gnome-desktop sda \
  --inject path/to/your-sample.iso
--8<---------------cut here---------------end--------------->8---

To eject:

--8<---------------cut here---------------start------------->8---
virsh -c qemu:///system change-media guix-gnome-desktop sda --eject
--8<---------------cut here---------------end--------------->8---

We can now debug this issue efficiently and without having an actual
CDROM drive.  Except that currently 'udevadm monitor' doesn't seem to
print anything.  Hm.  Perhaps that's part of the problem?  Or my
expectations of udevadm are wrong.

-- 
Thanks,
Maxim