The favourite to replace Lopetegui in recent weeks had been former Chelsea boss Antonio Conte, who has been out of management since being dismissed by the Blues in July after finishing fifth last season.
But negotiations with the Italian are reported to have stalled and 42-year-old Solari has been given an opportunity, mirroring the appointment of former boss Zidane, another popular ex-player who had been in charge of Castilla.
Zidane took charge after Rafael Benitez was sacked in January 2016 and the Frenchman guided Real to three successive Champions League titles, before stepping down in May.
Former Real and Argentina midfielder Solari replaced Zidane as coach of Castilla, who is fifth in Segunda Division B, three points behind leaders Ponferradina.
Under Spanish regulations, an interim coach can be at the helm for a fortnight – but must be appointed officially after 15 days, or not at all.
Manchester United manager Jose Mourinho – who won La Liga and the Copa del Rey during his three years at Real from 2010-13 – and former Everton boss Roberto Martinez, who led Belgium to the World Cup semi-finals, have also been linked with the post.
Spanish football expert Guillem Balague on BBC Radio 5 live
“Antonio Conte is asking for so much. He is asking for two and a half years, asking to be a manager, asking for more money than Real Madrid are willing to pay. They are surprised this has not gone smoother. On Sunday, they were very optimistic Conte would replace Lopetegui.
“Florentino Perez always asks the leaders of the dressing room about managerial decisions. When he got rid of Rafael Benitez, he asked Cristiano Ronaldo and Sergio Ramos. He has asked Sergio Ramos this time and he doesn’t like the idea of Conte.
“Fans will be underwhelmed for sure. Solari hasn’t impressed in the league, but what the fans don’t realise is every year he has been given a bunch of kids in the third tier, which is all about adults and being strong mentally and physically – and his players have not been.
“But about 12 players from his team in the past two seasons now play in the first or second divisions. That means he is a good coach.
“There is a lot of hope for him, but everyone feels it is a little bit too early – even the board.”