You are not logged in.

#1 2025-08-15 09:04:40

gtarch
Member
Registered: 2022-10-14
Posts: 48

[SOLVED] virt manager Failed to create PTY: Permission denied

I'm trying to create a virtual machine with virt-manager on a laptop, but I'm getting the following error:

Unable to complete install: 'internal error: process exited while connecting to monitor: 2025-08-15T08:55:12.573414Z qemu-system-x86_64: -chardev pty,id=charserial0: Failed to create PTY: Permission denied'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 71, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/virt-manager/virtManager/createvm.py", line 2008, in _do_async_install
    installer.start_install(guest, meter=meter)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 726, in start_install
    domain = self._create_guest(
            guest, meter, initial_xml, final_xml,
            doboot, transient)
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 667, in _create_guest
    domain = self.conn.createXML(initial_xml or final_xml, 0)
  File "/usr/lib/python3.13/site-packages/libvirt.py", line 4594, in createXML
    raise libvirtError('virDomainCreateXML() failed')
libvirt.libvirtError: internal error: process exited while connecting to monitor: 2025-08-15T08:55:12.573414Z qemu-system-x86_64: -chardev pty,id=charserial0: Failed to create PTY: Permission denied

I'm in the llbvirt and tty groups. The same configuration works on a number of other Arch machines. I have no idea what's going on here.

My virt-manager version is 5.0.0-1

Last edited by gtarch (2025-08-16 05:30:55)

Offline

#2 2025-08-15 10:16:49

cryptearth
Member
Registered: 2024-02-03
Posts: 2,009

Re: [SOLVED] virt manager Failed to create PTY: Permission denied

do you try to create a user vm or a system vm?
get you asked for root password on start of virt-manager?

Offline

#3 2025-08-15 10:32:04

gtarch
Member
Registered: 2022-10-14
Posts: 48

Re: [SOLVED] virt manager Failed to create PTY: Permission denied

I just choose "new virtual machine". There is no option for user or system one.
I'm not asked for a password when I start virt-manager.

Offline

#4 2025-08-15 15:15:02

tekstryder
Member
Registered: 2013-02-14
Posts: 504

Re: [SOLVED] virt manager Failed to create PTY: Permission denied

$ grep -E "^user|^group" /etc/libvirt/qemu.conf

Offline

#5 2025-08-15 15:28:05

cryptearth
Member
Registered: 2024-02-03
Posts: 2,009

Re: [SOLVED] virt manager Failed to create PTY: Permission denied

usually when I start virt-manager I get asked for root password and have a connection of qemu/kvm to qemu:///system
virt-manager also offers a qemu/kvm connection to qemu:///session which is called "qemu/kvm user-session" - but it also warns "this is not standard, network operations are limited"

Offline

#6 2025-08-15 15:33:09

tekstryder
Member
Registered: 2013-02-14
Posts: 504

Re: [SOLVED] virt manager Failed to create PTY: Permission denied

cryptearth wrote:

usually when I start virt-manager I get asked for root password

This is covered in the wiki:

https://wiki.archlinux.org/title/Libvirt#Configuration

Offline

#7 2025-08-15 17:12:50

gtarch
Member
Registered: 2022-10-14
Posts: 48

Re: [SOLVED] virt manager Failed to create PTY: Permission denied

grep -E "^user|^group" /etc/libvirt/qemu.conf

This doesn't find anything.

Offline

#8 2025-08-15 20:07:56

tekstryder
Member
Registered: 2013-02-14
Posts: 504

Re: [SOLVED] virt manager Failed to create PTY: Permission denied

Do you specifically require the serial console?

gtarch wrote:

This doesn't find anything.

Ensure that the user account attempting to create the VM has the required permissions.

E.g. edit the relevant section in /etc/libvirt/qemu.conf for the user:

user = "gtarch"
group = "gtarch"

Offline

#9 2025-08-16 05:30:08

gtarch
Member
Registered: 2022-10-14
Posts: 48

Re: [SOLVED] virt manager Failed to create PTY: Permission denied

tekstryder wrote:

Do you specifically require the serial console?

No, it's a default.

tekstryder wrote:

Ensure that the user account attempting to create the VM has the required permissions.

E.g. edit the relevant section in /etc/libvirt/qemu.conf for the user:

I modified the config file, but the problem remained.

I did try removing the console device and that does work, but I have to wonder why I have this problem only on this laptop.
Anyway I can create VMs now by removing the console device. Thank you for your help!

Edit: Actually I forgot to restart libvirtd after modifying the config. I did it now and the problem is solved. I still have to wonder why it appears only on this machine, but at least there is a solution now.

Last edited by gtarch (2025-08-16 05:46:36)

Offline

#10 2025-08-16 13:33:55

tekstryder
Member
Registered: 2013-02-14
Posts: 504

Re: [SOLVED] virt manager Failed to create PTY: Permission denied

gtarch wrote:

Actually I forgot to restart libvirtd

I should have included this, oops.

On that note, perhaps consider switching to modular daemons and socket-activated services as well.

https://libvirt.org/daemons.html#modular-driver-daemons

I did this within the past year, and went with a more minimal approach than the full qemu set suggested in the doc.

Last edited by tekstryder (2025-08-16 14:31:58)

Offline

Board footer

Powered by FluxBB