Cockpit and KVM: Console 'display output is not active' Error

I've recently moved from VMware to KVM for my home virtualization needs and ran into an issue. When using Cockpit or virt-manager to view a VM console I'd sometimes get the error message "Display output is not active".

Display output is not active
Display output is not active

This is related to the default video card Cockpit configures for a new VM (virtio). When enlarging the console this error would often show up. Changing the VM to use the "vga" driver fixes this issue.

You can change the video card type using virsh or virt-manager. Below are steps how to change your VM to use the "vga" driver using virsh:

List your currently defined VMs:

1[root@VMHost-01 ~]# virsh list
2 Id   Name             State
3--------------------------------
4 1    TestVM           running

Dump the relevant lines from your VM config to confirm the driver currently in use:

1[root@VMHost-01 ~]# virsh dumpxml TestVM | grep -A 5 '<video>' | grep 'model type'
2      <model type='virtio' heads='1' primary='yes'/>

Note the "virtio" model type. You can change this by using virsh and vi:

1[root@VMHost-01 ~]# virsh edit TestVM

This will open up the VM/domain XML configuration file. Use your arrow keys to find the video section and change the model to this:

1<model type='vga' vram='16384' heads='1' primary='yes'/>

Save your changes then you will need to stop and start your VM. A restart will not reload the config file so a full stop is required. You can do this with virsh like this:

1[root@VMHost-01 ~]# virsh destroy TestVM
2Domain 'TestVM' destroyed
3[root@VMHost-01 ~]# virsh start TestVM
4Domain 'TestVM' started

As for why the virtio driver does this, I'm not sure. My VMs are basically all Linux VMs with no GUI so this solution is good enough for my use case.