The left-hander was unbeaten on a sedate 81 with skipper Dinesh Chandimal on 32 not out as the pair added 82 for an unbroken fourth-wicket stand after Sri Lanka were struggling at 61-3.
Pakistan had the advantage in the first session with leg-spinner Yasir Shah taking 2-38, dismissing left-hander Lahiru Thirimanne for his 150th Test wicket.
Shah matched fellow countryman Waqar Younis as the joint second fastest to 150 wickets -- both achieving the milestone in their 27th Test.
Karunaratne had a solid opening stand of 34 with Kaushal Silva before paceman Hasan Ali provided Pakistan with the breakthrough.
Also Read
Hasan bowled Silva for 12 as the batsman played on to an inswinging delivery.
Shah then had Thirimanne trapped leg before for a duck and Kusal Mendis caught behind for 10 to leave Sri Lanka in a spot of bother.
The Test is Pakistan's first since the retirement of legendary batsman Younis Khan and their most successful Test skipper, Misbah-ul-Haq.
Pakistan handed a Test cap to batsman Haris Sohail, while Sri Lanka went into the game with three spinners and two seamers.
Disclaimer: No Business Standard Journalist was involved in creation of this content