The communist neighbours have long celebrated their political and economic ties but in recent years tensions have flared over a decades-old feud about island chains in the contested waters.
On arriving in Hanoi, Xi said he hoped the visit would "consolidate (their) traditional friendship" and lift Sino-Vietnamese "cooperation to a higher level" in a statement released in Vietnamese.
The Chinese leader was welcomed with a 21-gun salute before being greeted by ruling Communist Party chief Nguyen Phu Trong.
"Protesting Xi Jinping's visit" said one of the placards held aloft by about a dozen demonstrators in the capital, as others carried pictures of Xi marked with an "X" across his image.
Also Read
But unlike protests earlier this week, they were quickly disbanded, witnesses told AFP, saying demonstrators in Hanoi were funneled into buses and driven away.
Posts on social media said around 20 people were detained in Ho Chi Minh City after a larger anti-China protest, with a video showing a bloodied demonstrator after clashes with police.
Anger against Xi's visit has also been brewing online - a more common outlet for grievances despite the routine arrests of political bloggers.
"Immediately end activities which threaten the lives, property and right to freedom" of Vietnamese fishermen, said a petition signed by hundreds and shared on Facebook, referring to the disputed isles.
Relations between Vietnam and China plummeted to their lowest point in decades in May 2014 when Beijing moved an oil rig into waters claimed by Hanoi in the South China Sea.
Patriotic sentiments still run high in Vietnam, and Xi's visit has been viewed by observers as an attempt to improve relations after that episode.
He "aims to calm down Vietnam and other countries over the recent construction by China" in the South China Sea, said Duong Danh Dy, a former Vietnamese diplomat in Beijing.