Score:0

Why is virt-install failing with “Read-only file system” when specifying initrd on a locally mounted ISO?

co flag

I’m using virt-install to create an Ubuntu machine using the official Ubuntu server live ISO. This command has been working in the past, but stopped working at some point (maybe after upgrading the host OS from Ubuntu 18.04 to 20.04, but I’m not sure).

$ mkdir image-builder-68692987-installer
$ mount ubuntu-21.10-live-server-amd64.iso image-builder-68692987-installer
$ virt-install --name image-builder-68692987 \
    --noreboot --os-variant ubuntu20.04 \
    --disk gitlab-runner-ubuntu-base.qcow2 \
    --disk image-builder-68692987-seed.iso \
    --cdrom ubuntu-21.10-live-server-amd64.iso \
    --boot 'kernel=/var/lib/libvirt/images/gitlab-runner/image-builder-68692987-installer/casper/vmlinuz,initrd=/var/lib/libvirt/images/gitlab-runner/image-builder-68692987-installer/casper/initrd,kernel_args=autoinstall console=ttyS0' \
    --vcpus=4 \
    --ram=4096 \
    --network default \
    --graphics none

Output:

WARNING  CDROM media does not print to the text console by default, so you likely will not see text install output. You might want to use --location. See the man page for examples of using --location with CDROM media

Starting install...
ERROR    internal error: child reported (status=125): unable to open 
  /var/lib/libvirt/images/gitlab-runner/image-builder-68692987-installer/casper/initrd: 
  Read-only file system
Domain installation does not appear to have been successful.

So for some reason, it is complaining that initrd is on a read-only filesystem. This is obviously true, since it’s pointing to the Ubuntu ISO which is mounted via a loopback device—but why does it think it needs write access?

Score:-1
de flag

to install something you have to write it out, if you are live booting, make sure you are installing to ramdisk instead. However if you've mounted an ISO as a folder like what seems to be your case, ISO are read only. If you want to add to an ISO image, you have to rebuild the image to add the new file.

co flag
Hey, not sure if I understand. My question was why initrd needs to be on a writeable volume.
de flag
it doesnt need to, only if you want add things to start at boot or at boot level environment
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.