Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with setting up Vagrant

Tags:

vagrant

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?

like image 747
Hyder B. Avatar asked Apr 03 '15 18:04

Hyder B.


People also ask

How do I set up Vagrant?

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.

How long does Vagrant take to install?

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).

What is the default provider for Vagrant?

By default, VirtualBox is the default provider for Vagrant.


1 Answers

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.

like image 140
Manoj Awasthi Avatar answered Sep 28 '22 09:09

Manoj Awasthi