Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

marked as duplicate by nitstorm, Mik, belacqua, Tom Brossman, Thomas W. Nov 12 '12 at 21:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
There is another post with an accepted answer for this question - How to enable numlock at boot time for login screen? Hence, voting for this to be closed so that future visitors can be directed to that question instead. –  nitstorm Nov 11 '12 at 13:31

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.)

share|improve this answer
    
Yeah. Try this before the previous, but still very excellent, answer. –  Rodger Cooley Aug 4 '10 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. –  Gaurav Butola Oct 22 '10 at 14:04

I think the correct place to set this is

/etc/kbd/config

Line 65-66 look like this

#Turn on numlock by default
#LEDS=+num

Uncomment line 66 to look like this

#Turn on numlock by default
LEDS=+num

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
fi

There is also this blog post that might be useful

share|improve this answer
    
Hmm.. i wonder if this affects GDM as well. If it does, this is the easiest way to do it. –  Ressu Aug 5 '10 at 5:05
    
I also use the numlockx option. –  nathanvda Aug 5 '10 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 '10 at 10:54
    
Yes you are right,. I have amended the typo. –  Richard Holloway Aug 6 '10 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 '10 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:

        INITTY=/dev/tty[1-8]
        for tty in $INITTY; do
             setleds -D +num < $tty
        done

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

share|improve this answer
    
That doesn't address prior to workstation startup (during gdm) –  Marco Ceppi Aug 4 '10 at 12:19
    
Hmm.. you are right, added more instructions –  Ressu Aug 4 '10 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 '10 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 '10 at 5:05

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