I have just set up a new Linux box and trying to install vagrant on it. The issue is that when I am running vagrant up command, I am getting the following error:
Vagrant failed to initialize at a very early stage:
The directory Vagrant will use to store local environment-specific state is not accessible. The directory specified as the local data directory must be both readable and writable for the user that is running Vagrant.
Any idea how to fix this?
Install Vagrant by visiting the Vagrant downloads page and downloading the appropriate installer or package for your platform. Packages are available for Mac, Windows, and distributions of Linux. Create a project directory to set up your first Vagrant project. Then initialize the project with a Vagrantfile at its root.
Run Vagrant (again, from the same directory where you saved the Vagrantfile). Vagrant will download our custom box and boot it in VirtualBox. The download can take anywhere from a few minutes to an hour or more, depending on the speed of your connection, as the box is considerably big (approx 1.4 GB in size).
By default, VirtualBox is the default provider for Vagrant.
I think a better way is to provide your user the required permission to the directory by making the user the owner - where you want the vagrant
to be booted:
$ sudo chown -R <user> <directory>
and then you will be easily able to do:
$ vagrant up
Using sudo
for vagrant up
is unusual as why do you want to run your virtual machine as a root user.
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