You should catch possible Exception for vm.wait_for_login to avoid unexpected error.