vagrant error:Vagrantfile already exists in this directory
Asked Answered
V

4

9

When I input $ vagrant box list,
Terminal outputs: centos64 (virtualbox)

Now I input $ vagrant init centos64,
Terminal outputs an error message:

"Vagrantfile" already exists in this directory. Remove it before running "vagrant init".

How do I remove it?

Veronaveronese answered 27/4, 2014 at 15:19 Comment(0)
H
15

You can remove the Vagrantfile by typing rm Vagrantfile at the command line, but it is not clear what you are trying to achieve.

The vagrant init command will initialise a new virtual box by creating a default Vagrantfile. Since you already have one, it looks like you may already have run the vagrant init command.

If you are trying to start the VM then you need to use the command vagrant up centos64

Haiti answered 27/4, 2014 at 17:33 Comment(0)
C
6

From website : https://www.vagrantup.com/docs/cli/init.html

To overwrite any existing Vagrantfile use :

vagrant init {BOX_NAME} --force

If specified, this command will overwite any existing Vagrantfile.

and then

vagrant up

Celibate answered 14/1, 2017 at 13:5 Comment(0)
M
0

You just deleted the VMinstance. so just put vagrant up and the instance comes up and run.

Muddlehead answered 10/10, 2015 at 2:53 Comment(0)
S
0

If you are having any difficulty initializing a file on vagrant, simply overwrite the file. e.g the name of the file is ubuntu/focal64

To remove:

rm vagrantfile ubuntu/focal64

To overwrite:

vagrant init ubuntu/focal64 --force

If removing is giving issues, simply overwrite it.

Solstice answered 28/6, 2022 at 14:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.