[citation needed] Already in 1913, as a 17-year-old ship's boy, he absenteed for the first time from his unit without permission, as evidenced by police files.
On 10 January Egelhofer rose at a Spartacist protest meeting in the Bavarian Foreign Ministry building and told the Council of Ministers, that a gathering of 5000 workers demanded the proclamation of a Council Republic, removal of the city commander Oskar Dürr (1877-1959, SPD politician and Tsar of Russia's vice consul in Munich), diplomatic relations with the Soviets in Russia and the establishment of a Red Army.
Revolutionary troops under his leadership stormed the Munich Central Station, held by supporters of the SPD exile government, who had fled to Bamberg.
The coup failed, and the same day Egelhofer was appointed city commander by the Munich Council, now dominated by KPD members as Eugen Leviné and Max Levien.
The task, to within a few days organize the defense of Munich with an estimated 20,000 barely trained, poorly armed and highly motivated soldiers and workers against the approaching superiority of the "white" troops – Reichswehr army units and right-wing Nationalist Freikorps – which were called in by the Bamberg SPD leadership under Johannes Hoffmann, was not salvageable for the young seaman.
Egelhofer was unable to enforce the idea of gathering relatives of the "Bourgeoisie" in the Theresienwiese and shooting them when the "whites" invaded the city.
The 23-year-old Egelhofer as one of the most prominent representatives of the Communist council rule was discovered and arrested on 1 May 1919 in his hiding place in an apartment on Maximilianstraße.