Problem Setting up VM machine with Vagrant

Error Message

A VirtualBox machine with the name ‘mongod-m103’ already exists.
Please use another name or delete the machine with the existing
name, and try again.

I am using Ubuntu 16.04

I have tried deleting the uninstall and re-installing Vagrant and Virtual Box.

And these commands : vagrant destroy, vagrant prune, vagrant box remove

vboxmanage list vms gieves no result

The virtual machine does not show when I open Virtual Machine GUI.

Open VBox > File menu > Preferences > General > in the Default Machine Folder directory (see screenshot below) you’ll find the mongod-m103 folder > delete it
image

This is a screenshop of my terminal in the Default VirtualBox Directory.

There is no files or folders in it.

There are in fact two sub directories in that directory. If you don’t have any other VirtualBox virtual machines running, then delete both sub directories.

the first file . represent the current directory and
and the second file .. represent the parent directory in Linux file system

Quite right there, didn’t notice your use of the “a” option. Can you share the full screenshot of the error message.

This is a screenshot from my terminal when I run the
vagrant up or
vagrant up --provision

That’s most peculiar @Boadu_10174
I wonder if you have two version of VBox installed. Can you run vboxmanage --version and compare that with what you have on the VBox app (i.e. Vbox gui > Help > About VirtualBox)

Yh, they are the same

Very weird indeed! Share a screenshot of main screen of VirtualBox. Let’s see your list of VMs (if any).

There is no virtual machine

Ok. Let’s do two things:

  1. vboxmanage list --sorted vms
  2. Use the find command to find “.vagrant” or “.vagrant.d” folders. It might be in /home/boadu but also look in root (and sub dirs) if not found.


Ok
I have this in my working directory

Go ahead and delete the “.vagrant” folder and you’ll be fine to run vagrant up

With or without sudo ?

Deleting it? If you’re the owner of the folder, then without, otherwise with. It won’t matter in this case.

Sorry, I meant running vagrant up

As a normal user so without is fine.

Ok. Lemme restart first to make sure all processes and child processes are killed first.
Thanks in advance.

That’s a pretty long restart :wink: