How do I pass more keystrokes to the guest via VNC?
I'm experimenting running various guests in KVM on a Fedora host using tightvnc to view the guest desktop. But a lot of keystrokes I would like to pass to the guests are consumed by the host's window manager.
Of course, I could go through the window manager's control application and tell it to not use each key combination I want to pass, but then I couldn't use it on the host. It sure would be nice if I could press a modifier key that would cause the next key combination to be passed to the host application with the focus (VNC). Does anyone know of any such mechanism, or any other solution? |
try virsh send-key $combo
|
Quote:
However, it's an interesting lesser-preferable possibility. But I can't use it because virsh seems to require a domain-id, which I don't have. |
domain-id is simply the name or number of the VM in question. Run `virsh list` to see the available running VMs
As for VNC... well, it's imperfect, try to use SDL or SPICE instead. |
Code:
$ virsh list Code:
$ ps auxww | grep qemu |
The VM you have running seems to not have been started using libvirt. You're probably using qemu-kvm directly to run it, and this is why libvirt cannot keep track of it.
What you need to do is create a VM definition for this VM using virsh/virt-manager/virt-install, and then start it using virsh or virt-manager. When the VM is operated this way, it will appear in the virsh list output |
libvirt is one of those things I've been meaning to investigate to see if it's worth the effort to use. And apparently this capability to pass key combination could be one convenience it offers.
But how does it do it? Wouldn't it be simpler to just do whatever it does to pass the combination? I know a monitor port can be used to send commands to qemu-kvm. That's another thing I've been meaning to look into. I'm guessing that's the mechanism libvirt uses to pass the key combination. My experience is that software packages (and government entities) that try to take control and do things for you often get in the way and make it awkward to do some things. I'm suspicious libvirt is one of those. |
libvirt is the de-facto standard for managing kvm VM instances. You can do everything libvirt does through qemu-kvm command line, but it's not scale-able - you have no means of maintaining consistent VM definitions, consistent APIs to perform tasks, and have to do absolutely everything manually.
Not to mention all the tools around libvirt, like guestfish and virt-v2v, and all the higher end management platforms. If you stick to a single VM and never are going to go any higher, it doesn't matter much, but if this is a growing setup and not just something to play with, you definitely need a management framework. |
All times are GMT -5. The time now is 10:55 AM. |