# Problems installing with virt-install on centos 6 host

**URL:** https://forums.rockylinux.org/t/problems-installing-with-virt-install-on-centos-6-host/3725
**Category:** Rocky Linux Help & Support
**Created:** [August 4, 2021, 2:19pm UTC](https://forums.rockylinux.org/t/problems-installing-with-virt-install-on-centos-6-host/3725 "2021-08-04T14:19:56Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![sweh](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/sweh/32/1287_2.png) [@sweh](https://forums.rockylinux.org/u/sweh)
#### Post date: [August 4, 2021, 2:19pm UTC](https://forums.rockylinux.org/t/problems-installing-with-virt-install-on-centos-6-host/3725/1 "2021-08-04T14:19:56Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![sweh](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/sweh/32/1287_2.png) [@sweh](https://forums.rockylinux.org/u/sweh)
#### Post date: [August 4, 2021, 8:46pm UTC](https://forums.rockylinux.org/t/problems-installing-with-virt-install-on-centos-6-host/3725/2 "2021-08-04T20:46:57Z")

</div>

FWIW, I borrowed the boot.iso from [Index of /centos/8/BaseOS/x86\_64/os/images/](https://mirrors.edge.kernel.org/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.

---

<div class="post-metadata">

### Author: ![dbrnz](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@dbrnz](https://forums.rockylinux.org/u/dbrnz)
#### Post date: [November 22, 2021, 7:17am UTC](https://forums.rockylinux.org/t/problems-installing-with-virt-install-on-centos-6-host/3725/3 "2021-11-22T07:17:39Z")

</div>

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:

```auto
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:

```auto
[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:

```auto
    .
    .
[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:

```auto
● 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!!

---

<div class="post-metadata">

### Author: ![minfrin](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@minfrin](https://forums.rockylinux.org/u/minfrin)
#### Post date: [December 12, 2021, 2:14pm UTC](https://forums.rockylinux.org/t/problems-installing-with-virt-install-on-centos-6-host/3725/4 "2021-12-12T14:14:35Z")

</div>

Did you ever solve this?

---

<div class="post-metadata">

### Author: ![sweh](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/sweh/32/1287_2.png) [@sweh](https://forums.rockylinux.org/u/sweh)
#### Post date: [December 12, 2021, 2:34pm UTC](https://forums.rockylinux.org/t/problems-installing-with-virt-install-on-centos-6-host/3725/5 "2021-12-12T14:34:50Z")

</div>

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).

---

<div class="post-metadata">

### Author: ![dbrnz](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@dbrnz](https://forums.rockylinux.org/u/dbrnz)
#### Post date: [December 12, 2021, 9:17pm UTC](https://forums.rockylinux.org/t/problems-installing-with-virt-install-on-centos-6-host/3725/6 "2021-12-12T21:17:18Z")

</div>

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

```auto
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:

```auto
# 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

```

---

<div class="post-metadata">

### Author: ![iamc](https://avatars.discourse-cdn.com/v4/letter/i/d9b06d/32.png) [@iamc](https://forums.rockylinux.org/u/iamc)
#### Post date: [February 3, 2022, 7:39am UTC](https://forums.rockylinux.org/t/problems-installing-with-virt-install-on-centos-6-host/3725/7 "2022-02-03T07:39:06Z")

</div>

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:

```auto
$ 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:

```auto
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

```auto
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.

```auto
$ 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

```

---

<div class="post-metadata">

### Author: ![brian](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/brian/32/5777_2.png) [@brian](https://forums.rockylinux.org/u/brian)
#### Post date: [August 25, 2023, 3:56am UTC](https://forums.rockylinux.org/t/problems-installing-with-virt-install-on-centos-6-host/3725/8 "2023-08-25T03:56:00Z")

</div>


