Allow spaces in path to VM and remove code duplication.