Tux

...making Linux just a little more fun!

Switching VT Remotely?

Dave Lindquist [dlindquist at castoracer.com]


Fri, 04 May 2007 15:34:39 -0600

Is there a way to switch the VT of a linux box remotely?

Specifically, I have X running on my desktop, and have trained my wife to click the KDE "switch user" to log in herself (and get her email), which allocates another VT for her.

This works really well -- I can leave myself logged in on VT7, and she can use VT8. Unfortunately, she doesn't know how to switch it back to VT7 when she's done (Ctrl-Alt-F7).

I have a VNC server installed as an X module, that allows me to remotely VNC to my X session (on VT7), but due to X quirks, I can only VNC to it if VT7 is "selected" -- ie, if she's left the machine sitting on VT8, I can't VNC in.

So, I would like to know if there is a way for me to switch which VT is "selected" remotely (ie, SSH in, su to root, and do something to switch VTs).

Thanks in advance! ;-)


Top    Back


Thomas Adam [thomas.adam22 at gmail.com]


Fri, 4 May 2007 22:38:58 +0100

On Fri, May 04, 2007 at 03:34:39PM -0600, Dave Lindquist wrote:

> Is there a way to switch the VT of a linux box remotely?

man chvt

-- Thomas Adam

-- 
"He wants you back, he screams into the night air, like a fireman going
through a window that has no fire." -- Mike Myers, "This Poem Sucks".

Top    Back


Dave Lindquist [dlindquist at castoracer.com]


Fri, 04 May 2007 15:45:50 -0600

Thomas Adam wrote:

> On Fri, May 04, 2007 at 03:34:39PM -0600, Dave Lindquist wrote:
>> Is there a way to switch the VT of a linux box remotely?
> 
> man chvt

Thanks!

OK, now I feel pretty stupid -- somehow I managed to miss the (in retrospect) obvious, after using apropos, esearch, and Google...


Top    Back


Ben Okopnik [ben at linuxgazette.net]


Fri, 4 May 2007 17:44:12 -0400

On Fri, May 04, 2007 at 03:34:39PM -0600, Dave Lindquist wrote:

> Is there a way to switch the VT of a linux box remotely?
> 
> Specifically, I have X running on my desktop, and have trained my wife 
> to click the KDE "switch user" to log in herself (and get her email), 
> which allocates another VT for her.
> 
> This works really well -- I can leave myself logged in on VT7, and she 
> can use VT8.  Unfortunately, she doesn't know how to switch it back to 
> VT7 when she's done (Ctrl-Alt-F7).
> 
> I have a VNC server installed as an X module, that allows me to remotely 
> VNC to my X session (on VT7), but due to X quirks, I can only VNC to it 
> if VT7 is "selected" -- ie, if she's left the machine sitting on VT8, I 
> can't VNC in.
> 
> So, I would like to know if there is a way for me to switch which VT is 
> "selected" remotely (ie, SSH in, su to root, and do something to switch 
> VTs).
> 
> Thanks in advance! ;-)

You should be able to handle that via the 'chvt' command executed via SSH. Something like

ssh your_wifes_username@host 'chvt 7'
should do it.

-- 
* Ben Okopnik * Editor-in-Chief, Linux Gazette * https://LinuxGazette.NET *

Top    Back


Ben Okopnik [ben at linuxgazette.net]


Fri, 4 May 2007 18:18:11 -0400

[ Please remember to CC TAG on any emails you send out related to this thread; thanks. ]

On Fri, May 04, 2007 at 03:55:40PM -0600, Dave Lindquist wrote:

> Ben Okopnik wrote:
> >On Fri, May 04, 2007 at 03:34:39PM -0600, Dave Lindquist wrote:
> >>Is there a way to switch the VT of a linux box remotely?
> >``
> >ssh your_wifes_username@host 'chvt 7'
> >''
> 
> Thanks!  Yours is the second response that said the same thing...
> 
> And I now feel very stupid for the amount of Google searches, etc that I 
> did and still managed to miss this very obvious command... ;-)

Dave, don't let it throw you; there are more Unix commands out there than are dreamt of in anyone's philosophy.

ben@Tyr:~$ <Tab><Tab>
Display all 2664 possibilities? (y or n)
Just recently, while teaching an introductory Unix class in Milwaukee, I saw a short presentation done by one of the client's sysadmins; in it, he discussed using the 'groups' command to show which groups your current UID belongs to. [shrug] As obvious a command as it is - and as obvious of a function as it serves - I had never heard of it before (I always just used 'id', myself.)

-- 
* Ben Okopnik * Editor-in-Chief, Linux Gazette * https://LinuxGazette.NET *

Top    Back