WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: virt-manager error on startup  (Read 11190 times)

Offline core.dump

  • Jr. Member
  • **
  • Posts: 50
virt-manager error on startup
« on: April 07, 2020, 08:27:33 AM »
I tried the recently added virt-manager on a fresh TC installation.
When I try to start virt-manager for the first time, I get this error:

Code: [Select]
Unable to connect to libvirt qemu:///system.

internal error: Unable to get DBus system bus connection: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory

Libvirt URI is: qemu:///system

Traceback (most recent call last):
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/connection.py", line 956, in _do_open
    self._backend.open(connectauth.creds_dialog, self)
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtinst/connection.py", line 174, in open
    open_flags)
  File "/usr/local/lib/python3.6/site-packages/libvirt.py", line 104, in openAuth
    if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirt.libvirtError: internal error: Unable to get DBus system bus connection: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory

If I try to start libvirtd from shell, I get:

Code: [Select]
tc@box:~$ sudo libvirtd
2020-04-07 14:09:23.116+0000: 13809: info : libvirt version: 1.3.5
2020-04-07 14:09:23.116+0000: 13809: info : hostname: box
2020-04-07 14:09:23.116+0000: 13809: error : dnsmasqCapsRefreshInternal:736 : Cannot check dnsmasq binary dnsmasq: No such file or directory
2020-04-07 14:09:23.119+0000: 13809: error : virDBusGetSystemBus:107 : internal error: Unable to get DBus system bus connection: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
2020-04-07 14:09:23.119+0000: 13809: warning : networkStateInitialize:698 : DBus not available, disabling firewalld support in bridge_network_driver: internal error: Unable to get DBus system bus connection: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
2020-04-07 14:09:24.047+0000: 13809: error : virFirewallValidateBackend:191 : direct firewall backend requested, but /sbin/iptables is not available: No such file or directory
2020-04-07 14:09:24.047+0000: 13809: error : virFirewallApply:938 : internal error: Failed to initialize a valid firewall backend
2020-04-07 14:09:24.053+0000: 13809: error : virSysinfoRead:1020 : internal error: Failed to find path for dmidecode binary
2020-04-07 14:09:24.096+0000: 13809: error : virNodeSuspendSupportsTarget:331 : internal error: Cannot probe for supported suspend types
2020-04-07 14:09:24.098+0000: 13809: warning : virQEMUCapsInit:1085 : Failed to get host power management capabilities
2020-04-07 14:09:24.606+0000: 13809: error : virSysinfoRead:1020 : internal error: Failed to find path for dmidecode binary
2020-04-07 14:09:24.606+0000: 13809: error : virExec:490 : Cannot find 'ip' in path: No such file or directory
2020-04-07 14:09:24.608+0000: 13809: error : virNodeSuspendSupportsTarget:331 : internal error: Cannot probe for supported suspend types
2020-04-07 14:09:24.608+0000: 13809: warning : virLXCDriverCapsInit:88 : Failed to get host power management capabilities
2020-04-07 14:09:24.610+0000: 13809: error : virNodeSuspendSupportsTarget:331 : internal error: Cannot probe for supported suspend types
2020-04-07 14:09:24.610+0000: 13809: warning : umlCapsInit:74 : Failed to get host power management capabilities
2020-04-07 14:09:24.622+0000: 13809: error : virNetDevBridgeCreateWithIoctl:413 : Unable to create bridge virbr0: Package not installed
2020-04-07 14:09:41.319+0000: 13800: error : virDBusGetSystemBus:107 : internal error: Unable to get DBus system bus connection: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
2020-04-07 14:09:41.324+0000: 13792: error : virNetSocketReadWire:1625 : End of file while reading data: Input/output error

What is missing???

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: virt-manager error on startup
« Reply #1 on: April 07, 2020, 08:41:14 AM »
Hi core.dump
The  .info  file states:
Quote
                ----------
                Howto:
                $ sudo modprobe kvm-intel
                $ sudo libvirtd -d
                ..then start virt-manager
                ----------

Code: [Select]
Unable to connect to libvirt qemu:///system.

internal error: Unable to get DBus system bus connection: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
You may need to start  dbus  first, maybe something like:
Code: [Select]
sudo /usr/local/etc/init.d/dbus start
Quote
Code: [Select]
2020-04-07 14:09:23.116+0000: 13809: error : dnsmasqCapsRefreshInternal:736 : Cannot check dnsmasq binary dnsmasq: No such file or directory
See if installing  dnsmasq.tcz  fixes that.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14816
Re: virt-manager error on startup
« Reply #2 on: April 07, 2020, 08:41:49 AM »
It works for me using gnome-session - maybe it needs to be started with dbus (I can check tomorrow)?

Offline core.dump

  • Jr. Member
  • **
  • Posts: 50
Re: virt-manager error on startup
« Reply #3 on: April 07, 2020, 10:52:41 AM »
Hi all,
thanks for your suggestions, I added to /opt/bootlocal.sh the commands to start libvirtd and dbus, and now virt-manager seems to open correctly. Starting virt-manager as a regular user returns this error:

Code: [Select]
Unable to connect to libvirt qemu:///system.

error from service: CheckAuthorization: The name org.freedesktop.PolicyKit1 was not provided by any .service files

Libvirt URI is: qemu:///system

Traceback (most recent call last):
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/connection.py", line 956, in _do_open
    self._backend.open(connectauth.creds_dialog, self)
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtinst/connection.py", line 174, in open
    open_flags)
  File "/usr/local/lib/python3.6/site-packages/libvirt.py", line 104, in openAuth
    if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirt.libvirtError: error from service: CheckAuthorization: The name org.freedesktop.PolicyKit1 was not provided by any .service files

This doesn't happen if I start virt-manager as root. The solution was to install a package called polkit.tcz providing some dbus-related stuff, this enables normal users to run virt-manager.

Now virt-manager starts and connects to the qemu backend correctly, but when I try to create a new virtual machine (either by pressing the toolbar button or thru the File menu) nothing happens. The problem is I don't get any errors. Do I have to install some other components?

EDIT: running virt-manager --debug allows to redirect errors and warning to stdout, this is what I obtained:

Code: [Select]
[Tue, 07 Apr 2020 16:54:38 virt-manager 9777] DEBUG (cli:200) Uncaught exception:
Traceback (most recent call last):
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/xmleditor.py", line 11, in <module>
    gi.require_version("GtkSource", "4")
  File "/usr/local/lib/python3.6/site-packages/gi/__init__.py", line 129, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace GtkSource not available

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/manager.py", line 456, in new_vm
    from .createvm import vmmCreateVM
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/createvm.py", line 31, in <module>
    from .storagebrowse import vmmStorageBrowser
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/storagebrowse.py", line 11, in <module>
    from .hoststorage import vmmHostStorage
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/hoststorage.py", line 16, in <module>
    from .createpool import vmmCreatePool
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/createpool.py", line 19, in <module>
    from .xmleditor import vmmXMLEditor
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/xmleditor.py", line 14, in <module>
    gi.require_version("GtkSource", "3.0")
  File "/usr/local/lib/python3.6/site-packages/gi/__init__.py", line 129, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace GtkSource not available

I will do a search to understand what it means...
« Last Edit: April 07, 2020, 11:01:09 AM by core.dump »

Offline core.dump

  • Jr. Member
  • **
  • Posts: 50
Re: virt-manager error on startup
« Reply #4 on: April 07, 2020, 11:32:00 AM »
It looks like I found a solution. These packages must be installed in order to get a correctly running virt-manager:

virt-manager.tcz
polkit.tcz
gtksourceview.tcz
gtksourceview-gir.tcz
libsoup.tcz

Probably they should be considered as dependencies since they're mandatory to run virt-manager without errors.

Offline core.dump

  • Jr. Member
  • **
  • Posts: 50
Re: virt-manager error on startup
« Reply #5 on: April 07, 2020, 03:06:50 PM »
Update

Sorry, I don't want to bother, but when I create a new guest in virt-manager and try to run it, I'm not able to start the network:

Code: [Select]
Could not start virtual network 'default': internal error: Failed to initialize a valid firewall backend

Traceback (most recent call last):
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/device/netlist.py", line 310, in _check_network_is_running
    netobj.start()
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/object/libvirtobject.py", line 66, in newfn
    ret = fn(self, *args, **kwargs)
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/object/network.py", line 75, in start
    self._backend.create()
  File "/usr/local/lib/python3.6/site-packages/libvirt.py", line 3073, in create
    if ret == -1: raise libvirtError ('virNetworkCreate() failed', net=self)
libvirt.libvirtError: internal error: Failed to initialize a valid firewall backend

Code: [Select]
Error starting domain: Requested operation is not valid: network 'default' is not active

Traceback (most recent call last):
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/asyncjob.py", line 111, in tmpcb
    callback(*args, **kwargs)
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/object/libvirtobject.py", line 66, in newfn
    ret = fn(self, *args, **kwargs)
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/object/domain.py", line 1279, in startup
    self._backend.create()
  File "/usr/local/lib/python3.6/site-packages/libvirt.py", line 1059, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirt.libvirtError: Requested operation is not valid: network 'default' is not active

I'm not sure what these messages are referring to... ?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: virt-manager error on startup
« Reply #6 on: April 07, 2020, 03:32:36 PM »
Hi core.dump
See if this solution fixes the first error message:
https://superuser.com/questions/1063240/libvirt-failed-to-initialize-a-valid-firewall-backend

Then report any remaining errors.
« Last Edit: April 07, 2020, 03:34:09 PM by Rich »

Offline core.dump

  • Jr. Member
  • **
  • Posts: 50
Re: virt-manager error on startup
« Reply #7 on: April 07, 2020, 04:02:53 PM »
Hi Rich,

I tried that solution, installed ebtables, started ebtablesd and dnsmasq, then restarted libvirtd. When I try to start the network in virt-manager, I still get the "libvirt.libvirtError: internal error: Failed to initialize a valid firewall backend" error message.

I don't understand, isn't ebtables a firewall?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: virt-manager error on startup
« Reply #8 on: April 07, 2020, 04:18:31 PM »
Hi core.dump
... I don't understand, isn't ebtables a firewall?
In the  .info  file:
http://tinycorelinux.net/11.x/x86_64/tcz/ebtables.tcz.info

It states:
Quote
filtering tool for bridging firewalls

Based on that description, I would say no. Based on the  .list  file:

/usr/local/etc/ethertypes
/usr/local/lib/libebtc.so
/usr/local/lib/libebtc.so.0
/usr/local/lib/libebtc.so.0.0.0
/usr/local/sbin/ebtables
/usr/local/sbin/ebtables-restore
/usr/local/sbin/ebtables-save

/usr/local/sbin/ebtablesd
/usr/local/sbin/ebtablesu


It appears to have some configuration options. Possibly it requires some setup.

Iptables comes with a basic firewall, but I don't know if that helps you.

Offline core.dump

  • Jr. Member
  • **
  • Posts: 50
Re: virt-manager error on startup
« Reply #9 on: April 07, 2020, 05:03:07 PM »
Iptables comes with a basic firewall, but I don't know if that helps you.

No, in fact I tried installing iptables, but nothing changes:

Code: [Select]
Error starting network 'default': internal error: Failed to initialize a valid firewall backend

Traceback (most recent call last):
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/asyncjob.py", line 111, in tmpcb
    callback(*args, **kwargs)
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/object/libvirtobject.py", line 66, in newfn
    ret = fn(self, *args, **kwargs)
  File "/tmp/tcloop/virt-manager/usr/local/share/virt-manager/virtManager/object/network.py", line 75, in start
    self._backend.create()
  File "/usr/local/lib/python3.6/site-packages/libvirt.py", line 3073, in create
    if ret == -1: raise libvirtError ('virNetworkCreate() failed', net=self)
libvirt.libvirtError: internal error: Failed to initialize a valid firewall backend

ebtablesd, iptables dnsmasq and libvirtd are all running but the error is still there. I have searched the web for a solution, but nothing seems to work...

Moreover, there's another thing I don't understand: after installing iptables, I noticed it hasn't anything to "run" the firewall: no servers (it doesn't exist, e.g., an "iptablesd"), no command line flags ("iptables -d" or such), no kernel modules (I didn't find any "iptables.ko" or similar). So my question is: how can it work if there isn't an "active" component?
« Last Edit: April 07, 2020, 05:32:38 PM by core.dump »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Re: virt-manager error on startup
« Reply #10 on: April 07, 2020, 08:23:11 PM »
Hi core.dump
... Moreover, there's another thing I don't understand: after installing iptables, I noticed it hasn't anything to "run" the firewall: no servers (it doesn't exist, e.g., an "iptablesd"), no command line flags ("iptables -d" or such), no kernel modules (I didn't find any "iptables.ko" or similar). So my question is: how can it work if there isn't an "active" component?

From:
http://tinycorelinux.net/11.x/x86/tcz/iptables.tcz.info

It appears the x86 version includes includes a basic firewall script not included in x86_64:
Code: [Select]
Comments:       Iptables is the userspace tool to control
the linux kernel firewall. A simple script
included, suitable for home users.
-
From a terminal:
sudo /usr/local/sbin/basic-firewall
-
From bootlocal.sh (to start on every boot):
/usr/local/sbin/basic-firewall noprompt


Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1510
Re: virt-manager error on startup
« Reply #11 on: April 07, 2020, 11:09:11 PM »
No, in fact I tried installing iptables, but nothing changes:

Code: [Select]
Error starting network 'default': internal error: Failed to initialize a valid firewall backend
In TCL, kernel functionality required for firewall is in the  ipv6-netfilter-KERNEL.tcz  extension (which is a dependency of iptables.tcz). It should have been automatically installed when you installed iptables.tcz, but please check to make sure. When you run this command, does it say the extension is already installed?
Code: [Select]
$ tce-load -wi ipv6-netfilter-KERNEL

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1510
Re: virt-manager error on startup
« Reply #12 on: April 07, 2020, 11:21:31 PM »
Moreover, there's another thing I don't understand: after installing iptables, I noticed it hasn't anything to "run" the firewall: no servers (it doesn't exist, e.g., an "iptablesd"), no command line flags ("iptables -d" or such), no kernel modules (I didn't find any "iptables.ko" or similar). So my question is: how can it work if there isn't an "active" component?
If  iptables.tcz  and  ipv6-netfilter-KERNEL.tcz  extensions are installed, then your system has the capability of creating a firewall. However, no firewall is created until you configure one (either manually or using some helper script/application).

I have both of the above packages installed on my TC11 64bit laptop but didn't configure a firewall, so no firewall is running. Run this command:
Code: [Select]
$ sudo iptables -nvL
Chain INPUT (policy ACCEPT 12688 packets, 10M bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 9551 packets, 7421K bytes)
 pkts bytes target     prot opt in     out     source               destination       

If your output is similar to mine (i.e., if there are no rules listed for any of the chains) then it means no firewall is running.
« Last Edit: April 07, 2020, 11:24:09 PM by GNUser »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14816
Re: virt-manager error on startup
« Reply #13 on: April 08, 2020, 03:38:13 AM »
It looks like I found a solution. These packages must be installed in order to get a correctly running virt-manager:

virt-manager.tcz
polkit.tcz
gtksourceview.tcz
gtksourceview-gir.tcz
libsoup.tcz

Probably they should be considered as dependencies since they're mandatory to run virt-manager without errors.

gnome-boxes seems much easier to use to me...

I have not found the need to load polkit, gtksourceview or libsoup - virt-manager does however need gtk-vnc-gir and spice-gtk-gir to connect to a running vm, although it still gives an error message.

I've adjusted the dep and info files and reposted.
« Last Edit: April 08, 2020, 06:05:05 AM by Juanito »

Offline core.dump

  • Jr. Member
  • **
  • Posts: 50
Re: virt-manager error on startup
« Reply #14 on: April 08, 2020, 04:56:33 AM »
gnome-boxes seems much easier to use to me...

I have not found the need to load polkit, gtksourceview or libsoup - virt-manager does however need gtk-vnc-gir and
spice-gtk-gir to connect to a running vm, although it still gives an error message.

Yes, but it has tons of other dependencies slowing down the bootup... :(

Hi core.dump
From:
http://tinycorelinux.net/11.x/x86/tcz/iptables.tcz.info

It appears the x86 version includes includes a basic firewall script not included in x86_64:
Code: [Select]
Comments:       Iptables is the userspace tool to control
the linux kernel firewall. A simple script
included, suitable for home users.
-
From a terminal:
sudo /usr/local/sbin/basic-firewall
-
From bootlocal.sh (to start on every boot):
/usr/local/sbin/basic-firewall noprompt

Could you please post that script? Probably with that I will be able to start a firewall. I suppose it is valid for x86_64 too, even though I don't know why it has not been included...
« Last Edit: April 08, 2020, 05:02:19 AM by core.dump »