VNC send Ctrl+Alt+F1-F6 to server

virtual machinevnc

I've been trying to figure this out now for a while, I'm connecting to virtual machines through VNC, and by default you get a graphical or ncurses interface, and CTRL+ALT+F3 takes you to a console with debug information. However, Gentoo intercepts these commands.

How can I pass them through to the VNC server?

Edit: Some more details the VNC is being ran on the VM host, thus it just captures display output from the VM and sends any keys to the VM as if it's an actual keyboard connected to it. Hence I can switch to the TTY's if my CTRL+ALT+F1F6 keystrokes were getting through (Works fine when on Windows for example).

Best Answer

The proper solution: get a VNC client that can send those keys. Like jsbillings says, some clients give you the option of sending keys to the remote via a menu. With the standard xvnc4viewer, you can use the -MenuKey option to set the key that activates the menu. Again, as per jsbillings' answer, the default key is F8.

The hack: if you have a shell running on the remote server, try chvt 3 (or sudo chvt 3). On the console, you don't need Ctrl+Alt+F#, you can use Alt+F# (or Alt+ repeatedly) to go back to the X server's TTY. Or just log in and say sudo chvt 7; logout (or whatever the X VT is).

The stupid kludge: since Ctrl+Alt+F# is captured early by the X server, the direct (and hard) way is to disable (temporarily or permanently) these keys. This requires you to modify your X configuration and is an annoying thing to do, and probably a bad idea besides. Go with one of the others. :)

Related Question