virt-install depends on /usr/bin/file (nixpkgs.file)
(See comment below)
use virt-install with --initrd-inject injected file
Starting install...
Retrieving file linux...
Retrieving file initrd.gz...
ERROR Failed to file command for rhel4 initrd detection
Traceback (most recent call last):
File "/usr/share/virt-manager/virtinst/initrdinject.py", line 31, in _rhel4_initrd_inject
stderr=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859071
"x86_64-linux"Linux 4.14.34, NixOS, 18.03.132021.c0c5571ec1a (Impala)yesnonix-env (Nix) 2.0"""nixos-18.03.132021.c0c5571ec1a"/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgsI have trouble reproducing this. Please provide
nix-shell -p nix-info --run "nix-info -m"virt-install --version@xeji sure, will try to produce those
OK got a repro. From the nixos demo image ( 18.03.132021.c0c5571ec1a on virtualbox…
sudo -i/etc/nixos/configuration.nix: virtualisation.libvirtd.enable = true;
nixos-rebuild switchnix-env -i libguestfsnix-env -iA nixos.libguestfsvirt-install was part of virtmanager)nix-env -iA nixos.virtmanagerfile /etc/NIXOSfile is not installed)Now, the fun part
[root@nixos:~]# virt-install --name centos6$$ --graphics none --initrd-inject=/etc/NIXOS --disk none --location http://mirror.i3d.net/pub/centos/6/os/x86_64/ --memory 1
WARNING KVM acceleration not available, using 'qemu'
WARNING Did not find 'console=ttyS0' in --extra-args, which is likely required to see text install output from the guest.
Starting install...
Retrieving file vmlinuz... | 4.1 MB 00:00:02
Retrieving file initrd.img... | 40 MB 00:00:08
ERROR Failed to file command for rhel4 initrd detection
Traceback (most recent call last):
File "/nix/store/qr3nr2yb7230dpflbkafi0ai2iknamnd-virt-manager-1.5.1/share/virt-manager/virtinst/initrdinject.py", line 31, in _rhel4_initrd_inject
stderr=subprocess.PIPE)
File "/nix/store/nx3jw576gqw01iiijgsav39w2qa4cni2-python-2.7.14/lib/python2.7/subprocess.py", line 390, in __init__
errread, errwrite)
File "/nix/store/nx3jw576gqw01iiijgsav39w2qa4cni2-python-2.7.14/lib/python2.7/subprocess.py", line 1025, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
ERROR Could not start storage pool: cannot open directory '/var/lib/libvirt/boot': No such file or directory
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
virsh --connect qemu:///system start centos61029
otherwise, please restart your installation.
[root@nixos:~]# file
file: command not found
But if I install file the error goes away
[root@nixos:~]# nix-env -iA nixos.file
installing 'file-5.32'
building '/nix/store/4y9s9xasx7nkcrsxlvksm3wigwhcgh9j-user-environment.drv'...
created 250 symlinks in user environment
[root@nixos:~]# virt-install --name centos6$$ --graphics none --initrd-inject=/etc/NIXOS --disk none --location http://mirror.i3d.net/pub/centos/6/os/x86_64/ --memory 1
WARNING KVM acceleration not available, using 'qemu'
WARNING Did not find 'console=ttyS0' in --extra-args, which is likely required to see text install output from the guest.
Starting install...
Retrieving file vmlinuz... | 4.1 MB 00:00:00
Retrieving file initrd.img... | 40 MB 00:00:03
ERROR Could not start storage pool: cannot open directory '/var/lib/libvirt/boot': No such file or directory
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
virsh --connect qemu:///system start centos61029
otherwise, please restart your installation.
[root@nixos:~]#
@xeji updated comment and details above ^
hidden dependencies, gotta love them
reproduced and fixing...