Permission denied when using pty type serial device with stdio_handler = "file"

Solution Verified - Updated -

Issue

  • Below error occurs during start VM when using pty type serial device with stdio_handler = "file"

    1. Confirm qemu.conf whether stdio_handler is setting to file

      # cat /etc/libvirt/qemu.conf
      ...
      stdio_handler = 'file'
      
    2. Check if pty serial type is in use

      #virsh dumpxml  <vm>
      ...
       <serial type='pty'>
            <log file='/var/lib/libvirt/console.log1'/>
      
    3. Check owership of /var/lib/libvirt/console.log1 is root:root

    4. Start Virtual Machine

      # virsh start <vm>
      internal error: qemu unexpectedly closed the monitor:
      qemu-kvm -chardev pty,id=charserial0,logfile=/var/lib/libvirt/<vm>/console.log:  Unable to open logfile var/lib/libvirt/<vm>/console.log
      Permission Denied.
      

Environment

  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8.0-8.4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content