LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 03-05-2012, 06:03 AM   #1
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757

Rep: Reputation: 145Reputation: 145
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?
 
Old 03-05-2012, 06:48 AM   #2
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
try virsh send-key $combo
 
Old 03-05-2012, 11:41 AM   #3
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757

Original Poster
Rep: Reputation: 145Reputation: 145
Quote:
Originally Posted by dyasny View Post
try virsh send-key $combo
That's not the kind of solution I'm looking for, because it would require executing a command in a shell outside the VNC window instead of operating directly in the VNC window.

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.
 
Old 03-05-2012, 12:39 PM   #4
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
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.
 
Old 03-05-2012, 09:38 PM   #5
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757

Original Poster
Rep: Reputation: 145Reputation: 145
Code:
$ virsh list
 Id Name                 State
----------------------------------
Like I said, I don't have any domain-ids, even though I do have one VM running:

Code:
$ ps auxww | grep qemu
ken      31741  7.2  4.0 1379596 249160 ?      Sl   22:16   0:14 qemu-kvm -boot c -hda /vm/ArchLinux.qemu -vnc :1 -m 1G -name ArchLinux -net nic -net tap,script=no,downscript=no,ifname=tap1 -usbdevice tablet
 
Old 03-07-2012, 12:45 AM   #6
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
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
 
Old 03-07-2012, 05:36 AM   #7
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757

Original Poster
Rep: Reputation: 145Reputation: 145
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.
 
Old 03-07-2012, 08:05 AM   #8
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Guest to Host message passing - guest's memory usage statistics & guest's IP address Prince_Pangeni Linux - Virtualization and Cloud 2 03-03-2012 03:06 AM
how to pass MySQL user/pass securely in shell script? digity Linux - Newbie 5 01-07-2010 05:48 AM
Planning to change root pass and oracle system pass sathyguy Red Hat 1 12-20-2005 09:53 PM
remote desktop (vnc) double keystrokes issue mattl SUSE / openSUSE 10 05-06-2005 05:04 AM
[SAMBA]HOWTO Sharing vfat or any other mounted fs as guest(no pass when connect) SRKI-Neo Linux - Networking 0 10-20-2004 03:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 06:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration