I've created a virtual machine using virt-install with graphics --none. I want to enable vnc. I've tried

virsh -c qemu:///system qemu-monitor-command vm171-SC-1 --hmp change vnc :3

but it doesn't work

virsh -c qemu:///system qemu-monitor-command vm171-SC-1 --hmp info vnc
Server: disabled

How can I enable vnc after running virt-install? I don't want to install with vnc enabled (i.e --graphics vnc,listen=,port=) is not an option because I want it to send its output to the same termnial that I am in.


Edit the VM config with virsh edit and add the relevant bit of XML within <devices>?

<graphics type='vnc' port='-1' autoport='yes' listen=''/>

It should also be possible to replicate this using virt-xml, something like this:

virt-xml --build-xml --graphics vnc,port=-1,autoport=yes,listen=


virt-xml <yourVMname> --add-device --graphics vnc,port=-1,autoport=yes,listen=

However, it looks like it doesn't support the autoport keyword as of version 1.3.2 (Ubuntu 16.04 LTS), so it looks like this part would have to be added separately.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.