Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 9 down vote accepted

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.

share|improve this answer
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! – Coroos Oct 8 '12 at 15:38
since this is a top result, I'll add that to make this change permanent (after reboot) follow the steps above, and then mv mykeys /usr/share/syscons/keymaps/mykeys.kbd then edit your rc.conf file and add a line with keymap="mykeys" – aron.duby Oct 6 '14 at 15:57

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.

share|improve this answer

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|improve this answer
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. – eugene y Aug 23 '12 at 8:05
No, it will not. – Alex Aug 23 '12 at 8:08
The boot message are stored in a file called dmesg.boot. less /var/run/dmesg.boot might help you. – Hennes Aug 23 '12 at 11:06
@Hennes This file contains only part of the messages, up to mounting the root filesystem. I needed the rest. – eugene y Aug 23 '12 at 12:58
@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. – Chris S Oct 8 '12 at 15:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.