How can I scroll back the output in FreeBSD's console without Scroll Lock?

18,281

Solution 1

As root, dump the keyboard map to a file

kbdcontrol -d > mykeys

Change the file so "Ctrl+NumLock" will set "Scroll Lock". Find line with scancode "base" 069, or where "nlock" fills the entire line. Edit column 3 from "nlock" to "slock". The line now looks like:

"069   nlock  nlock  slock  nlock  nlock  nlock  nlock  nlock   O"

As root, issue the command:

kbdcontrol -l mykeys

The solution was found here.

Solution 2

Laptop keyboards usually have a Fn key so that keys on a normal PC keyboard can be replicated. You should find that some combination of Fn and another key (hint: look for the blue text on your keys) will perform Scroll Lock. For instance, on my cheap netbook, Fn-F12 performs Scroll Lock.

Solution 3

I use tmux for that, you can install it from ports under /usr/ports/sysutils/tmux. Ctrl-b PgUp and Ctrl-b PgDn allow to scroll the console output in tmux. BTW, tmux has other great features, basically it is an advanced screen replacement.

Share:
18,281

Related videos on Youtube

Eugene Yarmash
Author by

Eugene Yarmash

By day, a software engineer. By night, also a software engineer.

Updated on September 18, 2022

Comments

  • Eugene Yarmash
    Eugene Yarmash over 1 year

    I've installed FreeBSD inside a VM on a laptop. As it turns out, the laptop keyboard has no Scroll Lock key, which is used for scrolling the screen back in FreeBSD's console. How can I scroll back the output without Scroll Lock?

    • mwfearnley
      mwfearnley over 6 years
      The question itself contained the answer I was looking for. My keyboard has Scroll Lock, but I didn't know I could use it!
  • Eugene Yarmash
    Eugene Yarmash over 11 years
    WIll it allow to scroll back the output which was before starting tmux? Actually, I want to see all the boot messages, i.e. the output till login.
  • Hennes
    Hennes over 11 years
    The boot message are stored in a file called dmesg.boot. less /var/run/dmesg.boot might help you.
  • Eugene Yarmash
    Eugene Yarmash over 11 years
    @Hennes This file contains only part of the messages, up to mounting the root filesystem. I needed the rest.
  • Hennes
    Hennes over 11 years
    That is probably because before it mounts the root filesystem it had no / and no /var. And thus nowhere to write the log file. --- Does your VM allow you to set up a serial port? If it does then you could use a serial console?
  • Coroos
    Coroos over 11 years
    For People using FreeBSD as a guest OS in a VirtualBox virtual machine on Mac OS X you can also remap Cntrl-Caps Lock. 058 clock clock slock clock clock clock clock clock O Typing Control-Caps Lock lets you scroll back on the console as far as the scrollback goes. Bliss!
  • Philip
    Philip over 11 years
    @Hennes dmesg.boot does contain everything since the kernel was started. It does not contain the bootstrap loader messages or any BIOS messages that weren't cleared.
  • Pablo Lalloni
    Pablo Lalloni over 7 years
    This does not work through ssh. Any tip on how to make it work?
  • CyberFonic
    CyberFonic about 3 years
    @Pablo Lalloni: these steps work for the syscons on the system you are connecting to with ssh. You need to perform the equivalent steps on the system you are connecting from. I say "equivalent steps" because if you are using Windows, Mac or Linux to connect to the FreeBSD system, the steps will be different.