If you want to use Maschine 2 with the controller to browse sounds etc but record linearly in Sonar, there are a few things you need to do.
First, just because it makes things a bit more intuitive, add an instance of Maschine to your project using a separate audio and midi track, so NOT the "simple instrument track". So choose midi source and first synth audio output.
Now use your controller or the plugin window to browse and load a kit, just so it's easy to see/hear if it's working.
Now, on the top half of the plugin window, it shows "new project" and under that the name of your kit, right click the kit name and choose Group Midi Batch Setup/Sounds to Midi Notes.
Now, under there, make sure "group" is selected and select the dial icon that will let you setup input and output modes. Under "input", set midi as "active" and channel to 1 (or to whatever channel you want to use for this group, you can set other channels for other groups). Make sure "thru" is off. Now, if you have a keyboard hooked up, you can already use the keyboard to trigger Maschine sounds and record in Sonar that way. But we want to use the Maschine controller so bear with me.
First, still in the group midi input parameters, set the root note to C3.
Now select all your pads (click the first one in the plugin, scroll down and shift-click the last one) and switch to the "sound" parameters, again choosing the dial to setup input and output parameters. In the input section, midi source should be "default", channel 1 and Thru off. In the output section, destination should be Host and channel 1.
On your Sonar midi track, make sure it is set to output to Maschine and channel 1 (you may need to change the view from custom to all to specify channels). In the input section you can choose either Maschine or all/omni if you want to also use a keyboard or external controller. Now you can arm the midi track and record the way you're used to in Sonar, utilizing the Maschine controller and e.g. its Note Repeat function.