Possible Duplicate:
How to enable numlock at boot time for login screen?

I use numbers in my password and would therefore like to start Ubuntu with Num-Lock enabled. This would also be handy in a terminal window, that is Ctrl+Alt+F1.


3 Answers 3


Many (most?) systems have a BIOS setting for this. This can be set in the BIOS and will apply to all OSes installed on the system.

You will need to consult your system documentation or your system vendor for information about how to enter the BIOS and what the setting is named. (Though often pressing one of F1, F2, F10, or F12 during boot will access the BIOS settings where you can look for something like "startup numlock behavior" or similar.)

  • Yeah. Try this before the previous, but still very excellent, answer. Aug 4, 2010 at 19:52
  • 1
    I have this Num lock enabled in BIOS but still Num lock is off when Ubuntu boots. when I had windows, there was no such issue of Num lock being off on the boot up. So there has to be something done on the OS. Oct 22, 2010 at 14:04

I think the correct place to set this is


Line 65-66 look like this

#Turn on numlock by default

Uncomment line 66 to look like this

#Turn on numlock by default

EDIT: Having looked into this further you can enable numlock at the GDM level (if you wish) by installing numlockx like this

sudo apt-get install numlockx

and setting the configuration in /etc/gdm/Init/Default like this

if [ -x /usr/bin/numlockx ]; then
      /usr/bin/numlockx on

There is also this blog post that might be useful

  • Hmm.. i wonder if this affects GDM as well. If it does, this is the easiest way to do it.
    – Ressu
    Aug 5, 2010 at 5:05
  • I also use the numlockx option.
    – nathanvda
    Aug 5, 2010 at 9:21
  • Looking at the blog post, the "kdb" in your post should be "kbd". There is a difference between a Kernel DeBugger" and a "KeyBoarD" ;-)
    – Antony
    Aug 6, 2010 at 10:54
  • Yes you are right,. I have amended the typo. Aug 6, 2010 at 14:06
  • I tried it on ubuntu 10.04. It works on GDM login window. However the num lock is off after login my account. Any other script or session to turn it off again?
    – Kane
    Dec 9, 2010 at 7:02

You can alter the numlock state with setleds command. The setleds manual lists an example how to alter TTY states so that numlock is on by default:

        for tty in $INITTY; do
             setleds -D +num < $tty

You can put that in /etc/rc.local and it is set during the startup of your workstation.

For GDM you can follow the guide here: https://help.ubuntu.com/community/NumLock

  • That doesn't address prior to workstation startup (during gdm) Aug 4, 2010 at 12:19
  • Hmm.. you are right, added more instructions
    – Ressu
    Aug 4, 2010 at 12:39
  • I notice the linked page has the same code as you do except they only do 1-6 and do not use the INITTY variable.
    – Antony
    Aug 4, 2010 at 22:49
  • It shouldn't really matter since setleds doesn't complain about the ttys that aren't in use. So both examples are functionally equivalent
    – Ressu
    Aug 5, 2010 at 5:05

Not the answer you're looking for? Browse other questions tagged .