After upgrading to VirtualBox 5 on Windows every time I started, focused or unfocused a virtual machine my numlock status would toggle. If you're having the same problem here is how to fix it:
> VBoxManage setextradata "<machine-name>" GUI/HidLedsSync "0"
This will disable keyboard indicators (HID LEDs) synchronization. This setting it supposed to be disabled by default but for some reason it was not on my installation.
VBoxManage is located where you installed virtualbox, usually
If you have a lot of virtual machines you can process them all by running the following commands:
Open a command prompt
Add virtualbox to you path:
> set path=%path%;C:\Program Files\Oracle\VirtualBox
Go to the directory where you're virtual machines are located, commands below are for a default install:
> %HOMEDRIVE% > cd "%HOMEPATH%\VirtualBox VMs"
Update the setting for all machines in the directory
> for /f "tokens=*" %G in ('dir /b /a:d ".\*"') do (VBoxManage setextradata "%G" GUI/HidLedsSync "0")
Hooray, no more numlock weirdness.