[HowTo] Run OMV as a KVM/qemu/libvirt host

  • Have you checked that the username you are connecting with are member of the correct groups on the host?

    Code
    sudo adduser <username> libvirt
    sudo adduser <username> kvm


    What happens if you try to access libvirt from a console on the host like::

    Code
    virsh list --all


    It should list like this:

    Code
    username@LHJ-OMV:~$ virsh list --all
     Id    Name                           State
    ----------------------------------------------------
    
    
    username@LHJ-OMV:~$


    Also check that the libvirt deamon is running on the host:

    Code
    ps -A | grep virt


    it should display:

    Code
    1912 ?        00:04:06 libvirtd
  • User name was added to both groups.


    virsh list --all gives same response that you have shown.


    ps -A | grep virt gives me::

    Code
    18321 ?        00:00:00 libvirtd


    Does it look like a problem with libvirtd, or is it likely some other connection problem?


    Also when I first tried connecting, it said that I needed openssh-askpass or something similar. I installed ssh-askpass. Before that, it wouldn't even ask for a password.

  • The complete message I am getting is:

  • Are the account/username you are using to connect to the host member of the ssh group. If not grant membership by

    Code
    adduser <username> ssh


    Check the membership of the groups on the host:

    Code
    cat /etc/group | grep libvirt
    cat /etc/group | grep kvm
    cat /etc/group | grep ssh


    The account you are using should be member of all three groups


    I presume that you have not defined any virtual guests on your host since they should have been shown in the

    Code
    virsh list --all


    If you have defined any the result should be like:

    Code
    root@LHJ-OMV:~# virsh list --all
     Id    Name                           State
    ----------------------------------------------------
     5     Wheezy-mail                    running
     -     Ubu_serv_20_04                 shut off
     -     Wheezy-basis                   shut off


    What is the result if you try to connect from CLI on your admin pc:

    Code
    virsh -c qemu+ssh://<username>@<ipadress_of_host>/system list --all
  • This is the result, I am using the username radio for qemu.


    Code
    Last login: Wed Oct 23 11:36:26 2013 from stuart-desktop
    root@openmediavault:~# cat /etc/group | grep libvirt
    libvirt:x:118:admin,root,radio
    libvirt-qemu:x:119:libvirt-qemu
    root@openmediavault:~# cat /etc/group | grep kvm
    kvm:x:117:admin,root,radio
    root@openmediavault:~# cat /etc/group | grep ssh
    ssh:x:107:stuart,radio


    Code
    root@openmediavault:~# virsh list --all
     Id    Name                           State
    ----------------------------------------------------


    The result of

    Code
    virsh -c qemu+ssh://<username>@<ipadress_of_host>/system list --all

    is


    Code
    root@stuart-desktop:/home/stuart# virsh -c qemu+ssh://radio@192.168.1.151/system list --all
    WARNING: gnome-keyring:: couldn't connect to: /home/stuart/.cache/keyring-2Eh4T5/pkcs11: No such file or directory
    radio@192.168.1.151's password: 
    error: End of file while reading data: sh: nc: not found: Input/output error
    error: failed to connect to the hypervisor
  • Have you created the "radio" user in OMV GUI? If so the user does not have a home dir and all the nescesary files as OMV GUI only creates users with the absolute minimum parts.
    You have to create the "radio" user in the CLI
    First delete the user in OMV GUI.
    Then login in to the console with "root" and create the user like:

    Code
    adduser radio


    Answer the questions asked.
    After this make the "radio" user member of the "ssh" group with:

    Code
    useradd radio ssh


    Check the "radio" users by loggin in the "radio" user

    Code
    su radio

    Enter password. Logout from the console.


    Then try to connect via the Virt-manager from you desktop pc with "radio" as the user.

  • I have now done that. As you will see below, it now asks for the password three times, and then...


    Code
    radio@openmediavault:/root$     virsh -c qemu+ssh://radio@192.168.1.151/system list --all
    radio@192.168.1.151's password: 
    radio@192.168.1.151's password: 
    radio@192.168.1.151's password: 
    error: Cannot recv data: Permission denied, please try again.
    Permission denied, please try again.
    : Connection reset by peerey,password).
    error: failed to connect to the hypervisor


    Did I need to add any options, when setting up the user?

  • That didn't work. I have added user radio back into the libvirt, kvm, and ssh groups and am getting the now familiar


    Code
    root@openmediavault:~# virsh -c qemu+ssh://radio@192.168.1.151/system list --all
    radio@192.168.1.151's password: 
    error: End of file while reading data: sh: nc: not found: Input/output error
    error: failed to connect to the hypervisor
  • If you are logged in to the commandline as root on OMV you should be able to connect by:

    Code
    virsh list --all


    When you cannot use virsh http://qemu+ssh://radio@xx.xx.xx.xx list --all it could be because your ssh daemon is not running on OMV. Please check if ssh is running with:

    Code
    ps -A | grep ssh

    It should display at least one line with "sshd".
    In OMV GUI enable ssh with "permit root login", "Enable keyboard-interactive authentication" and "Permit to do ssh tunneling".
    When ssh is running and root login via ssh is enabled try to connect via virt-manager from another pc with first "root" as the user after that with "radio" as the user.


    BTW: If you are trying to run vir-manager on the OMV box you only need to connect with the parameters "qemu.//localhost" but then your logged in account need to have the group memberships.

  • I thought something like that may have been happening, but ssh seems to be working fine. That is how I have been accessing OMV.
    Changing the order of things gets me in, as per example:


    Code
    stuart@stuart-desktop:20:55:59~$ ssh radio@192.168.1.151 virsh -c qemu:///system list --all
    radio@192.168.1.151's password: 
     Id    Name                           State
    ----------------------------------------------------
    
    
    stuart@stuart-desktop:20:56:13~$


    What it seems to bork at is using qemu+ssh://

  • Just read through all of you posts in this thread again.
    It seems that the error is not on the host (OMV) side.
    As i interpretate this error

    Code
    WARNING: gnome-keyring:: couldn't connect to: /home/stuart/.cache/keyring-2Eh4T5/pkcs11: No such file or directory


    it states that you are missing parts of the nessecary ssh on stuart-desktop so ssh isn't working correct on your stuart-desktop.


    It says you're logged in as root on stuart-desktop but it looks for the gnome-keyring in /home/stuart/.cache/keyring............ on stuart-desktop.
    Is gnome-keyring installed on stuart-desktop? Try:

    Code
    dpkg -l gnome-keyring*


    Can you describe a little stuart-desktop - os, version, install etc.


    What happens when you in stuart-desktop are logged in as stuart and from this account issue:

    Code
    virsh -c qemu+ssh://radio@192.168.1.151/system list --all
  • Logged in either as stuart or root the response to dpkg -l gnome-keyring* is:

    Code
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name           Version      Architecture Description
    +++-==============-============-============-=================================
    ii  gnome-keyring  3.4.1-5      amd64        GNOME keyring services (daemon an


    I don't understand what the above is telling me. In Synaptic, it says that gnome-keyring is installed.


    When using virsh -c http://qemu+ssh://radio@192.168.1.151/system list --all from stuart-desktop, I get:


    Code
    stuart@stuart-desktop:13:57:50~$ virsh -c qemu+ssh://radio@192.168.1.151/system list --all
    WARNING: gnome-keyring:: couldn't connect to: /home/stuart/.cache/keyring-X1mCif/pkcs11: No such file or directory
    radio@192.168.1.151's password: 
    error: End of file while reading data: sh: nc: not found: Input/output error
    error: failed to connect to the hypervisor
    stuart@stuart-desktop:13:58:35~$


    My desktop is Debian Wheezy 64bit, with XFCE. After doing some searching on the internet, there appears to have been some bugs, using virt-manager on Wheezy, in relation to remote connections. But I haven't been able to discover if they have either been resolved, or whether they are the same connection issues I am having.

  • I believe that we have been barking up the wrong tree. The error is on stuart-desktop and not on the KVM/Qemu installation on your OMV host.


    It seems like the gnome-keyring-pkcs11.so isn't loaded on startup by XFCE.


    I am using Ubuntu Unity for desktops so i can't replicate this at this moment but this https://bugs.launchpad.net/ubu…nome-keyring/+bug/1022322 states that XFCE default has an eror that this keyring module is not loaded on XFCE desktop
    They state that you can fix it by editing a XCFE startup file.


    On stuart-desktop log in as root. Edit /etc/xdg/autostart/gnome-keyring-pkcs11.desktop by

    Code
    nano /etc/xdg/autostart/gnome-keyring-pkcs11.desktop


    find the line with

    Code
    OnlyShowIn=GNOME;Unity


    replace it with

    Code
    OnlyShowIn=GNOME;Unity;XFCE


    Save and exit
    logout/login or reboot
    start virt-manager and connect to your KVM/Qemu host.


    PS: for those running LXDE the "XFCE" should be replaced by "LXDE"

  • Well, that has fixed the gnome-keyring warning. Unfortunately the connection issue still remains.


    From the terminal:


    Code
    stuart@stuart-desktop:21:47:07~$ virsh -c qemu+ssh://radio@192.168.1.151/system list --all
    radio@192.168.1.151's password: 
    error: End of file while reading data: sh: nc: not found: Input/output error
    error: failed to connect to the hypervisor
    stuart@stuart-desktop:21:47:27~$


    And the full message from virt-manager:


  • Hmmm. There are several errors here.
    According to this site http://wiki.libvirt.org/page/F…connect_to_the_hypervisor this error could be because ssh isn't running on your host but since you can access the host via normal ssh login from stuart-desktop this isn't the problem.


    Could you try to use another desktop OS like booting Ubuntu 12.04 from a install-USB or install-CD, install virt-manager - in terminal

    Code
    sudo apt-get install virt-manager

    and try to connect to your KVM/Qemu host from this dekstop?
    This way we could determine wether the problem is on your KVM/Qemu host or your desktop.
    A thought just comes to me - Have you changed the ssh listening port on your OMV install. It should be port 22. Please check in the OMV GUI that ssh is listening on port 22.
    PS: I wil be away the next days and can't reply before sunday evening late CET.

  • I have Xubuntu 12.04 on another partition, so went over there, did an update on it, and fixed the /etc/xdg/autostart/gnome-keyring-pkcs11.desktop file. Then installed virt-manager.


    Unfortunately with the same results, that I am getting with Wheezy. So it looks like its back to being an issue on the OMV machine.


    Just checked ssh settings on OMV, and they are set to port 22.

  • I have tried to install lubuntu (lxde) with virt-manager.


    I started virt-manager and it asked for "ssh-askpass-gnome" which i installed. When i logged in it initially tried to connect to libvirtd on the local machine and gave an error. I canceled and clicked file - create connection - made a remote connection to the KVM/Qemu host with the username that is member of the correct groups on the kvm/Qemu host.
    Everything worked as expected and i could se and manage my guest VM's


    If i tried to login with the root account it failed - as my root account isn't member of the nescessary groups on the KVM/Qemu host.


    Notice that the program needed for virt-manager to be able to connect through ssh is "ssh-askpass-gnome"
    Install on your desktop by

    Code
    apt-get update
    apt-get install ssh-askpass-gnome

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!