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?
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.
A Basic Vagrantfile A Vagrantfile is a Ruby file that instructs Vagrant to create, depending on how it is executed, new Vagrant machines or boxes. You can see a box as a compiled Vagrantfile. It describes a type of Vagrant machines. From a box, we can create new Vagrant machines.
Explore the synced folder Tip: When you vagrant ssh into your machine, you're in /home/vagrant , which is a different directory from the synced /vagrant directory. Believe it or not, the Vagrantfile that you see inside the virtual machine is actually the same Vagrantfile that is on your actual host machine.
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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With