The line trails far back along the paths of the city's Meadows, south of St Giles' Cathedral where the coffin is lying at rest.
Mourners began filing into the cathedral at 17:30 on Monday.
Salvation Army vans were offering hot drinks and rolls for the cold night ahead, with toilets and water stops stationed along the queue.
Passers-by could be heard exclaiming with shock at those set to queue for many hours to come.
But the people in line spoke of the importance of experiencing the historic moment and paying tribute to the Queen.
Elizabeth Mbulaiteye, who is from Uganda but lives in Glasgow, had been queuing with her son Daniel and daughter Angel since midday.
Daniel came smartly dressed in his kilt to pay his respects.
The family still had a long wait ahead of them as they stood in the meadows at 20:00.
Elizabeth Mbulaiteye (centre) said she wanted to be part of a "historic moment"
Elizabeth said: "My mother was born in the same year as the Queen, so she was named Elizabeth. She loved the Queen, so she called me Elizabeth as well.
"She's 96 now, and on Saturday she travelled to Balmoral to pay her respects.
"When we were growing up, we were always very big fans of the Royal Family... We wanted to come through today and be part of a historic moment."
Calum and Annette King, from East Linton in East Lothian, said they were happy to wait in line to see the vigil.
Calum, 54, said he had driven up from Nottingham after his last training weekend with the Army reserves.
"Nearly 34 years ago, I swore an oath of allegiance to her. So it's only fitting that I say my goodbyes," he said.
"Someone told us that where we were in the queue, it would be about 04:00 or 05:00 by the time we get through. Once we're finished, we'll just drive home. I've got work tomorrow at 08:30."
Ahmad Zaky, Mutiara Tan, and Anindya Hapsari all recently moved to Edinburgh from Indonesia to study for their MBAs.
Anindya said: "We believe that this is only once in a lifetime.
"We never imagined that this would happen while we were studying in Edinburgh.
"This was our first day on our course and we came over as soon as we finished."
Ahmad Zaky, Mutiara Tan and Anindya Hapsari only recently moved to Edinburgh
Ahmad guessed they would be in the queue for about five hours.
Fiona and Matt Sigsworth, both 35, joined the meadows queue at 19:00 in hopes that they might make St Giles' Cathedral by midnight.
They came wrapped up warm, with packed rolls and drinks to keep them going into the small hours.
They had travelled down from the Coaltown of Balgonie, near Glenrothes in Fife.
Fiona, who works as a teacher, said: "It's one of those moments really, a moment in history.
"It's once a lifetime and we wanted to pay our respects to an extraordinary woman.
"We're not royalists, but I respect and admire what the Queen has done for the country and the sacrifice and duty that she's shown for 70 years.
"It's important to mark that and show thanks for it. We've got work tomorrow so we're trying to stay optimistic that we might make it to the cathedral."
Mourners had to collect a wristband at the Meadows park before joining the queue to get into the cathedral.
Earlier, those who had already been able to view the coffin told BBC Scotland of their "emotional" experience in the cathedral.
Gillian and Michael Hainsworth, from Garforth in Yorkshire, waited seven hours before they entered the cathedral.
"It was just so emotional," said Gillian. "It is hard to explain. It comes over you all of a sudden."
"You are only a couple of metres away from the coffin," Michael added. "You can linger there for a bit and say a prayer."
Rodney Matthews described the experience of seeing the Queen's coffin as "very moving"
Rodney Matthews, a retired Baptist minister and member of Old Saint Paul's, a Scottish Episcopal Church in the heart of Edinburgh, said the moment was "just very moving".
"You were able to move very slowly through, there was no rush at all," he said. "There's a moment where you can actually stand there and take it all in, the dignity of the whole place.
"It was very well done, very well organised once you go through security and get that feeling of space."
Mr Matthews was awarded an MBE for his work on a millennium project about pilgrims crossing Scotland.
"The Queen was very gracious when I met her, and I wanted to acknowledge her in the same way," he added.
Betty and Thomas Bremner brought granddaughter Zara to Edinburgh to see the Queen's coffin
Betty and Thomas Bremner watched the coffin being driven along the M90 on Sunday before travelling to Edinburgh with granddaughter, Zara, on Monday.
The family, from Kennoway in Fife, felt it was their duty pay their last respects in the cathedral.
"It was a privilege. It was serene, beautiful, you weren't rushed at all. It was just so peaceful, I'm glad I came, really glad I came," Mrs Bremner said.
They waited six hours to see the coffin. But the grandmother said: "I would have stood all night, if I had to."
Her husband said he found it surprisingly emotional.
"It was very, very sad actually. I didn't think I would shed a tear but it got to me in the end when I was walking through St Giles."
People will be able to walk past the Queen's coffin until 15:00 on Tuesday.
-- Courtesy of BBC News