|Harald (already showing unkempt hair in this depiction)|
receiving the kingdom from his father.
According to the Heimskringla,* Harald proposed marriage to Gyda, the princess of a neighboring kingdom, Hordaland. Although Hordaland was no larger than Vestfold, Gyda thought it fitting to demand that she marry no less than the king of all Norway. The fact that there had never been a "King of all Norway" did not deter her ambitions—or Harald's. He took a vow never to cut or comb his hair until he achieved the title "King of Norway." This, of course, immediately gave him a new title anyway, and he was called "Harald Tangle Hair" or "Harald Shockhead" in the following years.
He fought a large battle c.900 in which he defeated two of his most prominent rivals in Norway, after which there was so little resistance to his goal of conquest that he could rightly be called King of Norway.
The tangle of his hair was matched, however, by the untamed nature of his lust. He is believed to have fathered many children with different mothers (he never married Gyda, that we know of), including between 10 and 20 sons, many of whom wanted to rule the kingdom (or, at least, part of it) after his death or even before. Rule of Norway passed to his youngest son, Hakon the Good (called so because of his Christian faith), but another son, Erik Bloodaxe (called so because of his Norse faith) spent 15 years trying unsuccessfully to take the crown away.
It is likely that you have never heard of "Harald Tangle Hair" before—at least, not by that name. It took much of his life to unite Norway and be proclaimed king, but he did achieve his goal, and therefore he could reverse his earlier vow. When he started cutting and combing his hair again, he was rewarded with the epithet "Fair hair" (Norse harfagr). "Harald Fairhair" is how we call him these days, forgetting his youthful vow.
*Heimskringla is the best known of the Old Norse kings' sagas. It was written in Old Norse in Iceland by the poet and historian Snorri Sturluson (1178/79–1241) ca. 1230. The name Heimskringla was first used in the 17th century, derived from the first two words of one of the manuscripts (kringla heimsins - the circle of the world). [Wikipedia]