Libvirt troubles

Hey. I’m trying to start a VM on Arch with libvirt. When I start up the VM, I get the following error.

Unable to complete install: ‘internal error: process exited while connecting to monitor: 2017-12-15T19:18:27.468787Z qemu-system-x86_64: -chardev pty,id=charserial0: char device redirected to /dev/pts/0 (label charserial0)
Could not access KVM kernel module: Permission denied
2017-12-15T19:18:27.468880Z qemu-system-x86_64: 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 2545, in _do_async_install
guest.start_install(meter=meter)
File “/usr/share/virt-manager/virtinst/guest.py”, line 498, in start_install
doboot, transient)
File “/usr/share/virt-manager/virtinst/guest.py”, line 434, in _create_guest
domain = self.conn.createXML(install_xml or final_xml, 0)
File “/usr/lib/python2.7/site-packages/libvirt.py”, line 3658, in createXML
if ret is None:raise libvirtError(‘virDomainCreateXML() failed’, conn=self)
libvirtError: internal error: process exited while connecting to monitor: 2017-12-15T19:18:27.468787Z qemu-system-x86_64: -chardev pty,id=charserial0: char device redirected to /dev/pts/0 (label charserial0)
Could not access KVM kernel module: Permission denied
2017-12-15T19:18:27.468880Z qemu-system-x86_64: failed to initialize KVM: Permission denied

I’m a noob and the above text means nothing to me, so can someone tell me what’s going on? Thanks!

Has your user been added to the appropriate libvirt group(s)? You’ll also need to log off and back on.

Uh, lol how do I add my user to the appropriate libvirt groups? I’ll need a p indepth explanation

Well, in Ubuntu you have to add yourself to the group libvirt. So you can, as root, edit your /etc/group file, find the line that looks something like,

libvirt:x:130:

and make it,

libvirt:x:130:yourusername

Then log off and back on.

Or do something like this as root,

usermod -G libvirt yourusername

There might be a specific section in the Arch wiki for this. So if you don’t seem to have a libvirt group, check it out and see if they’re doing something else with groups.

Okay you’re a genius. I did what you said and it’s working great now. Thanks so much dude

1 Like