This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
oliverdavies.uk-old-sculpin/source/_posts/2014-10-06-fix-vagrant-loading-wrong-virtual-machine.md

22 lines
1.1 KiB
Markdown
Raw Normal View History

2015-03-16 21:18:03 +00:00
---
title: How to fix Vagrant Loading the Wrong Virtual Machine
tags:
2015-06-14 02:27:41 +00:00
- vagrant
- virtualbox
2015-04-11 19:28:43 +00:00
meta:
2015-06-14 02:27:41 +00:00
description: How to fix it when Vagrant loads the wrong virtual machine.
2016-12-29 16:32:52 +00:00
use: [posts]
2015-03-16 21:18:03 +00:00
---
2015-06-15 09:47:06 +00:00
{% block excerpt %}
A few times recently, I've had instances where [Vagrant](https://www.vagrantup.com) seems to have forgotten which virtual machine it's supposed to load, probably due to renaming a project directory or the .vagrant directory being moved accidentally.
Here are the steps that I took to fix this and point Vagrant back at the correct VM.
{% endblock %}
{% block content %}
2015-04-11 19:28:43 +00:00
1. Stop the machine from running using the `$ vagrant halt` command.
2018-02-27 21:36:41 +00:00
1. Use the `$ VBoxManage list vms` command to view a list of the virtual machines on your system. Note the ID of the correct VM that should be loading. For example, `"foo_default_1405481857614_74478" {e492bfc3-cac2-4cde-a396-e81e37e421e2}`. The number within the curly brackets is the ID of the virtual machine.
1. Within the .vagrant directory in your project (it is hidden by default), update the ID within the machines/default/virtualbox/id file.
1. Start the new VM with `$ vagrant up`.
2015-06-15 09:47:06 +00:00
{% endblock %}