Messi, 32, has spent his career with Barca but has a clause allowing him to leave for free this summer.
Guardiola coached Messi at the Nou Camp between 2008 and 2012, winning three La Ligas and two Champions Leagues.
“He will stay there [at Barca], that’s my wish,” said the City boss.
Guardiola left Barca for Bayern Munich having become their most successful manager, with 14 trophies in four seasons.
Messi, who has won the Ballon d’Or player award six times, 10 league titles and four Champions Leagues, is under contract until 2021.
“I think he will finish his career there”, said Guardiola.