Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtmanager: virt-install depends on file #40177

Closed
srl295 opened this issue May 8, 2018 · 6 comments
Closed

virtmanager: virt-install depends on file #40177

srl295 opened this issue May 8, 2018 · 6 comments
Assignees

Comments

@srl295
Copy link

srl295 commented May 8, 2018

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
@srl295 srl295 changed the title libvirt: dirt-install depends on file libvirt: virt-install depends on file May 8, 2018
@xeji
Copy link
Contributor

xeji commented May 11, 2018

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

@srl295
Copy link
Author

srl295 commented May 11, 2018

@xeji sure, will try to produce those

@xeji xeji self-assigned this May 11, 2018
@srl295
Copy link
Author

srl295 commented May 11, 2018

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:~]# 

@srl295
Copy link
Author

srl295 commented May 11, 2018

@xeji updated comment and details above ^

@srl295
Copy link
Author

srl295 commented May 11, 2018

hidden dependencies, gotta love them

@srl295 srl295 changed the title libvirt: virt-install depends on file virtmanager: virt-install depends on file May 11, 2018
@xeji
Copy link
Contributor

xeji commented May 11, 2018

reproduced and fixing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants