vagrant error:Vagrantfile already exists in this directory

24,349

Solution 1

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

Solution 2

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

Share:
24,349
kusumoto_teruya
Author by

kusumoto_teruya

Updated on July 09, 2022

Comments

  • kusumoto_teruya
    kusumoto_teruya almost 2 years

    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?