In KVM how to disable console ttyS0 from the virt xml file

I got an issue in a RH6.3 VM host , the issue is ttyS0 is always respawning and piling up /var/log/messages with errors.The customer is OK to have tty0 as the serial terminal but ttyS0 needs to be disabled.

Below is the mention of lines that contain 'serial' string from the xml file . How can I edit them to disable ttyS0 and keep tty0 alive.

</disk>
    <disk type='block' device='disk' snapshot='no'>
      <driver name='qemu' type='qcow2' cache='none' error_policy='stop' io='native'/>
      <source dev='/rhev/data-center/mnt/blockSD/200409ba-6071-4476-94e2-68eb2cd1f079/images/8fe6780f-17cf-4d89-b993-337bfcef9745/820cabac-917a-4b37-aca6-1bba7f1a2316'/>
      <target dev='vda' bus='virtio'/>
      <serial>8fe6780f-17cf-4d89-b993-337bfcef9745</serial>
      <boot order='1'/>
      <alias name='ua-8fe6780f-17cf-4d89-b993-337bfcef9745'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </disk>
<controller type='virtio-serial' index='0' ports='16'>
      <alias name='ua-780dcfc7-2be3-4270-9bc3-c53a0ca52863'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>
<channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channels/1400553f-8127-44dd-9814-1b49a217472b.ovirt-guest-agent.0'/>
      <target type='virtio' name='ovirt-guest-agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
</channel>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channels/1400553f-8127-44dd-9814-1b49a217472b.org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>
    </channel>
<channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='3'/>
     </channel>

Could someone help here or tell me how to update it to add the serial console.

Why not user standard Linux configs to disable ttyS0?

For example, see:

Ubuntu: SerialConsoleHowto

1 Like