Seamer Dhammika Prasad delivered a fiery spell to snare two wickets with the total on just 12 and India took advantage of a dropped chance which would have had made it 20-3.
Kohli was unbeaten on 48 with Rahul on 39 at the break.
Dhammika Prasad trapped Murali Vijay lbw without scoring with the total on four and had Ajinkya Rahane —promoted in the batting order — caught at slip by Dimuth Karunaratne.
Jehan Mubarak put down Rahul on 11 at gully off fast bowler Dushmantha Chameera.
Prasad returned the best bowling figures of 2-29.
India trails the three-match series 1-0 after a stunning 63-run loss in Galle.
It made three changes in its lineup: in-form batsman Shikar Dhawan is out of the series with an injury and was replaced by Vijay. Seam-bowling all-ounder Stuart Binny replaced off-spinner Harbhajan Singh who struggled in the first test and fast bowler Umesh Yadav took the place of Varun Aaron.
This test is the final international game for Sri Lanka's Kumar Sangakkara after a 15-year international career. In 133 tests, Sangakkara has scored 12,350 runs with 38 centuries.
Happy Lunch Hour at BAC