[needs-packaging] virt-manager

Bug #116897 reported by Sean Middleditch
34
Affects Status Importance Assigned to Milestone
Ubuntu
Fix Released
Wishlist
Unassigned

Bug Description

The virt-manager application at http://virt-manager.et.redhat.com/ would be awesome to have in Ubuntu. We already have libvirt.

There is a request in Debian to package this as well but it hasn't been done:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=384443

description: updated
Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :

Ubuntu's libvirt is out of date. Here is an updated one.

Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :
Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :
Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :

Original source is at http://libvirt.org/sources/libvirt-0.2.2.tar.gz

Binary packages is attached

Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :

Virtinst is a dependency of virt-manager. Original source is at http://virt-manager.et.redhat.com/download/sources/virtinst/virtinst-0.103.0.tar.gz.

Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :
Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :

Virtinst binary attached.

Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :
Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :

virt-manager binary attached

Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :
Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :
Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :
description: updated
Revision history for this message
Sean Middleditch (elanthis) wrote :

Verifying that these packages install and work correctly, and appear to have proper dependencies set as well. Thank you!

Revision history for this message
Sean Middleditch (elanthis) wrote :

Found a bug in the virt-manager package, actually. It's given as architecture "all" but it includes .so files. In particular, it doesn't run on my AMD64 box:

Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-manager.py", line 105, in <module>
    from virtManager.engine import vmmEngine
  File "/usr/share/virt-manager/virtManager/engine.py", line 31, in <module>
    from virtManager.manager import vmmManager
  File "/usr/share/virt-manager/virtManager/manager.py", line 26, in <module>
    import sparkline
ImportError: /usr/lib/virt-manager/sparkline.so: wrong ELF class: ELFCLASS32

Either sparkline needs to be split out, or the package has to be made architecture-dependent.

Revision history for this message
Jon Hermansen (jonhermansen) wrote :

I was able to install Marcelo Boveto Shima's virt-manager_0.4.0-0ubuntu1_all.deb [ https://bugs.launchpad.net/ubuntu/+bug/116897/comments/13 ] using "sudo dpkg -i" but when I ran it I hit an error. The .deb needs to require python-libvirt, or whatever may be necessary. Error is below:

---

jherm@jherm-ubuntu:~$ virt-manager
/usr/share/virt-manager/virtManager/config.py:21: ImportWarning: Not importing directory '/usr/lib/python2.5/site-packages/gtk-2.0/gnome': missing __init__.py
  import gnome
Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-manager.py", line 104, in <module>
    from virtManager.config import vmmConfig
  File "/usr/share/virt-manager/virtManager/config.py", line 24, in <module>
    import libvirt
ImportError: No module named libvirt

---

After resolving this issue, I am hitting the error in the previous comment; I am attempting to run this on an up-to-date Feisty. Is there any chance we could get a package built for amd64? Thanks!

Revision history for this message
vinch (levinch) wrote :

I have installed virt-manager with the package virt-manager_0.4.0-0ubuntu1_all.deb on my Kubuntu 7.04.
The module named gtkvnc is missing but I was unable to find it in the Kubuntu's packages.

---
levinch@feisty:~$ virt-manager
/usr/local/share/virt-manager/virtManager/config.py:21: ImportWarning: Not importing directory '/usr/lib/python2.5/site-packages/gtk-2.0/gnome': missing __init__.py
  import gnome
Traceback (most recent call last):
  File "/usr/local/share/virt-manager/virt-manager.py", line 116, in <module>
    from virtManager.engine import vmmEngine
  File "/usr/local/share/virt-manager/virtManager/engine.py", line 33, in <module>
    from virtManager.console import vmmConsole
  File "/usr/local/share/virt-manager/virtManager/console.py", line 28, in <module>
    import gtkvnc
ImportError: No module named gtkvnc
---

Revision history for this message
xtsbdu3reyrbrmroezob (xtsbdu3reyrbrmroezob) wrote :

I am also interested in this for KVM support. Is the package still broken for amd64? I run 64-bits...

Revision history for this message
Jon Hermansen (jonhermansen) wrote : Re: [Bug 116897] Re: [needs-packaging] virt-manager

I just didn't find one in the bug when I looked. I assume you could build it
yourself... not having this issue anymore as I'm using Fedora. :p You could
probably just install the one from Fedora.

On 9/9/07, Kristian Erik Hermansen <email address hidden> wrote:
>
> I am also interested in this for KVM support. Is the package still
> broken for amd64? I run 64-bits...
>
> --
> [needs-packaging] virt-manager
> https://bugs.launchpad.net/bugs/116897
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :

I created an PPA archive with virt-manager, amd64 binary too.
I didn't try it on ubuntu 64.
To make kvm work is necessary to create the directory /var/run/libvirt and run libvirtd as root.

I don't have much time now to work on this package, but please report the bugs.

repos:
deb http://ppa.launchpad.net/marceloshima/ubuntu/ feisty main universe

description: updated
Revision history for this message
tirili (tom-tiri) wrote :

I installed marceloshimas Packages, and wrote my comments on http://inhalt.serviert.de/wissen/gpl/xen/xen-installation-auf-ubuntu-7.10-gutsy-gibbon-amd64-virt-manager

There is a dependency missing, so you cannot start virt-manager or virt-install - you need to perform an aptitude install python-libxml2.

But then you got another error:

$ virt-install
libvir: Xen Daemon error : internal error failed to connect to xend
libvir: Xen Daemon error : internal error failed to connect to xend
Mo, 17 Dez 2007 21:38:38 ERROR virConnectOpen() failed
Traceback (most recent call last):
  File "/usr/bin/virt-install", line 485, in <module>
    main()
  File "/usr/bin/virt-install", line 336, in main
    conn = cli.getConnection(options.connect)
  File "/var/lib/python-support/python2.5/virtinst/cli.py", line 67, in getConnection
    return libvirt.open(connect)
  File "/usr/lib/python2.5/site-packages/libvirt.py", line 123, in open
    if ret is None:raise libvirtError('virConnectOpen() failed')
libvirtError: virConnectOpen() failed

I recently installed:

$ dpkg -l | grep xen
ii libxen3.1 3.1.0-0ubuntu18 library interface for Xen, a Virtual Machine
ii linux-backports-modules-2.6.22-14-xen 2.6.22-14.9 Ubuntu supplied Linux modules for version 2.
ii linux-backports-modules-xen 2.6.22.14.21 Backported drivers for Xen kernel image
ii linux-image-2.6.22-14-xen 2.6.22-14.46 Linux kernel image for version 2.6.22 on Thi
ii python-xen-3.1 3.1.0-0ubuntu18 python bindings for Xen, a Virtual Machine M
ii xen-hypervisor-3.1 3.1.0-0ubuntu18 The Xen Hypervisor for i386, amd64 amd lpia
ii xen-utils-3.1 3.1.0-0ubuntu18 XEN administrative tools

Thomas.

Revision history for this message
tirili (tom-tiri) wrote :

Ok. I found why virt-install or virt-manager couldnt connect. My /etc/xen/xend-config.sxp lacked of the line

(xend-unix-server yes)

Now I can connect, but networking doesn't

$ virt-install
libvir: Remote error : No such file or directory
libvir: warning : Failed to find the network: Is the daemon running ?

Do you have any hints ?

Thanks for your reply in advance.

Thomas.

Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :

Try to install bridge-utils and dnsmasq

What version of libvirt, virt-inst and virt-manager are you using?
The one from my ppa repository?

On Dec 17, 2007 6:49 PM, tirili <email address hidden> wrote:

> Ok. I found why virt-install or virt-manager couldnt connect. My
> /etc/xen/xend-config.sxp lacked of the line
>
> (xend-unix-server yes)
>
> Now I can connect, but networking doesn't
>
> $ virt-install
> libvir: Remote error : No such file or directory
> libvir: warning : Failed to find the network: Is the daemon running ?
>
> Do you have any hints ?
>
> Thanks for your reply in advance.
>
> Thomas.
>
> --
> [needs-packaging] virt-manager
> https://bugs.launchpad.net/bugs/116897
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :

The packages got into debian last week and the maintainer made some changes.
I will update on my ppa tomorrow or after.

Marcelo.

Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :

Just remembered that I've created some dirs. Try to create the directories /var/lib/xen/images and /var/lib/xen/dump.
I will update the package soon.

Revision history for this message
tirili (tom-tiri) wrote :

Marcelo, I created these directories and now the paravirtualized VM is created (but I cannot see any Virtual Networks, but I can take a shared virtual device (peth0)).

When trying to finish virtmanager thows:

Unable to complete install '<class 'libvirt.libvirtError'> virDomainCreateLinux() failed POST operation failed: (xend.err 'Device 0 (vif) could not be connected. Hotplug scripts not working.')
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/create.py", line 616, in do_install
    dom = guest.start_install(False, meter = meter)
  File "/var/lib/python-support/python2.5/virtinst/Guest.py", line 810, in start_install
    return self._do_install(consolecb, meter)
  File "/var/lib/python-support/python2.5/virtinst/Guest.py", line 831, in _do_install
    self.domain = self.conn.createLinux(install_xml, 0)
  File "/usr/lib/python2.5/site-packages/libvirt.py", line 585, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: virDomainCreateLinux() failed POST operation failed: (xend.err 'Device 0 (vif) could not be connected. Hotplug scripts not working.')

Revision history for this message
tirili (tom-tiri) wrote :
Download full text (5.3 KiB)

I got the same error when trying to create a fully virtualized guest. (xend.log)

[2007-12-18 22:20:13 4691] INFO (__init__:1094) createDevice: vif : {'bridge': 'xenbr0', 'mac': '00:16:3e:2f:8e:cf', 'uuid': '1c8f9fff-bf70-5e67-82fb-5ebf9cafc9f0'}
[2007-12-18 22:20:13 4691] DEBUG (__init__:1094) DevController: writing {'backend-id': '0', 'mac': '00:16:3e:2f:8e:cf', 'handle': '0', 'state': '1', 'backend': '/local/domain/0/backend/vif/3/0'} to /local/domain/3/device/vif/0.
[2007-12-18 22:20:13 4691] DEBUG (__init__:1094) DevController: writing {'bridge': 'xenbr0', 'domain': 'centos46_64', 'handle': '0', 'uuid': '1c8f9fff-bf70-5e67-82fb-5ebf9cafc9f0', 'script': '/etc/xen/scripts/vif-bridge', 'state': '1', 'frontend': '/local/domain/3/device/vif/0', 'mac': '00:16:3e:2f:8e:cf', 'online': '1', 'frontend-id': '3', 'type': 'netfront'} to /local/domain/0/backend/vif/3/0.
[2007-12-18 22:20:13 4691] INFO (__init__:1094) spawning device models: /usr/lib64/xen-ioemu-3.1/bin/qemu-dm ['/usr/lib64/xen-ioemu-3.1/bin/qemu-dm', '-d', '3', '-vcpus', '1', '-boot', 'd', '-serial', 'pty', '-acpi', '-usb', '-domain-name', 'centos46_64', '-net', 'nic,vlan=1,macaddr=00:16:3e:2f:8e:cf,model=rtl8139', '-net', 'tap,vlan=1,bridge=xenbr0', '-vncunused', '-vnclisten', '127.0.0.1']
[2007-12-18 22:20:13 4691] INFO (__init__:1094) device model pid: 29830
[2007-12-18 22:20:13 4691] DEBUG (__init__:1094) Storing VM details: {'on_xend_stop': 'ignore', 'shadow_memory': '5', 'uuid': '2ec73712-c41e-aece-c722-a51d70b186af', 'on_reboot': 'destroy', 'start_time': '1198012813.63', 'on_poweroff': 'destroy', 'on_xend_start': 'ignore', 'on_crash': 'destroy', 'xend/restart_count': '0', 'vcpus': '1', 'vcpu_avail': '1', 'image': '(hvm (kernel /usr/lib/xen-ioemu-3.1/boot/hvmloader) (acpi 1) (apic 1) (boot d) (device_model /usr/lib64/xen-ioemu-3.1/bin/qemu-dm) (pae 1) (serial pty) (usb 1) (notes (SUSPEND_CANCEL 1)))', 'name': 'centos46_64'}
[2007-12-18 22:20:13 4691] DEBUG (__init__:1094) Storing domain details: {'console/port': '3', 'name': 'centos46_64', 'console/limit': '1048576', 'vm': '/vm/2ec73712-c41e-aece-c722-a51d70b186af', 'domid': '3', 'image/suspend-cancel': '1', 'cpu/0/availability': 'online', 'memory/target': '512000', 'control/platform-feature-multiprocessor-suspend': '1', 'store/ring-ref': '127998', 'store/port': '2'}
[2007-12-18 22:20:13 4691] DEBUG (__init__:1094) DevController: writing {'state': '1', 'backend-id': '0', 'backend': '/local/domain/0/backend/console/3/0'} to /local/domain/3/device/console/0.
[2007-12-18 22:20:13 4691] DEBUG (__init__:1094) DevController: writing {'domain': 'centos46_64', 'protocol': 'vt100', 'uuid': '88a8550c-bc53-d214-c4b5-f8495ef81ef2', 'frontend': '/local/domain/3/device/console/0', 'state': '1', 'location': '3', 'online': '1', 'frontend-id': '3'} to /local/domain/0/backend/console/3/0.
[2007-12-18 22:20:13 4691] DEBUG (__init__:1094) Storing domain details: {'console/port': '3', 'name': 'centos46_64', 'console/limit': '1048576', 'vm': '/vm/2ec73712-c41e-aece-c722-a51d70b186af', 'domid': '3', 'image/suspend-cancel': '1', 'cpu/0/availability': 'online', 'memory/target': '512000', 'control/platform-feature-multiprocessor-suspend': '1', 'store/rin...

Read more...

Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :

Try this:
cp -auprfv /etc/xen/scripts /tmp/scriptsbackup
cd /etc/xen/scripts
sed -i "s/\/bin\/sh/\/bin\/bash/g" *

Revision history for this message
tirili (tom-tiri) wrote :

Good! dash is a damned thing... qemu-ifup had #!/bin/sh - changed to #!/bin/bash and got it more running....

Now only the problem of virtual networks exist...

# virt-install
libvir: Remote error : No such file or directory
libvir: warning : Failed to find the network: Is the daemon running ?
Would you like a fully virtualized guest (yes or no)? This will allow you to run unmodified operating systems.

Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :

Take a look at the logs at /var/log/xen.
Probably xen-hotplug.log.

Revision history for this message
tirili (tom-tiri) wrote :

/var/log/xen/xen-hotplug.log only says "Nothing to flush."

Thats what I did

root@tirisrv01:~# virt-install
libvir: Remote error : No such file or directory
libvir: warning : Failed to find the network: Is the daemon running ?
Would you like a fully virtualized guest (yes or no)? This will allow you to run unmodified operating systems. no
 What is the name of your virtual machine? vs2
 How much RAM should be allocated (in megabytes)? 500
 What would you like to use as the disk (file path)? /data/linuXen/vs2.img
 You are going to overwrite file '/data/linuXen/vs2.img'!
Do you really want to use the file (yes or no)? yes
 Would you like to enable graphics support? (yes or no) no
 What is the install location?
 ERROR: Install location must be an NFS, HTTP or FTP network install source, or local file/device
What is the install location? /data/install/CentOS-4.6-x86_64-binDVD.iso

Starting install...
libvir: Xen Daemon error : GET operation failed:
libvir: Xen Daemon error : GET operation failed:
Creating domain... 0 B 00:02
[Errno 2] No such file or directory
Domain installation may not have been
 successful. If it was, you can restart your domain
 by running 'virsh start vs2'; otherwise, please
 restart your installation.
Mi, 19 Dez 2007 22:09:59 ERROR [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/usr/bin/virt-install", line 506, in <module>
    main()
  File "/usr/bin/virt-install", line 470, in main
    dom = guest.start_install(conscb,progresscb)
  File "/var/lib/python-support/python2.5/virtinst/Guest.py", line 810, in start_install
    return self._do_install(consolecb, meter)
  File "/var/lib/python-support/python2.5/virtinst/Guest.py", line 857, in _do_install
    child = consolecb(self.domain)
  File "/usr/bin/virt-install", line 454, in show_console
    return txt_console(dom, options.connect)
  File "/usr/bin/virt-install", line 343, in txt_console
    os.execvp(args[0], args)
  File "os.py", line 354, in execvp
    _execvpe(file, args)
  File "os.py", line 380, in _execvpe
    func(file, *argrest)
OSError: [Errno 2] No such file or directory
[Errno 2] No such file or directory: '/var/lib/xen/virtinst-vmlinuz.USmpun'
Domain installation may not have been
 successful. If it was, you can restart your domain
 by running 'virsh start vs2'; otherwise, please
 restart your installation.
Mi, 19 Dez 2007 22:10:00 ERROR [Errno 2] No such file or directory: '/var/lib/xen/virtinst-vmlinuz.USmpun'
Traceback (most recent call last):
  File "/usr/bin/virt-install", line 506, in <module>
    main()
  File "/usr/bin/virt-install", line 470, in main
    dom = guest.start_install(conscb,progresscb)
  File "/var/lib/python-support/python2.5/virtinst/Guest.py", line 812, in start_install
    self._installer.cleanup()
  File "/var/lib/python-support/python2.5/virtinst/Guest.py", line 430, in cleanup
    os.unlink(f)
OSError: [Errno 2] No such file or directory: '/var/lib/xen/virtinst-vmlinuz.USmpun'
root@tirisrv01:~#

Revision history for this message
tirili (tom-tiri) wrote :

Oops I didnt install virsh....

Now I did but get this error:

Adding group `libvirtd' (GID 112) ...
Done.
 * Starting libvirt management daemon libvirtd
libvir: QEMU error : failed to add iptables rule to allow DHCP requests from 'virbr0' : Invalid argument
Failed to autostart network 'default': failed to add iptables rule to allow DHCP requests from 'virbr0' : Invalid argument
   ...done.

But -- installation start seems working: (but the xend-hotplug.log shows xenstore-read: couldn't read path backend/vbd/10/51728/node).

# virt-install
Would you like a fully virtualized guest (yes or no)? This will allow you to run unmodified operating systems. no
 What is the name of your virtual machine? vs2
 How much RAM should be allocated (in megabytes)? 500
 What would you like to use as the disk (file path)? /data/linuXen/vs2.img
 You are going to overwrite file '/data/linuXen/vs2.img'!
Do you really want to use the file (yes or no)? yes
 Would you like to enable graphics support? (yes or no) no
 What is the install location? /data/install/CentOS-4.6-x86_64-binDVD.iso

Starting install...
libvir: Xen Daemon error : GET operation failed:
libvir: Xen Daemon error : GET operation failed:
Creating domain... 0 B 00:01

Revision history for this message
tirili (tom-tiri) wrote :

But no CD/DVD Driver :

            +-----------------+ No driver found +------------------+
            | |
            | Unable to find any devices of the type |
            | needed for this installation type. |
            | Would you like to manually select your |
            | driver or use a driver disk? |
            | |
            | +---------------+ +-------------------+ +------+ |
            | | Select driver | | Use a driver disk | | Back | |
            | +---------------+ +-------------------+ +------+ |
            | |
            | |
            +------------------------------------------------------+

Seems to concert to the hotplug-error.

Revision history for this message
tirili (tom-tiri) wrote :

And, finally I cannot control these domains from virsh:

root@tirisrv01:/etc/xen# virsh
Welcome to virsh, the virtualization interactive terminal.

Type: 'help' for help with commands
       'quit' to quit

virsh # dumpxml vs2
libvir: QEMU error :
error: failed to get domain 'vs2'

virsh # dumpxml vs1
libvir: QEMU error :
error: failed to get domain 'vs1'

virsh # quit

But xm list shows all Domains.

root@tirisrv01:/etc/xen# xm list
Name ID Mem VCPUs State Time(s)
Domain-0 0 3018 4 r----- 273.7
vs1 500 1 9.6
vs2 500 1 6.9

How can I modify the information for vs1 and vs2? Where is it stored ?

Thanks for your help!

Thomas.

Revision history for this message
tirili (tom-tiri) wrote :

After reboot I get xend running but virsh not

$ virsh
libvir: Remote error : No such file or directory
error: failed to connect to the hypervisor

What services have to be enabled ?

virt-manager runs fine... (can start/stop open machines...)

xend.log says
[2007-12-19 23:17:44 5296] WARNING (__init__:1094) API call: console.set_other_config not found
[2007-12-19 23:17:44 5296] WARNING (__init__:1094) API call: VIF.get_network not found
[2007-12-19 23:17:44 5296] WARNING (__init__:1094) API call: VIF.set_device not found
[2007-12-19 23:17:44 5296] WARNING (__init__:1094) API call: VIF.set_MAC not found
[2007-12-19 23:17:44 5296] WARNING (__init__:1094) API call: VIF.set_MTU not found
[2007-12-19 23:17:44 5296] WARNING (__init__:1094) API call: session.get_all_records not found
[2007-12-19 23:17:44 5296] WARNING (__init__:1094) API call: event.get_record not found
[2007-12-19 23:17:44 5296] WARNING (__init__:1094) API call: event.get_all not found
[2007-12-19 23:17:44 5296] INFO (__init__:1094) Opening Unix domain socket XML-RPC server on /var/run/xend/xen-api.sock; authentication has been disabled for this server.
[2007-12-19 23:17:44 5296] INFO (__init__:1094) Opening Unix domain socket XML-RPC server on /var/run/xend/xmlrpc.sock.

Thanks for any help appreciated.

Thomas.

Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :

On Dec 19, 2007 8:25 PM, tirili <email address hidden> wrote:

> After reboot I get xend running but virsh not
>
> $ virsh
> libvir: Remote error : No such file or directory
> error: failed to connect to the hypervisor
>
> What services have to be enabled ?
>
> virt-manager runs fine... (can start/stop open machines...)
>
>
Try virsh --connect xen:///

virsh is connecting to qemu/kvm by default.

Revision history for this message
tirili (tom-tiri) wrote :

Good. Working now (with errors)

root@tirisrv01:~# virsh --connect xen:///
libvir: Remote error : No such file or directory
libvir: warning : Failed to find the network: Is the daemon running ?
Welcome to virsh, the virtualization interactive terminal.

Type: 'help' for help with commands
       'quit' to quit

virsh # list
 Id Name State
----------------------------------
  0 Domain-0 running
  1 vs1 blocked
  4 vs2 blocked

virsh #

Revision history for this message
Paul McEnery (pmcenery) wrote :

I added the above mentioned repository a while ago, but recently there have been a few virt-manager/libvirt updates. I think these may have been some upstream packages. Anyway, these packages dont seem to work too well as /var/run/libvirt doesnt exist. I have made the following change to the init file to get it working.

--- libvirt-bin~ 2007-12-21 09:51:25.000000000 +0000
+++ libvirt-bin 2007-12-21 10:33:11.000000000 +0000
@@ -22,7 +22,8 @@
 test -x $DAEMON || exit 0
 . /lib/lsb/init-functions

-PIDFILE=/var/run/$NAME.pid
+PIDDIR=/var/run/libvirt
+PIDFILE=$PIDDIR/$NAME.pid
 DODTIME=1 # Time to wait for the server to die, in seconds

 # Include libvirtd defaults if available
@@ -41,6 +42,12 @@
   fi
 }

+check_pid_dir() {
+ if [ ! -d "$PIDDIR" ]; then
+ mkdir -p $PIDDIR
+ fi
+}
+
 running_pid()
 {
     # Check if a given process pid's cmdline matches a given name
@@ -89,6 +96,7 @@
 case "$1" in
   start)
        if check_start_libvirtd_option; then
+ check_pid_dir
                log_daemon_msg "Starting $DESC" "$NAME"
                if running ; then
                        log_progress_msg "already running"

Also... with the updated packages, when you restart or stop libvirt-bin, the bridge is not taken down. Not sure where that is run.

Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :

On Dec 21, 2007 8:38 AM, Paul McEnery <email address hidden> wrote:

> I added the above mentioned repository a while ago, but recently there
> have been a few virt-manager/libvirt updates. I think these may have
> been some upstream packages. Anyway, these packages dont seem to work
> too well as /var/run/libvirt doesnt exist. I have made the following
> change to the init file to get it working.
>

This has been fixed in debian and Soren told me he was working on a merge.
He just uploaded.
So I just backported the new package.

>
> Also... with the updated packages, when you restart or stop libvirt-bin,
> the bridge is not taken down. Not sure where that is run.
>

Sorry, can't reproduce this. Do you have more info about this?
I will figure out how to used the new libvirt0-dbg. This should help to
debug it.

Revision history for this message
Paul McEnery (pmcenery) wrote :
Download full text (3.6 KiB)

On 21/12/2007, Marcelo Boveto Shima <email address hidden> wrote:
>
> On Dec 21, 2007 8:38 AM, Paul McEnery <email address hidden> wrote:
>
> > I added the above mentioned repository a while ago, but recently there
> > have been a few virt-manager/libvirt updates. I think these may have
> > been some upstream packages. Anyway, these packages dont seem to work
> > too well as /var/run/libvirt doesnt exist. I have made the following
> > change to the init file to get it working.
> >
>
> This has been fixed in debian and Soren told me he was working on a merge.
> He just uploaded.
> So I just backported the new package.

Thanks Marcelo

>
> > Also... with the updated packages, when you restart or stop libvirt-bin,
> > the bridge is not taken down. Not sure where that is run.
> >
>
> Sorry, can't reproduce this. Do you have more info about this?
> I will figure out how to used the new libvirt0-dbg. This should help to
> debug it.

If libvirt-bin is started, then you have the bridge interface:

$ ifconfig virbr0
virbr0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
          inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
          inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b) TX bytes:5135 (5.0 KB)

Stop it:

~$ sudo /etc/init.d/libvirt-bin stop
 * Stopping libvirt management daemon libvirtd [
OK ]

Problem, its still up:

$ ifconfig virbr0
virbr0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
          inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
          inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b) TX bytes:5135 (5.0 KB)

Try and start it:

$ sudo /etc/init.d/libvirt-bin start
 * Starting libvirt management daemon
libvirtd libvir: QEMU error : cannot create
bridge 'virbr0' : File exists
Failed to autostart network 'default': cannot create bridge 'virbr0' : File
exists
[fail]

I am running the following packages and versions:

$ dpkg -l |grep virt
ii kvm
1:28-4ubuntu2 Full virtualization on x86 hardware
ii libvirt-bin
0.4.0-0ubuntu0ppa6~gutsy1
the programs for the libvirt library
ii libvirt0
0.4.0-0ubuntu0ppa6~gutsy1
library for interfacing with Xen & other virtu
ii python-libvirt
0.4.0-0ubuntu0ppa6~gutsy1
libvirt python bindings
ii python-virtkey 0.42
Library to emulate keyboard keypresses.
ii virt-manager 0.5.2-3ubuntu0ppa2
desktop application for managing virtual machi
ii virtinst
0.300.1+hg20071213-0ubuntu0~gutsy0.3 Programs to create and clone virtual
machines
ii xen-tools 3.5-1ubuntu2
Tools to manage debian XEN v...

Read more...

Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :

Ok, this happened some time ago to me when libvirtd sigfaulted, but the
bridge was
up and didn't went down. brctl didn't help me so to remove this bridge the
only way
I found was to reboot.

Try to debug it by:
disabling auto start on /etc/default/libvirt
reboot

Then
$ sudo libvirtd -v

This should start libvirtd on verbose mode.
When you use virt-manager the console with libvirtd should print
informations
about some operations.

Post the results here. Try to use the new package, it is built already.

> Not sure if this helps. I have two laptops with the same configuration.
> I.e.
> I started with the same version from the ppa repo. They have recently been
> upgraded. They never used to have the bridge problem before the package
> upgrades. Something must have changed. I must say that you only notice the
> brigde issue if you are restarting the service at the command line. When
> its
> all working and you boot up, you dont notice it.
>
> --
> [needs-packaging] virt-manager
> https://bugs.launchpad.net/bugs/116897
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
tirili (tom-tiri) wrote :

Testing ppa new packages, I got the following error:

syslog:
Dec 21 14:55:32 tirisrv01 kernel: [143348.239524] virbr0: starting userspace STP failed, staring kernel STP

stderr:
 * Starting libvirt management daemon libvirtd libvir: QEMU error : failed to add iptables rule to allow DHCP requests from 'virbr0' : Invalid argument
Failed to autostart network 'default': failed to add iptables rule to allow DHCP requests from 'virbr0' : Invalid argument

What's now wrong ?

brctl show shows:
brctl show
bridge name bridge id STP enabled interfaces
xenbr0 8000.feffffffffff no vif0.0
                                                        peth0
                                                        vif6.0
xenbr1 8000.feffffffffff no vif0.1
                                                        peth1
                                                        vif4.0

Revision history for this message
Paul McEnery (pmcenery) wrote :

On 21/12/2007, Marcelo Boveto Shima <email address hidden> wrote:
>
> Ok, this happened some time ago to me when libvirtd sigfaulted, but the
> bridge was
> up and didn't went down. brctl didn't help me so to remove this bridge the
> only way
> I found was to reboot.
>
> Try to debug it by:
> disabling auto start on /etc/default/libvirt
> reboot
>
> Then
> $ sudo libvirtd -v
>
> This should start libvirtd on verbose mode.
> When you use virt-manager the console with libvirtd should print
> informations
> about some operations.
>
> Post the results here. Try to use the new package, it is built already.

The new packages have fixed the bridge issue. I am able to stop, start and
restart libvirt-bin and there are no issues. Yeah!

Unfortunately, /var/run/libvirt is still not being created by the init
script. Would you mind getting my patch integrated or ensuring that the
sockets are created somewhere that exists? Attached is a diff of the latest
package's init script.

Revision history for this message
Paul McEnery (pmcenery) wrote :
Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :

On Dec 21, 2007 12:11 PM, tirili <email address hidden> wrote:

> Testing ppa new packages, I got the following error:
>
> syslog:
> Dec 21 14:55:32 tirisrv01 kernel: [143348.239524] virbr0: starting
> userspace STP failed, staring kernel STP
>
> stderr:
> * Starting libvirt management daemon libvirtd
> libvir: QEMU error : failed to add iptables
> rule to allow DHCP requests from 'virbr0' : Invalid argument
> Failed to autostart network 'default': failed to add iptables rule to
> allow DHCP requests from 'virbr0' : Invalid argument
>
> What's now wrong ?
>
> brctl show shows:
> brctl show
> bridge name bridge id STP enabled interfaces
> xenbr0 8000.feffffffffff no vif0.0
> peth0
> vif6.0
> xenbr1 8000.feffffffffff no vif0.1
> peth1
> vif4.0
>

This seems to be xen related problem. The network on your virtual machine is
working fine?
Xen is not letting brctl put iptables rules.

Revision history for this message
Marcelo Boveto Shima (marceloshima) wrote :

Included with some changes. There were some places that were using
/var/run/$NAME.pid
We have to take a closer look because I think the pidfile is created by the
daemon itself not by start-stop-daemon.

On Dec 21, 2007 1:02 PM, Paul McEnery <email address hidden> wrote:

>
> ** Attachment added: "libvirt-bin_init_piddir.patch"
> http://launchpadlibrarian.net/11020308/libvirt-bin_init_piddir.patch
>
> --
> [needs-packaging] virt-manager
> https://bugs.launchpad.net/bugs/116897
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Paul McEnery (pmcenery) wrote :

On 21/12/2007, Marcelo Boveto Shima <email address hidden> wrote:
>
> Included with some changes. There were some places that were using
> /var/run/$NAME.pid
> We have to take a closer look because I think the pidfile is created by
> the
> daemon itself not by start-stop-daemon.

Yes. I have played with this a little and it appears that libvirtd does not
work properly when you try and supply --pid-file <file> to it. Even if you
run it without start-stop-daemon, it never quite manages to start properly.
I think this must be a bug in libvirtd.

Since the --pid-file is an issue, I think it would be better to set the
variables as follows in the init script:

PIDDIR=/var/run/libvirt
PIDFILE=/var/run/$NAME.pid

rather than

PIDDIR=/var/run/libvirt
PIDFILE=$PIDDIR/$NAME.pid

Can you please check if /var/lib/libvirt is provided by the package? After
installing the latest version, I had to manually mkdir /var/lib/libvirt for
the dnsmasq dhcpd.leases file to be created.

P.S. I see that you have added /var/run/libvirt to the libvirt-bin package.
I am not sure this is a good idea as /var/run is mounted in memory on boot,
hence the need to mkdir $PIDDIR.

Revision history for this message
Lionel Porcheron (lionel.porcheron) wrote :

We now have a recent virt-manager on hardy. I'm closing this bug.
$ apt-cache madison virt-manager
virt-manager | 0.5.2-3ubuntu1 | http://eu.archive.ubuntu.com hardy/universe Packages
virt-manager | 0.5.2-3ubuntu1 | http://eu.archive.ubuntu.com hardy/universe Sources

Revision history for this message
TiagoCruz (tiagocruz) wrote :

And about this error?

$ sudo libvirtd -v
libvir: QEMU error : failed to set bridge STP to on
Failed to autostart network 'default': failed to set bridge STP to on
Shutting down on signal 2

It's missing some package?

Revision history for this message
jhmos (jhmos) wrote :

It seems that the libvirt-bin package is not marked as required in the virt-manager package in Hardy Alpha5 so virt-manager gets installed without some needed library files.

Once I installed libvirt-bin, virt-manager worked fine.

Revision history for this message
Lionel Porcheron (lionel.porcheron) wrote :

Thanks for reporting this bug (bug #198957).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.