Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

At home I'm setting up a CentOS 5.5 server that will be running a bunch of KVM VMs. Normally pressing the CTRL-SHIFT-Fn combination on the attached keyboard switches to terminals on the host machine. What I'd like to do instead is have some number of CTRL-SHIFT-Fn combinations attach to the VMs that are running, in essence have the key combination behave like a KVM switch.

So for example, pressing CTRL-SHIFT-F1 displays a text terminal for the host machine, but pressing CTRL-SHIFT-F2 displays an X session that is running on one VM and pressing CTRL-SHIFT-F3 displays yet another VM terminal.

Some of the VMs will have X installed, so I'd like the solution to behave just like a 'normal' X session: Presents an X login screen if I haven't already logged in.

How can this be done?

share|improve this question
its a bit foggy what you want: a) you want to look at the xsession running inside the VM? and b) i dont understand "i would like it to behave the same as pressing" ... pressing what? or do you want to log off the xsession if you detach from the VM? – akira Feb 5 '11 at 6:31
@akira - I apologize for the lack of clarity in my question. What I would like would be to map various CTRL-SHIFT-Fn keys to GDM/X sessions from various Xen VMs. So instead of getting a GDM screen when the host computer boots up, I get login screens for some set of VMs that start up at system start up. – Chris Gow Feb 8 '11 at 2:29
well, edit your question and reclarify it. – akira Feb 8 '11 at 4:14
quite ambitious :) i star your question to see if ANYONE solves this :) – akira Feb 9 '11 at 15:18

I can see two ways of solving this:

  1. Set up multiple X sessions on tty2 through ttyN, all of which by default start the virt-manager and connect to the appropriate virtual machine, and run the console full screen.
  2. Enable XDMCP in GDM on the virtual machines, allowing connections over the VM's private subnet. Set up multiple X sessions on tty2 through ttyN, setting them use XDMCP to connect to the appropriate VM's X server.
share|improve this answer

It would help if you tell what virtualization tool you use. With VirtualBox, that would be quite easy using the internal rdp (or vnc with OSE edition) service.

share|improve this answer
I'm using xen virtualization, I've updated the question to clarify – Chris Gow Jan 5 '11 at 23:59
@jillagre: for comments use comments, not answers. – akira Feb 5 '11 at 6:27
That was both a comment and an answer. I might have split it indeed. – jlliagre Feb 5 '11 at 13:51

Your Answer


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.