It is the first time members of the public have been able to process past the late monarch since her death on Thursday.
George Higgins, a former soldier in the Scots Guards, was at the front of the queue which lined George IV Bridge.
It’s a real privilege to be here. I can’t believe I’m actually first. I have actually got to pinch myself
The 61-year-old had been in line since before 7am on Monday, shortly after he finished an overnight shift as a security guard at the University of Edinburgh.
Speaking to the PA news agency he said: “I’ve been here since 6.45am, I came straight here after a night shift at work.
“I took my clothes to work, got changed and came straight here. I’m going back on shift at 9.30pm tonight, so I’m going to be very tired.
“But it’s worth it – with her service to the country, to us, to people and to the Commonwealth, the least I can do is give her a couple of days of my time to say farewell.
“It’s a real privilege to be here. I can’t believe I’m actually first. I have actually got to pinch myself. It’s just luck.”
Sheila Purvis, a member of the Royal Scots Association and who works at the Royal Scots museum, started queuing from 10am.
She said: “I wouldn’t have missed this for the world. I would have waited for two days, never mind a few hours.
“It’s such an honour to be able to see the Queen one last time. This will be the last time to pay our respects.”
Fighting back tears, she added: “I won’t be saying anything, but in my head I will be saying thank you for everything ma’am. Goodbye.”
Speaking after spending a moment with the Queen’s coffin, Karen Whitehouse described the experience as surreal.
“It was very quiet,” she said, after leaving her home in Loweswater, Cumbria, at 2am on Monday to start queuing.
“Everyone was very still. It was like they were all statues.
“I can’t believe I’ve done it and I was that close. I paid my respects, it was just beautiful.”
Ms Whitehouse said the Queen’s coffin was lying on a tall plinth inside the cathedral.
She added: “The wreath was on the top, and a cushion, and the crown on top of that.
“There’s a lot of officials in there, in their robes. Everyone is very still, it’s a beautiful experience. It was worth the 12 hours to get here.”
Sharon O’Neill, from Airdrie, described the setting for the Queen’s vigil as “stunning”, adding: “It’s been a great opportunity to allow the Scottish people to come and pay their respects.”
Members of the public started going into the cathedral at about 6pm, and the procession was temporarily paused to allow the royal family to take part in a short vigil at about 8pm.
Irene Hamilton, from Cumnock – who had been queuing since 11am with her two daughters, Dianne Bryce, 53, and Irene Ward, 48 – described the experience as “nice, quiet and peaceful”.
“The crown sitting on top of the coffin was lovely,” the 79-year-old added.
“The church was beautiful, it was a nice place to have her lying, resting in peace.
“I thought she was brilliant, for the years that she reigned, those 70 years, it was brilliant. She did her duty well.”