How does one make console screenshots?

As the title suggests, I'm wondering how one can make screenshots of the console. I have of course searched the Forums and also "DuckDuckWent", but didn't find anything. As an example, the screenshots in the installation chapters of the Handbook look quite nice. Does anyone know how those were made?
 
wblock@ said:
That works and the fonts look nice. It's what I did for the screenshots in the bsdinstall(8) Handbook chapter.

The old way on a real console was using vidcontrol(1) -p and then convert the output.
Converting vidcontrol(1) output into an image (e.g. GIF or JPEG) looks rather labour intensive, so I'll go with the VM approach. Thanks to both of you. :)
 
wblock@ said:
graphics/scr2png is just one step, not bad.
Obviously, being way more aware of all the stuff that's in the ports tree than I am helps ;) I'll give it a try and see whether the result looks any good.

wblock@ said:
Using GIMP to capture the VM window is easy. Trimming off the VM menu bar is a little work
I usually use graphics/xv for screenshots. I know it's (very) old but it's much faster and isn't tied to a whole lot of runtime libraries either. However, since I'm going to have to get rid of the VM menu, I'll be using (The) GIMP anyway so I might just as well use the latter for capturing too, this time.
 
If you do script trimming that window through GIMP, please post it. GIMP scripting is something that could be useful but I have never tried.
 
Apologies for resurrecting a very old thread, but the suggested solution above is not available to me and I'm wondering if anything has changed in the last 9 years to address this issue... Like fonz above, I too have searched the forums, but to no avail...
I'm doing a FreeBSD install on a single 4TB HDD and want to use ZFS (if only for the experience!) I want to set up a non-standard partitioning scheme and I'd like to document it reasonably neatly especially as I'm relatively new to ZFS. I would therefore like to take screenshots at each command. Clearly at this point in the installation FreeBSD itself has not yet been installed...so none of the packages which I might normally expect exist yet. So, is there any way I can modify the installation USB to include access to any keyboard-shortcut screen-grabs which would have to be loaded before disk setup takes place? I had already considered the VM approach, but I don't have access to any system which would allow me to create a 4TB VM, though I guess I could use it to demonstrate the principle... but I'd rather document the actual process to avoid any errors!

Otherwise, I'm down to taking photographs!

Regards, Allan.
 
I see that I use to do (but haven't tested in years) opening another terminal, for example, using alt+F3, I would then use
Code:
vidcontrol -p < /dev/ttyv0 > shot1.scr
Then, using scr2png I would convert the scr to a png image. (It might also work with ImageMagick's convert but I've not tried that)

I would do that on the machine I was using for install, at least the vidcontrol < /dev/ttyv0 > shot1.scr.

Then, after installation, I would just scp the scr's over to another machine and do the scr2png there. Of course, you could also install scr2png on the machine you're installing, once finished with the install, and do the work on that machine.
 
If you want pictures of "libdialog" screens, such as from bsdinstall(8), and you can run them in an xterm, then there are the quite nifty Main Options "XHTML Screen Dump" and "SVG Screen Dump".
If xterm does not show the toolbar, open the "Main Options" menu with CTRL-Leftclick. Images are saved in your home directory with date and time in the file name. Should these options not exist, your xterm was not compiled with option SCRNDUMP enabled.
Both formats allow for vector fonts and you can get superb quality images. Open an SVG for example with Firefox and make it as big as you like. You can even change the fonts after making the screenshots by editing the XHTML or SVG.

bsdinstall.man.png


(This is an SVG, opened in Firefox, then screengrabbed with xv and saved as PNG, since the forum does not accept SVG).

I wish my 1987's amber monochrome monitor would have been this capable :)
 
go to /usr/ports/sysutils/tmux
CFLAGS=-static make
copy /usr/ports/sysutils/tmux/work/stage/usr/local/bin/tmux to the install media
edit install media's /etc/rc.local to run bsdinstall within tmux
use capture-pane -e and save-buffer to save the screen to a file that you can cat after in an xterm / ssh session an take a screen shot
 
Under X (Desktop/Gnome/Xfce/fvwm...) I use xwd
You may program a button to activate it by keystrike.
If you are under a virtual terminal (text only) I don't can figure out, why to make real screenshot there. and frankly I don't know how it can be done, since you may redirect the output into a textfile such as
Code:
# ll > directory.txt
 
schweikh welcome to FreeBSD Forums.

Please, is what you describe possible in a console (with neither a window manager nor a desktop environment)?
No. That's why I have qualified and introduced my answer with "if [...] and you can run them in an xterm".
I have often found the need to make high quality vectorized (scalable) screenshots of terminal screens for books. Any pixel image based solution just does not cut it and there are ways around it.
Hence my attempt to provide an alternative for use cases that can relax the "FreeBSD Console" requirement of yours a bit.

On a theoretical note, vt has undergone some refinement in the past (e.g. it maskerades as an xterm, since it uses TERM=xterm). It does not implement many of the xterm control sequences right now. But it is entirely possible to teach it to produce an SVG screen dump upon request, say, hitting the Print Screen key. That could be a Summer of Code project one fine day :)
 
I see that I use to do (but haven't tested in years) opening another terminal, for example, using alt+F3, I would then use
Code:
vidcontrol -p < /dev/ttyv0 > shot1.scr
Then, using scr2png I would convert the scr to a png image. (It might also work with ImageMagick's convert but I've not tried that)

I would do that on the machine I was using for install, at least the vidcontrol < /dev/ttyv0 > shot1.scr.

Then, after installation, I would just scp the scr's over to another machine and do the scr2png there. Of course, you could also install scr2png on the machine you're installing, once finished with the install, and do the work on that machine.
Thanks scottro, that looks like exactly what I need, provided that Alt-F3 works when booting from a freeBSD installation memory stick... My understanding (?!) is that the stick it boots a copy of freeBSD itself before showing the installation options screens, but I imagined it to be severely chopped down to offer just the minimum needed to do the installation... I'll try it tonight if I can, and let you all know how I get on... Allan.
 
No. That's why I have qualified and introduced my answer with "if [...] and you can run them in an xterm".
I have often found the need to make high quality vectorized (scalable) screenshots of terminal screens for books. Any pixel image based solution just does not cut it and there are ways around it.
Hence my attempt to provide an alternative for use cases that can relax the "FreeBSD Console" requirement of yours a bit.

On a theoretical note, vt has undergone some refinement in the past (e.g. it maskerades as an xterm, since it uses TERM=xterm). It does not implement many of the xterm control sequences right now. But it is entirely possible to teach it to produce an SVG screen dump upon request, say, hitting the Print Screen key. That could be a Summer of Code project one fine day :)
Thanks for the contribution schweikh.... I'm guessing that there is no way to run the console shown by the installation memory stick as an xterm. But I could very well be wrong!

Allan
 
or if you have the possibility use serial console
Thanks covacat, it might be possible to configure the installer memory stick to switch IO to a serial port, its an interesting idea. Then I could kermit to it from a windows PC just like in the olden days. Come to think of it though my freeBSD box does not possess any serial ports I don't think... :rolleyes: I could buy a card I guess!

Thanks very much for replying though it could well help other people if not me on this occasion...

Allan
 
go to /usr/ports/sysutils/tmux
CFLAGS=-static make
copy /usr/ports/sysutils/tmux/work/stage/usr/local/bin/tmux to the install media
edit install media's /etc/rc.local to run bsdinstall within tmux
use capture-pane -e and save-buffer to save the screen to a file that you can cat after in an xterm / ssh session an take a screen shot
 
Does the server have IPMI? Modern IPMI console access has a record/screenshot option. If it hasn't you could still make a screenshot of the console window. It's going to be a bitmapped screenshot but you can probably convert those to SVG using ImageMagick.
 
or if you have the possibility use serial console
Thanks covacat, it might be possible to configure the installer memory stick to switch IO to a serial port, its an interesting idea. Then I could kermit to it from a windows PC just like in the olden days. Come to think of it though my freeBSD box does not possess any serial ports I don't think... :rolleyes: I could buy a card I guess!

Thanks very much for replying though it could well help other people if not me on this occasion
go to /usr/ports/sysutils/tmux
CFLAGS=-static make
copy /usr/ports/sysutils/tmux/work/stage/usr/local/bin/tmux to the install media
edit install media's /etc/rc.local to run bsdinstall within tmux
use capture-pane -e and save-buffer to save the screen to a file that you can cat after in an xterm / ssh session an take a screen shot

...Ah, now this idea sounds more appropriate in my case. I wondered whether I could modify the usb install stick without breaking it and this seems to suggest I can! If there is enough room left on the USB anyway... Thanks again!

Allan
 
Back
Top