This site is now 100% read-only, and retired.

XML logo

looking at contents of virtual terminal remotely?
Posted by dkg on Thu 10 Jan 2008 at 15:50
There is a machine i have remote superuser access to which i know has some interesting info on one of the VTs (/dev/tty2 in particular in this case). I can try to scare up someone physically on-site to plug in a monitor, and painfully transcribe the text there by hand, but i'd prefer the simpler, politer (and less error-prone) option of getting the data digitally myself via ssh.

Any ideas how i could find the text that is already displayed on that VT? The machine is running a stripped-down debian etch, but i could add packages if i need to.

More details: there was a local shell running on that VT, and the data that i'm interested in is the output of a process that had been run from that shell but is now terminated. So it's not in system logs or anything. I think just connecting to /dev/tty2 (with, say, cat) would give me only new text emitted on that console. But i want the stuff that's already been output.

I figure the data must be stored in RAM someplace, so it should be accessible somehow (unless it's maybe only in video RAM -- then i'd be less sure of being able to find it). Thanks for any suggestions!

 

Comments on this Entry

Re: looking at contents of virtual terminal remotely?
Posted by endecotp (86.6.xx.xx) on Thu 10 Jan 2008 at 17:55
[ View Weblogs ]
screendump -s 2

[ Parent ]

Re: looking at contents of virtual terminal remotely?
Posted by Anonymous (77.248.xx.xx) on Thu 10 Jan 2008 at 18:00
settterm -dump 2; cat screen.dump

[ Parent ]

Re: looking at contents of virtual terminal remotely?
Posted by dkg (66.108.xx.xx) on Thu 10 Jan 2008 at 18:01
[ View Weblogs ]
Thanks tons! What does the -s do? I found that plain ol':
~ # screendump 2
worked for me.

[ Parent ]

Re: looking at contents of virtual terminal remotely?
Posted by Steve (82.32.xx.xx) on Thu 10 Jan 2008 at 18:57
[ View Weblogs ]

Even better - you can interact with a session via:

apt-get install conspy
conspy 2

Press ESC three times to exit ..

Steve

[ Parent ]

Re: looking at contents of virtual terminal remotely?
Posted by Anonymous (204.13.xx.xx) on Thu 22 Jan 2009 at 17:10
Any ideas for dumping pts/* ttys?

[ Parent ]

Re: looking at contents of virtual terminal remotely?
Posted by Anonymous (86.6.xx.xx) on Thu 22 Jan 2009 at 17:16
The kernel doesn't keep track of what's "on the screen" of a pseudo-terminal - unlike a console - so no, there's no directly equivalent way of doing that. Instead you'll need to somehow intercept all writes to the terminal and feed them into another terminal emulator.

[ Parent ]

Re: looking at contents of virtual terminal remotely?
Posted by endecotp (86.6.xx.xx) on Thu 10 Jan 2008 at 18:01
[ View Weblogs ]
or just cat /dev/vcs2

[ Parent ]

Re: looking at contents of virtual terminal remotely?
Posted by simonw (84.45.xx.xx) on Fri 11 Jan 2008 at 00:37
[ View Weblogs ]
I thought it was practically impossible to see content that was already displayed. Shows what I know.

Perhaps I should ask for more impossible things.

Can these folk make me rich enough that I can stay at home and write chess software for fun?

[ Parent ]

chess, money: (was: Re: looking at contents of virtual terminal remotely?)
Posted by Anonymous (83.215.xx.xx) on Sat 12 Jan 2008 at 23:45
Making a living with chess software?
Well, not entirely impossible: just beat:
http://en.wikipedia.org/wiki/Hydra_(chess)
and find some wealthy sponsor for it ;)

ad. money: I've found the following links interesting:
http://alumnus.caltech.edu/~dank/advice.htm
http://www.amazon.com/exec/obidos/ISBN=0140167153/2339-4323384-44 0008

[ Parent ]

Re: looking at contents of virtual terminal remotely?
Posted by Utumno (60.248.xx.xx) on Wed 23 Jan 2008 at 05:45
[ View Weblogs ]

Heh. I am just porting my Windows chess-problem solving utility to Linux :)

[ Parent ]