0

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?

aaronk6
  • 284
  • 1
  • 11

1 Answers1

-1

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.