0

I've just installed virt-manager with pkgin on NetBSD 9.2 just because I want to emulate the virtual machines with qemu + nvmm on NetBSD 9.2. The installation of virt-manager went ok. But,when I ran it,an error came up :

netbsd-marietto# virt-manager

Traceback (most recent call last):

File "/usr/pkg/share/virt-manager/virt-manager.py", line 386, in <module>

main()

File "/usr/pkg/share/virt-manager/virt-manager.py", line 247, in main

from virtManager import cli

File "/usr/pkg/share/virt-manager/virtManager/cli.py", line 29, in <module>

import libvirt

ImportError: No module named libvirt

Googling a little bit maybe I've found the solution here :

https://www.unitedbsd.com/d/285-linux-user-and-netbsd-enthusiast-hoping-to-migrate-some-day

where "kim" said :

Looking at pkgsrc/sysutils/libvirt/PLIST it doesn't look like the package provides any Python bindings -- which is what the "ImportError: No module named libvirt" error message is about. You could try py-libvirt from pkgsrc-wip and see how that works out.

I tried to start the compilation like this :

netbsd-marietto# cd /home/mario/Desktop/pkgsrc-wip/py-libvirt
netbsd-marietto# make

but I've got this error :

make: "/home/mario/Desktop/pkgsrc-wip/py-libvirt/Makefile" line 15: Could not find ../../wip/libvirt/buildlink3.mk
make: "/home/mario/Desktop/pkgsrc-wip/py-libvirt/Makefile" line 16: Could not find ../../lang/python/distutils.mk
make: "/home/mario/Desktop/pkgsrc-wip/py-libvirt/Makefile" line 17: Could not find ../../mk/bsd.pkg.mk
make: Fatal errors encountered -- cannot continue

If u want to see the content of the Makefile,it is :

gedit /home/mario/Desktop/pkgsrc-wip/py-libvirt/Makefile

#$NetBSD: Makefile,v 1.32 2018/11/30 09:59:40 adam Exp $

PKGNAME= ${PYPKGPREFIX}-${DISTNAME:S/-python//}
DISTNAME= libvirt-python-5.8.0
CATEGORIES= sysutils python
MASTER_SITES= https://libvirt.org/sources/python/

MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= https://libvirt.org/sources/python/
COMMENT= libvirt python library
LICENSE= gnu-lgpl-v2

USE_TOOLS+= pkg-config

.include "../../wip/libvirt/buildlink3.mk"
.include "../../lang/python/distutils.mk"
.include "../../mk/bsd.pkg.mk"

Can someone help me to fix the error ? very thanks.

Marietto
  • 201
  • 2
  • 9
john_connor
  • 165
  • 2
  • 2
  • 15

1 Answers1

2

You are getting those errors because your copy of pkgsrc wip is not inside a pkgsrc tree.

Please follow the pkgsrc wip documentation to correctly use pkgsrc wip. Especially look at the section titled Getting the "source".

In brief, assuming you have a copy of pkgsrc in /usr/pkgsrc and you want to use git to checkout pkgsrc wip, run these commands:

cd /usr/pkgsrc
git clone git://wip.pkgsrc.org/pkgsrc-wip.git wip

Then build py-libvirt with these commands:

cd /usr/pkgsrc/wip/py-libvirt
make

If it builds successfully, you could install it with:

cd /usr/pkgsrc/wip/py-libvirt
make install
Kimmo Suominen
  • 152
  • 2
  • 10
  • this is what happens later.....netbsd-marietto# service libvirtd start libvirtd already running? (pid=598). Unable to connect to libvirt qemu:///system. Client socket identity not available: Function not implemented Libvirt URI is: qemu:///system File "/usr/pkg/share/virt-manager/virtManager/connection.py", line 956, in _do_open self._backend.open(connectauth.creds_dialog, self) File "/usr/pkg/share/virt-manager/virtinst/connection.py", line 172, in open conn = libvirt.openAuth(self._open_uri, File "/usr/pkg/lib/python3.8/site-packages/libvirt.py", line 104, in openAuth – Marietto Sep 15 '21 at 18:10