The Briton stepped out and leaned across to steer as marshals gave a helping hand, before giving up the battle as the first session ended.
He then crouched down next to the stricken car after it had been wheeled off the track, resting his helmeted head on the front in apparent shock.
"I've never seen body language like this from Lewis," commented former team mate and 2016 champion Nico Rosberg on Sky Sports television.
German Grand Prix
Grosjean: German GP key to saving seat
03/10/2018 AT 15:13
"This is a huge setback."
A Mercedes spokesman said Hamilton, who is eight points behind Ferrari's Sebastian Vettel in the title battle at the halfway point in the season, had lost hydraulic pressure.
"Gears won't change," Hamilton had reported over the team radio.
"Guys, I need to make it back," he added.
"Stop, stop, stop, stop," Mercedes told him with some urgency.
The spokesman said it was important to stop the car to prevent "heat soak damage" to the power unit as happened to team mate Valtteri Bottas during the race in Austria earlier this month.
Hamilton had been only fifth fastest in the opening qualifying session, with speculation -- dismissed by the team -- earlier on Saturday that he was either feeling unwell or suffering from a stiff leg.
Barring any further grid penalties, a possibility if the gearbox is damaged, he will start 14th on Sunday in what is a home race for his Mercedes team and also Ferrari's Vettel.
The blow was the latest of several Hamilton has suffered this season.
He retired in Austria with a fuel pressure problem, ending a record run of 33 successive races in the points and losing the overall lead.
In Britain two weekends ago in front of his home fans, Hamilton went from pole position to last after tangling with Ferrari's Kimi Raikkonen at the start but managed to fight back to second place.
The Briton has also dropped points as a result of strategy errors by Mercedes. In Bahrain he took a five place grid penalty for an unscheduled gearbox change.
"It looks like Lewis will be at the back so we will both be charging," said Red Bull's Australian Daniel Ricciardo, who will be starting at the back after engine penalties.
"If there is not much happening at the front, there will be at the back. Knowing I have a few overtakes makes me smile cheekily," he told the BBC.
German Grand Prix
F1 chiefs swayed Mercedes to help German GP
09/09/2018 AT 12:01
German Grand Prix
German GP back on 2019 F1 calendar after new deal agreed
31/08/2018 AT 13:44