Virt-install stopped working

Hi All,

Not sure what’s happened but after a recent update I found two of my ClearLinux KVM boxes having the same issue.

When I run virt-install I get an error about the file not being found … this is something that just started happening?

$ virt-install --help
-bash: /usr/bin/virt-install: cannot execute: required file not found

when I change directory into /usr/bin and run the same command it seems to work?

/usr/bin $ virt-install --help
usage: virt-install --name NAME --memory MB STORAGE INSTALL [options]

Create a new virtual machine from specified install media.

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --connect URI         Connect to hypervisor with libvirt URI

Anyone have any idea what is causing this?

Kind Regards

It could be a python issue:

head -n 1 /usr/bin/virt-install

This is the upstream python3 script:

Hi apwiggins,

Thank you for the reply, although I’m not sure what I’m supposed to do with it?

Are you saying that virt-install on my system needs updating? Given it’s bundled this could be challenging :slight_smile:

On my KVM

head -n 1 /usr/bin/virt-install 
#!python

running python gives same results.

$ python
Python 3.13.2 (main, Apr 10 2025, 07:01:33) [GCC 14.2.1 20250217 releases/gcc-14.2.0-791-g4467274fac] on linux
Type "help", "copyright", "credits" or "license" for more information.
$ env python3
Python 3.13.2 (main, Apr 10 2025, 07:01:33) [GCC 14.2.1 20250217 releases/gcc-14.2.0-791-g4467274fac] on linux
Type "help", "copyright", "credits" or "license" for more information.
$ sudo swupd info
Distribution:      Clear Linux OS
Installed version: 43450
Version URL:       https://cdn.download.clearlinux.org/update
Content URL:       https://cdn.download.clearlinux.org/update

Regards

Ah looks like libvirt isn’t doing the right thing for pyproject scripts. I’ll try and get this fixed up. You can in the time being change the #!python to #!/usr/bin/python to get it working again.

1 Like

Just seeing this now. Yes, William Green has pointed out the fix which is to adjust the virt-install script to match the upstream script that I linked. Expect that this will be patched going forward.