Electing to bat at the P Sara Oval, Kohli (48 not out) and Rahul (39 not out) shared unmbeaten 85 runs for the third wicket to steady India's innings after the visitors lost opener Murali Vijay and Ajinkya Rahane (4) with the scoreboard reading just 12.
Dhammika Prasad (2/29) picked up both the Indian wickets.
It was not a happy return return to the playing eleven for Vijay, who missed the first Test due to a hamstring injury. His stay at the crease was shortlived as he was caught plumb in front of the wicket in the fourth ball of the morning by a perfect inswinger Prasad.
But the move backfired big time as Rahane edged a Prasad delivery to third slip in the fifth over of the day.
Also Read
It could have been worse for India had Jehan Mubarak held on to a regulation catch at gully offered by Rahul, then on 11, off Dushmantha Chameera (0/24) in his opening over.
Rahul continued to look scratchy for the remainder of the session as well, but never offered a clear-cut chance again.
Kohli used his feet to perfection against Herath and deposited the left-arm spinner for a six straight down the ground.
The 50-run partnership between Kohli and Rahul came up in the 18th over, while India had crossed the 50-run mark earlier in the 13th over.
Chameera, who surprsingly bowled first change, generated good pace but was unable to make further inroads into the Indian batting.
In the 21st over of the innings, Tharindu Kaushal (0/13) was introduced into the attack, but Kohli and Rahul easily negotiated the passage of play till lunch.
Sri Lanka made one change to their side with fit-again Dushmantha Chameera coming in for the injured Nuwan Pradeep.
Before the play began, BCCI secretary Anurag Thakur felicitated retring Kumar Sangakkara for a glorious international career.
Sangakkara, who is playing his final Test here, then walked onto the field to a guard of honour given by the Sri Lankan players.