Running Vagrant CentOS 7 on Windows 10

Install

Download

Enable Intel VT-X on your PC

Run Packer & Build the Centos BoxCutter Image Template

  • Packer should run in the directory from which the Boxcutter json files were extracted.
  • Run the following Packer command at the command line.

     > packer build -var-file=centos73.json centos.json
  • It will create a Box Directory with boxes for each virtualisation type installed on the PC e.g.
    • VirtualBox
    • VMware Workstation

Note: Allow VMware Workstation or VirtualBox run standalone, allow installation to finish without any keyboard or mouse input.

  • When Packer is finished running a box directory will have been created in the json boxcutter directory.
  • The directory will have the CentOS box files

    "C:\Users\test1.AUTH\Vagrant\centos-master\box\virtualbox\centos73-0.1.0.box"

Setup Vagrant with the CentOS 7 Box Image

  1. Check what boxes are setup with the following command at the command line:

    > vagrant box list
    There are no installed boxes! Use `vagrant box add` to add some.
  2. Add the newly created box, “vagrant box add name path” :

In this case:

> vagrant box add centos73 file:///C:/Users/test1.AUTH/Vagrant/centos-master/box/virtualbox/centos73-0.1.0.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'centos73' (v0) for provider:
    box: Unpacking necessary files from: file:///C:/Users/test1.AUTH/Vagrant/centos-master/box/virtualbox/centos73-0.1.0.box
    box: Progress: 100% (Rate: 308M/s, Estimated time remaining: --:--:--)
==> box: Successfully added box 'centos73' (v0) for 'virtualbox'!
  1. Run the “vagrant up” command

    > vagrant up
    Bringing machine 'default' up with 'virtualbox' provider...
  2. To check the status of the Centos image, use the “vagrant status”:

    > vagrant status
    Current machine states:
    default                   running (virtualbox)
    The VM is running. To stop this VM, you can run `vagrant halt` to
    shut it down forcefully, or you can run `vagrant suspend` to simply
    suspend the virtual machine. In either case, to restart it again,
    simply run `vagrant up`.
  3. To log to the machine run the “vagrant ssh” command

> vagrant ssh
----------------------------------------------------------------
  CentOS 7.3.1611                             built 2017-08-23
----------------------------------------------------------------
[vagrant@localhost ~]$ 
  • Note: It may be possible to complete all tasks without logging into the machine.
  1. To destroy the machine run the “vagrant destroy” command.

    > vagrant destroy
    default: Are you sure you want to destroy the 'default' VM? [y/N] y
    ==> default: Forcing shutdown of VM...
    ==> default: Destroying VM and associated drives...

Vagrant VMware Workstation

  • To use VMware Workstation install the plugin as detailed below:

  • Note: Vagrant VMware Workstation license costs 79 USD $.

  • Install the VMware Worktsation plugin with the “vagrant plugin install vagrant-vmware-workstation” command

    > vagrant plugin install vagrant-vmware-workstation
    Installing the 'vagrant-vmware-workstation' plugin. This can take a few minutes...
    Fetching: vagrant-share-1.1.9.gem (100%)
    Fetching: vagrant-vmware-workstation-4.0.24.gem (100%)
    Installed the plugin 'vagrant-vmware-workstation (4.0.24)'!
  • Run the “vagrant up” command Vagrant will prompt for the VMware Workstation license.

    > vagrant up
    A valid license is required to run the Vagrant VMware
    provider. Please visit http://www.vagrantup.com to purchase
    a license. Once you purchase a license, you can install it
    using `vagrant plugin license`.
  • To make the VMware Workstation a Vagrant license file has to be purchased & downloaded from:

    https://www.vagrantup.com/vmware/#buy-now

    The license has a cost of 79.0 USD $

  • Install the license.lic using the “vagrant plugin license” file.

> vagrant plugin license vagrant-vmware-workstation ~/license.lic
  • The add the VMware Workstation Centos box to Vagrant vagrant box add name path
> vagrant box add centos73 file:///C:/Users/test1.AUTH/Vagrant/centos-master/box/vmware/centos73-0.1.0.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'centos73' (v0) for provider:
    box: Unpacking necessary files from: file:///C:/Users/test1.AUTH/Vagrant/centos-master/box/vmware/centos73-0.1.0.box
    box: Progress: 100% (Rate: 282M/s, Estimated time remaining: --:--:--)
==> box: Successfully added box 'centos73' (v0) for 'vmware_desktop'!