As of version 0.4.12, LMMS 'records MIDI' input from the keyboard in its 'Piano Roll' function. It does not, however, export MIDI files (ie. "*.mid"), only *.WAV & *.OGG files ("bouncing", etc.).

Also, LMMS does not record MIDI CC data, like knob & fader controls found on many MIDI keyboards and MIDI controllers. This is actually how I found this post. I was hoping that there might be some hidden, secret way to write the CC data from an assigned knob/fader on my MIDI keyboard to an automation track, but nope. NOPE.

If you are looking for a way to record the raw sound of your soft synth or sampler in LMMS to a file that can then be imported into the song editor, pattern editor, etc., then JayPeeJay had it right with using JACK to connect the output of LMMS to the system 'capture' channels. That way you can record the sounds routed to the system 'capture', or input (same thing), with any program that records audio. (my personal preference being Audacity)

Qtractor, currently 0.5.1, is another program that is useful for MIDI sequencing and recording. With Qtractor you can export *.mid files as well as audio files. You can also map MIDI CC controls to the mixer, plugins, etc. Now that automation has been implemented, there is an option to 'Record', so it appears to me that Qtractor can record MIDI CC data and write it to automation.

JayPeeJay, AFAIK, you cannot record audio directly into LMMS. You can only import sound files into the Audio Processor instrument.