Save Munich for a separate trip.
You'll need 6 days for VIE and BUD.
I'd take the hydrofoil from VIE to Bratislava. It was a nice little ride and you can drink $1.25 Pilsner Urquell's on the boat. Stay in Bratislava for a couple of hours and then take the train or hydrofoil, if there is another one, to BUD. Bratislava is very interesting. Climbing to the top of the castle hill and looking across the river at the communist housing is a real experience.
Rich