O’Shea hopes to bring “some continuity” through a Nations League campaign that will see the Republic of Ireland in a group with England, Greece and Finland.
He said: “Everybody knows the passion and commitment to the Irish national team I have had throughout my playing, and now, coaching career, so it was great when Heimir approached me to be part of his coaching set-up.
“Since I sat down with Heimir and talked about the plans for the team, and what he saw for me in the set-up, I was delighted to accept the role for the next two campaigns and continue my work with the team ahead of two huge fixtures for the group.
“It was important to have some continuity for Heimir with the players and myself and Paddy will be able to provide that and support him in the role.”
Hallgrimsson’s first game in charge will come against England in Dublin on Saturday, 7 September.
After Gareth Southgate’s departure at the conclusion of Euro 2024, England will arrive at the Aviva Stadium under the stewardship of interim manager Lee Carsley, a former Republic of Ireland team-mate of O’Shea.