Убедитесь что libvirtd запущен
Не удается запустить libvirtd
Здравствуйте! В linux-мире я новичок, поэтому нуждаюсь в вашей помощи. Собственно, сабж: поставил KVM & virt-manager, после запустил последний и пытаясь создать новое подключение получаю: Соединение с libvirt не удалось.
Убедитесь, что служба libvirtd запущена. И лог: Libvirt URI is: qemu:///system
Traceback (most recent call last): File «/usr/share/virt-manager/virtManager/connection.py», line 862, in _do_open self._backend.open(self._do_creds_password) File «/usr/share/virt-manager/virtinst/connection.py», line 161, in open open_flags) File «/usr/lib/python2.7/site-packages/libvirt.py», line 105, in openAuth if ret is None:raise libvirtError(‘virConnectOpenAuth() failed’) libvirtError: Failed to connect socket to ‘/var/run/libvirt/libvirt-sock’: Нет такого файла или каталога Как запустить этого демона?
попробуй добавить своего юзера в группу либвирт
А демон libvirtd запущен? Какой дистрибутив?
Ну вот и решение проблемы. Запусти.
ппц, где вы все эти ошибки собираете? Мрак какой-то.
Не удалось найти эмулятор для x86_64
А ты qemu поставил?
Некоторые просто, кажется, не читают вики, перед тем как пытаться чего-то добиться 🙂
Ну я тоже на этапе первых проб вики не читал. Но я почему-то не помню подобных вопросов со своей стороны. Может быть, забыл, я хз. Может быть, дело в дистрибутиве?
Просто арчвики не полностью соответствует моему дистрибутиву. Возможно не стоило ставить производную, но арч я не осмелился ставить в кач-ве первого десктоп дистрибутива линукс;)
арчвики не полностью соответствует моему дистрибутиву
Хм. А какие там у Manjaro отличия от ванильного Arch? Вроде ж просто сборочка, обратно совместимая (?). Но не знаю, на самом деле.
Возможно не правильно выразился, но как я написал выше, у Manjaro отсутствует (скорее находится где-то в другом месте) директива /etc/group, что ввело меня в лёгкий ступор..
Пытаюсь создать виртуальную машину:) Собственно, при попытке ‘завершить’ 5 шаг выскакивает «Не удалось запустить виртуальную сеть ‘default’: внутренняя ошибка: Failed to initialize a valid firewall backend» В Network selection стои «Виртуальная сеть ‘default’ : NAT неактивен»
Думаю, ты это сделал, но процитирую вики:
Значения одинаковы и равны 78, последняя команда вывела «crw-rw—-+ 1 root kvm 10, 232 сен 10 20:32 /dev/kvm»
kvm 426660 1 kvm_amd
Пошаговый копипаст успехом не увенчался ):
Сделай сначала один бридж, через который будет сам хост работать. Ты уверен в выборе дистриба?
Возможно как-то поможет, вот.. Лог ошибки:
е удалось завершить установку: ‘внутренняя ошибка: Процесс завершился при подключении к монитору: Could not access KVM kernel module: Permission denied failed to initialize KVM: Permission denied ‘
Traceback (most recent call last): File «/usr/share/virt-manager/virtManager/asyncjob.py», line 89, in cb_wrapper callback(asyncjob, *args, **kwargs) File «/usr/share/virt-manager/virtManager/create.py», line 1873, in do_install guest.start_install(meter=meter) File «/usr/share/virt-manager/virtinst/guest.py», line 414, in start_install noboot) File «/usr/share/virt-manager/virtinst/guest.py», line 478, in _create_guest dom = self.conn.createLinux(start_xml or final_xml, 0) File «/usr/lib/python2.7/site-packages/libvirt.py», line 3585, in createLinux if ret is None:raise libvirtError(‘virDomainCreateLinux() failed’, conn=self) libvirtError: внутренняя ошибка: Процесс завершился при подключении к монитору: Could not access KVM kernel module: Permission denied failed to initialize KVM: Permission denied
Прости, не знаю что с этим делать. Заведи новую тему насчёт этой ошибки (..Permission denied..) и поставь теги qemu, kvm, libvirt, virt-manager. Может кто-нибудь из знающих эту кухню когда-нибудь придёт и поможет.
Попробуй trusty или wheezy/jessie, для начала. У меня не было вообще никаких сложностей.
срочно понадобилась виртуалка с виндой
Возможно, быстрее будет накатить обычный пролетарский VirtualBox, чем бодаться с libvirt. Тем более в нём вроде поддержка KVM появилась, если я ничего не путаю.
А под Wine не пойдёт?
Я не в курсе пойдет ли MS Access под Wine. А разве VirtualBox поддерживает x64 архитектуру?
А разве VirtualBox поддерживает x64 архитектуру?
Could not access KVM kernel module: Permission denied failed to initialize KVM: Permission denied
После добавления пользователя в группу пользователь должен перевойти в систему, для получения реальных прав группы.
Есть. Гугл в помощь, неужели это так сложно?
Тем более в нём вроде поддержка KVM появилась, если я ничего не путаю.
Не знаю, если честно, что это значит. Это из настроек виртуалки VBox.
Описание
Полностью текст ошибки выглядит таким вот образом:
Unable to connect to libvirt qemu:///system.
Verify that the ‘libvirtd’ daemon is running.
Libvirt URI is: qemu:///system
Traceback (most recent call last):
File «/usr/share/virt-manager/virtManager/connection.py», line 956, in _do_open
self._backend.open(connectauth.creds_dialog, self)
File «/usr/share/virt-manager/virtinst/connection.py», line 172, in open
conn = libvirt.openAuth(self._open_uri,
File «/usr/lib/python3/dist-packages/libvirt.py», line 104, in openAuth
if ret is None:raise libvirtError(‘virConnectOpenAuth() failed’)
libvirt.libvirtError: Failed to connect socket to ‘/var/run/libvirt/libvirt-sock’: Permission denied
Решение
Несколько раз уже сталкивался с этой ошибкой сразу после установки virt-manager (с помощью apt-get install virt-manager) в Debian подобных дистрибутивах. Т.е. устанавливаем virt-manager, после успешной установки пытаемся его запустить и получаем вот такую ошибку, которая приведена вначале статьи. Решение конкретно этой ошибки оказалось очень простое, надо просто перезагрузить ПК (не Logout, а именно перезагрузка) и тогда данная ошибка с правами более не будет вылазить при запуске. Если перезагрузка не возможна, то подозреваю, что нужно добавить текущего пользователя в группу libvirt, но сам уже не проверял. Если кто-то знает решение без перезагрузки ПК, то с радостью бы его увидел в комментариях.
virt-manager can’t connect to libvirt
I’m running Ubuntu 12.04.2 32 bits.
Output of ps ax | grep libvirt :
srwxrwx— 1 root libvirtd 0 Set 13 15:04 /var/run/libvirt/libvirt-sock
Output of getent group libvirtd :
Detailed error message
18 Answers 18
Rebooting the system where virt-manager is installed solved the issue.
After installing KVM, run this command then that error will not occur again.
An alternative to reboot/logout is to run the following commands from a terminal:
For me, the error was caused because group membership changes don’t apply without a logout-login (or reboot). I had just installed KVM and libvirt-bin. The installer automatically added my user to the libvirtd group, I had restarted the libvirt-bin service, but I was still getting the error.
Don’t change file permissions to 777. Don’t just run everything as root or sudo to avoid understanding what’s wrong.
Simply logging out and back in resolved the problem by applying my new group membership.
Assuming you just installed libvirt-bin and already confirmed that your current user is a member of the libvirtd group as the error message suggests, you will need to log out and back in for the new group membership to apply.
I hope this helps someone.
I’m managing both Qemu and Virtualbox on my Ubuntu 14.02 machine, and after installing Virtualbox libvirt-bin failed to autostart. So check if libvirt-bin is running:
ps faux | grep libvirt-bin
sudo service libvirt-bin start
On Ubuntu 16.04.3 LTS
was the only answer. The socket has its own daemon. That’s unusual.
After installing all of the packages stated by the op, you can log out then log back in. Anything that add you to user groups you need to log out and back in to be added to the new groups. It is a minor inconvenience, less of one than rebooting.
This was flagged as not complete however this goes as a general rule for adding your user to a group. A relog is needed, that was the missing part that I did not see here.
The problem is discussed on Launchpad and the cause of this problem can be solved by installing the xen-utils package ( xen-utils-4.4 on Ubuntu 14.04). I previously was getting around this issue by virt-manager through sudo at the command line.
For me the case was that when using service libvirt-bin status it showed that everything was just running fine though I could not connect like:
In /var/run/libvirt/ there should be these two files:
If the sockets are not showing, use service libvirt-bin stop; service libvirt-bin start to completely restart the process. Using service libvirt-bin restart is not sufficient and will not re-create the socket.
The libvirt-bin service can safely be stopped and will not poweroff the guests.
This was solution for me:
restart system
Logged in user has to be added to libvirt usergroup
Various answers allude to the fact that the problem can occur due to group permissions not getting applied to the user running Virtual Machine Manager, and, the accepted answer, noting that reboot fixed the problem, quite possibly depended on reboot to give the user the group permissions on login (though reboot could potentially start services also).
In the case of Ubuntu 20.04.1 installing QEMU/KVM with apt-get did automatically start all services, and ended up resolving strictly by finding out how to give the user running Virtual Machine Manager libvirt group access (even though /etc/group did show that the user was granted the rights).
In one scenario, the following was effective, and did not require rebooting after installation of libvirt :
The loginctl command was obtained from this answer.
The gdm restart was required because after loginctl was run, the graphical console quit without offering a login screen (leaving only a black screen). It was not determined whether loginctl always kills the graphical login mechanism, but if it does not, then the gdm restart may be superfluous (omitted).
Прошу помощи с libvirtd
Приветствую, господа форумчане. ОС: OpenSuse 3.11.10-7 Desktop Не могу законнектится virtual manager-ом, ругается на то, что мол не запущен libvirtd
Делаю service libvirtd status, получаю вот это:
Feb 24 19:18:41 aws-3tot.loc libvirtd[11904]: Failed to send audit message virt=kvm resrc=cgroup reason=allow vm=«VM» uuid=faa25f18-69b5-ea19-9ba6-31b73dd0641e cgroup=«/sys/fs/cgroup/devices/machine.slice/machine-qemu\x2dVM.scope/» cate. ration not permitted
Feb 24 19:18:41 aws-3tot.loc libvirtd[11904]: Failed to send audit message virt=kvm resrc=disk reason=start vm=«VM» uuid=faa25f18-69b5-ea19-9ba6-31b73dd0641e old-disk=»?» new-disk=«/var/lib/libvirt/images/VM.img»: Operation not permitted
Feb 24 19:18:41 aws-3tot.loc libvirtd[11904]: Failed to send audit message virt=kvm resrc=net reason=start vm=«VM» uuid=faa25f18-69b5-ea19-9ba6-31b73dd0641e old-net=? new-net=52:54:00:9c:4f:48: Operation not permitted
Feb 24 19:18:41 aws-3tot.loc libvirtd[11904]: Failed to send audit message virt=kvm resrc=mem reason=start vm=«VM» uuid=faa25f18-69b5-ea19-9ba6-31b73dd0641e old-mem=0 new-mem=1048576: Operation not permitted
Feb 24 19:18:41 aws-3tot.loc libvirtd[11904]: Failed to send audit message virt=kvm resrc=vcpu reason=start vm=«VM» uuid=faa25f18-69b5-ea19-9ba6-31b73dd0641e old-vcpu=0 new-vcpu=1: Operation not permitted
Feb 24 19:18:41 aws-3tot.loc libvirtd[11904]: Failed to send audit message virt=kvm op=start reason=booted vm=«VM» uuid=faa25f18-69b5-ea19-9ba6-31b73dd0641e vm-pid=21923: Operation not permitted
Feb 24 19:20:12 aws-3tot.loc libvirtd[11904]: cannot resolve symlink /var/lib/libvirt/boot/virtinst-vmlinuz.GU8QE5: No such file or directory
Feb 24 19:20:12 aws-3tot.loc libvirtd[11904]: cannot resolve symlink /var/lib/libvirt/boot/virtinst-initrd.img.evdo2m: No such file or directory
Feb 24 19:20:12 aws-3tot.loc libvirtd[11904]: Failed to send audit message virt=kvm op=stop reason=destroyed vm=«VM» uuid=faa25f18-69b5-ea19-9ba6-31b73dd0641e vm-pid=-1: Operation not permitted
Arch Linux
You are not logged in.
#1 2016-03-01 22:43:19
#2 2016-03-01 22:56:58
Anything in the journal?
R.E. Downgrading: check the wiki.
Mod note: Not a Kernel/Hardware issue, moving to Apps and DEs.
Last edited by WorMzy (2016-03-01 22:58:25)
Sakura:-
Mobo: MSI MEG B550 UNIFY // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
#3 2016-03-01 23:47:42
Same, forced to downgrade as well. A quick looks shows the service stays in ‘activating’:
#4 2016-03-02 02:52:54
it seems that there might some bug in the sd_notify implementation of libvirtd (wild guess from its behaviour)
#5 2016-03-02 07:45:54
Got the same problem.
Everything less than immortality is a complete waste of time!
#6 2016-03-02 10:44:26
I have this problem too and it seems that systemd just does not get notified. Until service times out, libvirt is fully operational, I can define/start a VM via virsh if I type fast.
#7 2016-03-02 13:30:59
Having similar issues here on 2 different host machines, one KDE, one Gnome. Interestingly «boxes» is working ok on the Gnome machine.
#8 2016-03-02 16:33:31
+1 for this issue. Same issue on 2 different host machines as well. Both solved by downgrading to previous libvirt package.
#9 2016-03-02 17:03:53
Yeah libvirt-1.3.1-2 working fine here, 1.3.2-1 and the problem returns.
#10 2016-03-02 17:19:08
Same for me, downgrade to 1.3.1-2 helped as workaround.
#11 2016-03-02 17:32:43
Same for me, but I could manage to use it anyway.
To check if it is problema with libvirtd I did:
After that I could use it normally.
#12 2016-03-02 18:23:59
#13 2016-03-02 18:45:54
#14 2016-03-03 02:29:08
A bug has been filed.
#15 2016-03-03 06:41:54
Just another confirmation
Thx KlipperKyle for the bug report!
#16 2016-03-03 08:11:39
AFAICT there are actually 2 issues here:
* The first only applies if you’re running kernel 4.4.1-2-ARCH. (or any 4.4 kernel, didn’t narrow it down).The kernel crashes if you try to start a VM. If you wait long enough, you get a «hanging_task» message, but then it’s already too late.
It’s a symptom, not the cause. Fix it by downgrading the kernel to 4.3 (http://ala.seblu.net/packages/l/linux/l … pkg.tar.xz)
* The second one is libvirtd, more concisely libvirtd.service. It defines libvirtd as Type=notify, but that doesn’t seem to work.
Workaround:
* copy /usr/lib/systemd/system/libvirtd.service to /etc/systemd/system and comment out the line Type=notify in the copy
* reload: systemctl daemon-reload
* start libvirtd: systemctl start libvirtd
Took me almost a week to figure this out. It’s so much fun watching an HP-Blade gather its intestines on every reboot.
Thermal Calibration and whatnot. If you have a HP Blade Center you know what I mean
Anyway, HTH! Share and enjoy.
#17 2016-03-03 08:50:28
AFAICT there are actually 2 issues here:
* The first only applies if you’re running kernel 4.4.1-2-ARCH. (or any 4.4 kernel, didn’t narrow it down).The kernel crashes if you try to start a VM. If you wait long enough, you get a «hanging_task» message, but then it’s already too late.
It’s a symptom, not the cause. Fix it by downgrading the kernel to 4.3 (http://ala.seblu.net/packages/l/linux/l … pkg.tar.xz)
* The second one is libvirtd, more concisely libvirtd.service. It defines libvirtd as Type=notify, but that doesn’t seem to work.
On the issue of the kernel crashing. Currently, I can reliably reproduce this on a 4.4 kernel by running certain VMs, while running other VMs do not result in a crash.
#18 2016-03-03 10:34:38
On the issue of the kernel crashing. Currently, I can reliably reproduce this on a 4.4 kernel by running certain VMs, while running other VMs do not result in a crash.
On the issue of libvirt timing out on startup. I noticed that it’s enough to revert to 1.3.1-2’s /usr/lib/libvirt.so.0.1003.1 to fix it. However, rebuilding 1.3.1-2 from source did not fix it, which leads me to believe that the source of the regression is in a libvirt build dependency.
#19 2016-03-03 13:01:07
I made clean Arch installation, just to avoid any possible issues with configuration, and it didn’t help
Here is the log with «debug» settings. hope it will be usefull
#20 2016-03-03 13:06:13
AFAICT there are actually 2 issues here:
* The first only applies if you’re running kernel 4.4.1-2-ARCH. (or any 4.4 kernel, didn’t narrow it down).The kernel crashes if you try to start a VM. If you wait long enough, you get a «hanging_task» message, but then it’s already too late.
It’s a symptom, not the cause. Fix it by downgrading the kernel to 4.3 (http://ala.seblu.net/packages/l/linux/l … pkg.tar.xz)
* The second one is libvirtd, more concisely libvirtd.service. It defines libvirtd as Type=notify, but that doesn’t seem to work.
On the issue of the kernel crashing. Currently, I can reliably reproduce this on a 4.4 kernel by running certain VMs, while running other VMs do not result in a crash.
Experience the same. Guest with Windows 10 and GPU pci-passthrough. Is this a kernel, qemu or libvirt issue?
Last edited by schlehmil (2016-03-03 14:06:34)
#21 2016-03-03 18:06:53
Am I having the same problem?
systemctl status libvirtd.service:
#22 2016-03-03 18:47:45
Workaround:
* copy /usr/lib/systemd/system/libvirtd.service to /etc/systemd/system and comment out the line Type=notify in the copy
* reload: systemctl daemon-reload
* start libvirtd: systemctl start libvirtd
It’s not exactly convenient to backrev the kernel (ZFS); although I saw the hanging issue with 4.4.1-2, doesn’t seem to be doing it just now.
#23 2016-03-03 22:54:15
Am I having the same problem?
You’re suffering from the libvirtd-problem:
The timeout is the clue. Implement the workaround and you should be fine.
#24 2016-03-04 00:10:09
Unfortuntly this trick with Type=notify did not help.
Tryed on 4.4.1 kernel
#25 2016-03-04 00:51:16
AFAICT there are actually 2 issues here:
.
* The second one is libvirtd, more concisely libvirtd.service. It defines libvirtd as Type=notify, but that doesn’t seem to work.
.
Workaround:
* copy /usr/lib/systemd/system/libvirtd.service to /etc/systemd/system and comment out the line Type=notify in the copy
* reload: systemctl daemon-reload
* start libvirtd: systemctl start libvirtd
This is has unblocked me (using kernel 4.1.18 and qemu-2.5-git). Thanks for sharing, sorry you had to go through all that!