The Rosenstein tunnel (German: Rosensteintunnel) is the name of several past, present and planned tunnels in the Stuttgart metropolitan area, in the German state of Baden-Württemberg. Today it is a railway tunnel under Rosenstein Park to Bad Cannstatt. It now connects the Fils Valley Railway (Filstalbahn) from Stuttgart Central Station (Hauptbahnhof) to the Rosenstein Bridge over the Neckar to Bad Cannstatt station.
The first railway tunnel in Württemberg was built during the construction of the Württemberg Central Railway (Zentralbahn) directly under the central axis of Rosenstein Castle. This tunnel was planned by Carl Etzel to link Stuttgart with Cannstatt. In principle, the Rosenstein hill could have been bypassed, but the tunnel allowed a better positioning of Cannstatt station and kept the palace garden (Schlossgarten) from being cut by the railway. Nevertheless, its construction was controversial, as critics feared damage to the castle, but King William I agreed to its construction. The building permit was issued on 14 March 1844.
The tunnel was built using mining methods and construction began on 1 July 1844 and it was completed on 4 July 1846. The completion was delayed by a water and mud intrusion, caused by leaky basins around the castle. The slurry had to be removed from above and then the basins were sealed. This tunnel was 362 metres-long and was built with double track from the start.
Once operations commenced in the new tunnels in November 1915, the old Rosenstein tunnel was taken out of service in 1916. It was used by three tenants for growing mushrooms from 1931 to 1965. In World War II, it served as an air raid shelter and was rented by Mahle GmbH until 1946. The Bad Cannstatt portal was walled up in 1966 and there are now underground facilities of EnBW inside the portal towards Stuttgart Central Station (Hauptbahnhof).