- ubuntu/trusty64 14.04
-
First Steps
Before launching your Homestead environment, you must install VirtualBox 5.x or VMWare as well as Vagrant. All of these software packages provide easy-to-use visual installers for all popular operating systems.
To use the VMware provider, you will need to purchase both VMware Fusion / Workstation and the VMware Vagrant plug-in. VMware provides much faster shared folder performance out of the box. -
Checkout and Init
$ git clone https://github.com/colynn/homestead.git homestead $ cd homestead $ bash init.sh
- Setting Your Provider
The provider key in your ~/.homestead/Homestead.yaml file
indicates which Vagrant provider should be used: virtualbox, vmware_fusion, or vmware_workstation.
You may set this to whichever provider you prefer:
provider: virtualbox
- Setting Your SSH Key
$ ssh-keygen -t rsa
- Defind Your Box Name
$ grep "vm.box" ./scripts/homestead.rb -A1 -B1 # Configure The Box config.vm.box = settings["box"] ||= "ubuntu/trusty64" config.vm.hostname = settings["hostname"] ||= "dev.example.com"
Note: If you want to use the custom local box(can download from http://www.vagrantbox.es/) or other virtualbox from https://atlas.hashicorp.com/boxes/search, you can change the setting of 'config.vm.box', as you saw,the default value is 'ubuntu/trusty64'.
And you may use this command to add the local box.
vagrant box add [customer-box-name] [the local virtualbox file]
- Configuring Shared Folders
The folders property of the ~/.homestead/Homestead.yaml file lists all of the folders you wish to share with your Homestead environment. As files within these folders are changed, they will be kept in sync between your local machine and the Homestead environment. You may configure as many shared folders as necessary:
folders: \- map: ~/Code to: /home/vagrant/Code
Once you have edited the ~/.homestead/Homestead.yaml to your liking, run the vagrant up command from your Homestead directory. Vagrant will boot the virtual machine and automatically configure your shared folders and Nginx sites.
To destroy the machine, you may use the vagrant destroy --force command.
You can SSH into your virtual machine by issuing the vagrant ssh terminal command from your Homestead directory.
But, since you will probably need to SSH into your Homestead machine frequently, consider creating an "alias" on your host machine to quickly SSH into the Homestead box.
Once you create this alias, you can simply use the "vm" command to SSH into your Homestead machine from anywhere on your system:
alias vm="ssh vagrant@127.0.0.1 -p 2222"