Problems installing with virt-install on centos 6 host

I know CentOS 6 is EOL and not supported; what I’m trying to do is automate the deployment of Rocky8 on this machine and migrate functions from the host to a VM to make it easier to upgrade the host with minimal impact.

The problem I’m hitting is easily shown…

virt-install --noreboot -n test8 -r 3073 '--vcpus=1' '--os-variant=rhel7' --accelerate -v '--network=bridge=br0,target=v-test8' --disk path=/dev/Raid10/vm.test8 --location /OS_ISO_images/Rocky-8.4-x86_64-minimal.iso --nographics --initrd-inject=/RedHat/kickstart/rocky8.cfg --extra-args "inst.ks=file:/rocky8.cfg console=tty0 console=ttyS0,115200n8"

I’ve used the minimal.iso and the full dvd1.iso. And the build aborts before it even starts

Starting install...
Retrieving file .treeinfo...                             | 2.9 kB     00:00 ...
ERROR    No option 'boot.iso' in section: 'images-x86_64'
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect qemu:///system start test8
otherwise, please restart your installation.

I get the same results if I extract the ISO contents to a tree that’s served via http.

And, to be fair, this is true! There is no boot.iso in the .treeinfo file (there is on CentOS 8).

I can do manual installs of Rocky 8 on this machine via virt-manager and interactive configuration, but I really want to automate this with kickstart and virt-install to match all my other OS deployments.

This is likely due to the old version of virt-intall on CentOS 6 but it’s what I have to work with.

Any ideas how I can work around this issue?

FWIW, I borrowed the boot.iso from Index of /centos/8/BaseOS/x86_64/os/images/ and added the relevant entries to .treeinfo and the installer worked.

So I think all that Rocky needs to do is support boot.iso and historical versions of virt-install will work.

1 Like

I’m also trying to install Rocky (8.5) on a Centos 6 xen host using virt-install and have run into a different issue. First, in order to have virt-install recognise Rocky’s ISO, all occurrences of CentOS in /usr/lib/python2.6/site-packages/virtinst/OSDistro.py were changed to Rocky. Then with Rocky-8.5-x86_64-minimal.iso mounted as /mnt/cdrom the following was run:

virt-install  \
   --hvm  \
   --name cloud \
   --ram 4096 --vcpus=4 \
   --disk /dev/vg_ssd/cloud-xvda \
   --disk /dev/vg_ssd/cloud-xvdb \
   --network bridge=wan,mac=00:16:3E:DE:ED:07   \
   --network bridge=dmz,mac=00:16:3E:DE:EE:07   \
   --os-variant rhel7 \
   --location /mnt/cdrom \
   --debug  \
   --console pty,target_type=serial \
   --nographics --extra-args="plymouth.enable=0 text console=ttyS0,115200n8 serial"

Lo and behold, the boot starts! However it times out when Starting dracut initqueue hook... with:

[  146.447846] dracut-initqueue[925]: Warning: dracut-initqueue timeout - starting timeout scripts
[  147.025468] dracut-initqueue[925]: Warning: dracut-initqueue timeout - starting timeout scripts
    .
    .
[  213.555994] dracut-initqueue[925]: Warning: dracut-initqueue timeout - starting timeout scripts
[  213.562465] dracut-initqueue[925]: Warning: Could not boot.
         Starting Setup Virtual Console...
[  OK  ] Started Setup Virtual Console.
         Starting Dracut Emergency Shell...
Warning: /dev/root does not exist

Generating "/run/initramfs/rdsosreport.txt"

Entering emergency mode. Exit the shell to continue.
Type "journalctl" to view system logs.
You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot
after mounting them and attach it to a bug report.

dracut:/#

Exiting the shell with ^D tries to clean up and fails with:

    .
    .
[  OK  ] Reached target Switch Root.
         Starting Switch Root...
[  OK  ] Closed Open-iSCSI iscsiuio Socket.
[FAILED] Failed to start Switch Root.
See 'systemctl status initrd-switch-root.service' for details.

with systemctl status initrd-switch-root.service reporting:

● initrd-switch-root.service - Switch Root
   Loaded: loaded (/usr/lib/systemd/system/initrd-switch-root.service; static; >
   Active: failed (Result: exit-code) since Mon 2021-11-22 07:06:30 UTC; 26s ago
  Process: 8057 ExecStart=/usr/bin/systemctl --no-block switch-root /sysroot (c>
 Main PID: 8057 (code=exited, status=1/FAILURE)

Nov 22 07:06:30 localhost systemd[1]: Starting Switch Root...
Nov 22 07:06:30 localhost systemctl[8057]: Failed to switch root: Specified swi>
Nov 22 07:06:30 localhost systemd[1]: initrd-switch-root.service: Main process >
Nov 22 07:06:30 localhost systemd[1]: initrd-switch-root.service: Failed with r>
Nov 22 07:06:30 localhost systemd[1]: Failed to start Switch Root.
Nov 22 07:06:30 localhost systemd[1]: initrd-switch-root.service: Triggering On>

I was hoping to see an installation menu in order to do a manual install.

Is there any something simple that has been overlooked?

All suggestions and clues would be appreciated.

Thanks!!

Did you ever solve this?

Was that to me or dbrnz? For me and 8.4,copying the equivalent CentOS boot.iso file and updating .treeinfo worked. With 8.5 I didn’t need to do that and it worked “out of box” without any changes needed.

(But now I’ve updated the server to 8.5 so I can’t test, any more).

And yes for me as well (with 8.5). In case it’s useful, I used:

virt-install  \
   --hvm  \
   --name cloud \
   --ram 4096 --vcpus=4 \
   --disk /home/dave/Downloads/Rocky-8.5-x86_64-minimal.iso,device=cdrom \
   --disk /dev/vg_ssd/cloud-xvda \
   --disk /dev/vg_ssd/cloud-xvdb \
   --network bridge=dmz          \
   --os-variant rhel7 \
   --location /mnt/cdrom \
   --debug  \
   --initrd-inject=/home/dave/cloud-ks.cfg \
   --extra-args="ks=file:/cloud-ks.cfg console=tty0 console=ttyS0,115200n8 serial"

with the Minimal ISO mounted at /mnt/cdrom and a kickstart file starting with:

# Install from local installation tree
cdrom
# Use text mode install
text
eula --agreed
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=xvda

I just come up against this with a CentOS 6 KVM host trying to install a Rocky 8.5 minimal and proceeded as described by dbmz but as I noticed that CentOS7 ISO had the boot.iso entry in the .treeinfo file but the file itself was missing, I tried without the file and the installation worked perfectly.

Thus, for me it was enough to:

  1. Temporarily mount the Rocky ISO file, copy everything to eg. /mnt/cdrom and there edit the .treeinfo file adding the boot.iso entry as:
$ vim /mnt/cdrom/.treeview
...
[images-x86_64]
efiboot.img = images/efiboot.img
initrd = images/pxeboot/initrd.img
kernel = images/pxeboot/vmlinuz
boot.iso = images/boot.iso
  1. Do not copy any boot.iso file, just adding the entry should be enough,

  2. virt-install with something like:

virt-install \
    --hvm \
    --name rockytest \
    --ram 1024 \
    --vcpus 1 \
    --os-type linux \
    --os-variant=rhel7 \
    --disk path=/var/lib/libvirt/images/Rocky-8.5-x86_64-minimal.iso,device=cdrom \
    --disk path=/var/lib/libvirt/images/rockytest.img,size=20 \
    --network bridge=br0  \
    --graphics=none \
    --location /mnt/cdrom \
    --console pty,target_type=serial \
    --initrd-inject /tmp/ks.cfg \
    --extra-args="ks=file:/ks.cfg console=tty0 console=ttyS0,115200n8"

and the ks.cfg starting as

install
cdrom
...
  1. And finally shutdown the machine in order to cleanly “eject” the cdrom and have it removed from the virtual machine XML file. You can --eject --force live, but in my case doing this does not remove the entry, and shutting the machine down and ejecting does.
$ virsh domblklist --domain rockytest 
Target     Source
-----------------------------------------
hdc        /var/lib/libvirt/images/Rocky-8.5-x86_64-minimal.iso
vda        /var/lib/libvirt/images/rockytest.img

$ virsh shutdown rockytest
$ virsh  change-media rockytest hdc --eject
$ virsh start rockytest