Numlock problems in Virtualbox linux Mint

My situation is this:

  • I run linux Mint from Windows 8.1 using Virtualbox.
  • I have disabled the numlock (and the other *lock keys) in Windows by rebinding my keyboard using The Microsoft Keyboard Layout Creator.
  • Windows boots up with numlock on so my numpad works.
  • In Virtualbox, Mint boots up without numlock on.
  • Cannot turn it on because the key is unbound.
  • Don’t want to re-enable the bind in Windows.
  • Linux Mint apparently lacks an on screen keyboard solution like Windows has.

The solution I found was to install an application that can turn on numlock via the terminal using numlockx:

sudo apt-get install numlockx
/usr/bin/numlockx on

Problem solved. To enable it from startup, can use:

sudo sed -i 's|^exit 0.*$|# Numlock enable\n[ -x /usr/bin/numlockx ] \&\& numlockx on\n\nexit 0|' /etc/rc.local

I haven’t tested this part yet because I have yet to restart.