Harry and his bride-to-be started the visit with a walkabout, meeting well-wishers before heading inside the historic fortress to watch as the One O'clock Gun is fired, a tradition started in 1861 to mark time for ships in the Firth of Forth.
The 70-year-old singer is good friends with Prince Harry's mom Princess Diana.
Prince Harry and Meghan Markle met Scotland's First Minister at a reception to celebrate the achievements of young people in Edinburgh - and received an offer of a wedding band.
She and Harry will live at Nottingham Cottage, his residence at Kensington Palace, next door to Prince William and Kate Middleton.
Despite cold and wet weather royal fans braved the conditions to stake the best place to spot the couple on the castle's esplanade.
When a woman in the crowd wished her good weather for the wedding, Meghan joked: "Being in the United Kingdom, all I do is talk about the weather now". She also noted that the two princes are doing a great job and that their partners are very supportive. "I only found out that I was going to meet them four days ago - Josh asked me if I would do it as I am a regular at Social Bite, I stop in every day for a coffee and a roll".
Sadly, Markle will have to live vicariously through this Twitter user and other royal family fans when it comes to brightly colored manicures. "We are visiting Edinburgh for the half term and we are actually considering moving to Edinburgh soon".
'They were asking how long we'd been homeless for and how much Social Bite has helped change us and move us on'.
It's said that Meghan makes her visits without Harry, but is flanked by a protection officer and a royal aide.
Prior to their wedding day, the couple is set to visit Edinburgh to visit various social enterprises such as a local cafè called "Social Bite".
Prince Harry and Meghan Markle meet First Minister Nicola Sturgeon.