Nixpkgs: virtmanager: virt-install depends on file

Created on 8 May 2018  Â·  6Comments  Â·  Source: NixOS/nixpkgs

Issue description

virt-install depends on /usr/bin/file (nixpkgs.file)

Steps to reproduce

(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

Technical details

See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859071

  • system: "x86_64-linux"
  • host os: Linux 4.14.34, NixOS, 18.03.132021.c0c5571ec1a (Impala)
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 2.0
  • channels(demo): ""
  • channels(root): "nixos-18.03.132021.c0c5571ec1a"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs

All 6 comments

I have trouble reproducing this. Please provide

  • a minimal specific example to reproduce the error
  • The output of nix-shell -p nix-info --run "nix-info -m"
  • The output of 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
  • add to /etc/nixos/configuration.nix:
virtualisation.libvirtd.enable = true;
  • nixos-rebuild switch
    (the following 2 are not necessary, but I am including them for completeness)
  • nix-env -i libguestfs
  • nix-env -iA nixos.libguestfs
    ( I forgot that virt-install was part of virtmanager)
  • nix-env -iA nixos.virtmanager
  • file /etc/NIXOS
    (fails, file 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...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

globin picture globin  Â·  65Comments

danykey picture danykey  Â·  64Comments

ttuegel picture ttuegel  Â·  98Comments

grahamc picture grahamc  Â·  88Comments

purefn picture purefn  Â·  68Comments