The match is being organised in conjunction with the club's proposed new owners the Pompey Supporters' Trust, with all proceeds going towards their community stake in Portsmouth, and will take place at Fratton Park on Tuesday, April 16.
Defender Hreidarsson, 38, who made 123 appearances for Pompey, is paying the expenses to bring his side to the south coast as part of an eight-day tour of England ahead of the new Icelandic Premier League season.
PST chairman Ashley Brown said: "We were delighted when Hermann approached us with this idea. This is a fantastic opportunity for fans to come and say farewell to a terrific club servant, but more importantly contribute to the biggest community share yet.
"Every penny will be reinvested in the club as part of the PST's shareholding, so this means any fan can have their stake in Pompey simply by buying a ticket for the match.
"More details of prices will be announced soon, but no standard ticket will cost more than £10, so we feel this is a great way to make community ownership accessible to all."
Hreidarsson, who has recently been in England to complete a coaching course, added: "It is a great opportunity for my players to play at a legendary ground and all the money will be going to a great cause.
"My time at Pompey was a rollercoaster ride, with some terrific highs like winning the FA Cup in my first season and also some difficult times, which saw some good people lose their jobs.
"All the time, though, the Pompey fans were different class and I didn't feel I got the chance to say goodbye to them properly after I was left for Coventry in 2012."