Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a way to to edit the listen address of a Libvirt-Machine on the fly? At the moment it seems like when I want to edit the listen address, I have to shut down the corresponding VM first, then edit the xml and redefine the domain.

I'm currently building a small web application (libvirt frontend) where I would like to implement a function called "enable / disable vnc" - however, that doesn't seem possible to me at the moment if the only way is shutting down the vm.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

You have to go to QEMU Monitor and run:

change vnc display,options

Where display is <host>:<display_number> or unix:<path> or none. Options are options for display. See: http://wiki.qemu.org/download/qemu-doc.html#sec_005finvocation

E.g. To change the port to 5905 and accept VNC connections for any host:

change vnc :5

If you are using virsh, use "qemu-monitor-command":

virsh # qemu-monitor-command <domain> --hmp change  vnc :5
share|improve this answer
    
you saved me about : how to disable vnc display. For those who search here is the command : qemu-monitor-command <domain> --hmp change vnc none –  Antoine Rodriguez Apr 6 '13 at 11:21

No, it doesn't seem possible to change the VNC display dynamically. I don't think that KVM supports it anyway, so libvirt can't provide it.

What you could do is put something in front of the VNC port as a proxy, like socat. You'd setup the VM on a localhost address which can't be accessed from outside, and then to enable it start a proxy on the external IP.

share|improve this answer
    
Right QEMU does not support this: code.metager.de/source/xref/libvirt/src/qemu/… (except password) –  lzap Apr 5 '13 at 14:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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