Eikrem was at St James' Park to watch Cardiff's 2-1 FA Cup win over Newcastle last weekend and is a former Manchester United youth player, working under Bluebirds manager Ole Gunnar Solskjaer during his time at Old Trafford.
The Norway international midfielder also played for Solskjaer at Molde before moving to Heerenveen in Holland last summer.
Solskjaer said: "I've known Magnus for many years, having worked with him at Manchester United and then signing him for Molde.
"While I was there I had to sell him as he was our best player - and now I feel lucky to get to sign him again for Cardiff City for a reasonable price. I see this as money well spent.
"He's a playmaker, a quarterback if you will, someone who likes to get on the ball and can see a pass.
"He's technically very good, including set pieces and has great vision. Magnus will add a lot to Cardiff City and will blend in very well with the midfielders in the squad."