Vagrant on w7 : can't find any box - vagrant

I am new on stackoverflow and this is my first question...
I had an issue with Vagrant when trying to get a box on a private repository so I tried to get 'hashicorp/precise64' on Atlas and I have the same problem : Vagrant can't find the box.
I am using Vagrant 1.9.3 on Windows 7 with Virtualbox 5.1.18 (with extension pack).
I had no issue on installation.
$ vagrant version
Installed Version: 1.9.3
Latest Version: 1.9.3
You're running an up-to-date version of Vagrant!
Everything seems to be right on initialization, Vagrantfile is created :
$ vagrant init hashicorp/precise64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
Vagrantfile :
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "hashicorp/precise64"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
# such as FTP and Heroku are also available. See the documentation at
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
# config.push.define "atlas" do |push|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
# end
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# apt-get update
# apt-get install -y apache2
# SHELL
end
Here is the error I get when using 'vagrant up' command :
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'hashicorp/precise64' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'hashicorp/precise64'
default: URL: https://atlas.hashicorp.com/hashicorp/precise64
The box 'hashicorp/precise64' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Atlas, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:
URL: https://atlas.hashicorp.com/hashicorp/precise64
Error: Failed writing body (0 != 1063)
I have the same issue when trying to download other public boxes.
I tried with few Vagrant versions (v1.9.0, v1.9.1, v1.9.2, v1.9.3), with and without admin rights.
I have no proxy and no internet connection issue.
I tried to disable my firewall.
I did some research on this, especially on Vagrant compatibility issues, but I could not find much and the problem remains.
Does anyone have an idea?

I just found the origin of my problem : I had special characters in my windows username that brought encoding issue in Vagrant temporary folder path...
A big thanks to Frédéric Henri (https://stackoverflow.com/users/4296747/fr%c3%a9d%c3%a9ric-henri) who helped me a lot and also found the origin of my issue.

Related

How to up Vagrant with hashicorp/precise64 box?

I started learning Vagrant and I'm trying to up vagrant machine with hashicorp/precise64 box. I've installed VirtualBox 5.1 on Gentoo and I emerged Vagrant from Gentoo repository. I executed following command in terminal:
pecan#tux ~/vagrant_getting_started $ vagrant box add hashicorp/precise64
==> box: Loading metadata for box 'hashicorp/precise64'
box: URL: https://vagrantcloud.com/hashicorp/precise64
This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.
1) hyperv
2) virtualbox
3) vmware_fusion
Enter your choice: 2
==> box: Adding box 'hashicorp/precise64' (v1.1.0) for provider: virtualbox
box: Downloading: https://vagrantcloud.com/hashicorp/boxes/precise64/versions/1.1.0/providers/virtualbox.box
==> box: Successfully added box 'hashicorp/precise64' (v1.1.0) for 'virtualbox'!
pecan#tux ~/vagrant_getting_started $ nano Vagrantfile
pecan#tux ~/vagrant_getting_started $ vagrant up
No usable default provider could be found for your system.
Vagrant relies on interactions with 3rd party systems, known as
"providers", to provide Vagrant with resources to run development
environments. Examples are VirtualBox, VMware, Hyper-V.
The easiest solution to this message is to install VirtualBox, which
is available for free on all major platforms.
If you believe you already have a provider available, make sure it
is properly installed and configured. You can see more details about
why a particular provider isn't working by forcing usage with
`vagrant up --provider=PROVIDER`, which should give you a more specific
error message for that particular provider.
and I got above error when I tried to up Vagrant machine.
Vagrantfile content:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "base"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# NOTE: This will enable public access to the opened port
# config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine and only allow access
# via 127.0.0.1 to disable public access
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = true
# Customize the amount of memory on the VM:
vb.memory = "1024"
end
#
# View the documentation for the provider you are using for more
# information on available options.
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# apt-get update
# apt-get install -y apache2
# SHELL
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise64"
end
end
vagrant up --provider=virtualbox command returns the below error:
pecan#tux ~/vagrant_getting_started $ vagrant up --provider=virtualbox
The provider 'virtualbox' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The
reason is shown below:
Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed.
Vagrant uses the `VBoxManage` binary that ships with VirtualBox, and requires
this to be available on the PATH. If VirtualBox is installed, please find the
`VBoxManage` binary and add it to the PATH environmental variable.
I'm counting for help!
The Vagrantfile is wrong, it does not contain the correct box information
You can remove the whole folder all together and start with vagrant init hashicorp/precise64 which will create a correct Vagrantfile, then you can run vagrant up (virtual box should be the default provider if not run vagrant up --provider virtualbox)
Fix the Vagrantfile and replace
config.vm.box = "base"
with
config.vm.box = "hashicorp/precise64"
Then you can run vagrant up and it will work.

openshift installation on centos7 (vagrant virtual box on windows) is causing errorwith ports 80 and 443

I have a windows machine on which i have centos7 running inside virtualbox.
I am trying to install redhat openshift and make it work. enter code here
The necessary steps are on https://github.com/openshift/origin/blob/master/docs/cluster_up_down.md#linux.
Please help me resolve the following error.
I am getting the following error:
[root#localhost vagrant]# oc cluster up
-- Checking OpenShift client ... OK
-- Checking Docker client ... OK
-- Checking Docker version ... OK
-- Checking for existing OpenShift container ... OK
-- Checking for openshift/origin:v1.4.0-alpha.1 image ... OK
-- Checking Docker daemon configuration ... OK
-- Checking for available ports ...
WARNING: Port 80 is already in use and may cause routing issues for
applications.
WARNING: Port 443 is already in use and may cause routing issues for
applications.
FAIL
Error: Cannot get TCP port information from Kubernetes host
Caused By:
Error: cannot start container
db018a9349dda92ddb8d3cb95899de17698d059ca9ba68264fa72e03dcec0816
Caused By:
Error: API error (500): Failed to initialize logging driver: journald is not
enabled on this host
Here is my vagrant file:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "boxcutter/centos72-desktop"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 6080, host: 80
# config.vm.network "forwarded_port", guest: 6443, host: 443
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
# such as FTP and Heroku are also available. See the documentation at
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
# config.push.define "atlas" do |push|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
# end
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# apt-get update
# apt-get install -y apache2
# SHELL
end

Vagrant SSH error

When i do
vagrant ssh
i get
Administrator#WIN-NJMOO12L1J5 MINGW64 ~/Homestead (master)
$ vagrant sshssh_exchange_identification: read: Connection reset by peer
and i've tried booting with GUI and nothing is changed when i try to start with it, so i have probably done something wrong.
and i've seen that people say that i have to enable Intel® Virtualization Technology but my host doesnt alow that, so i dont know how to fix that.
Specs:
Windows Server 2012 r2
64bit
Ram 1gb
intel xeon e5 2697 v3 2.60 ghz
Vagrant file:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "laravel/homestead"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
config.vm.box_url = "./virtualbox.box"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
Vagrant.configure("1") do |config|
config.vm.boot_mode = :gui
end
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
# such as FTP and Heroku are also available. See the documentation at
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
# config.push.define "atlas" do |push|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
# end
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# sudo apt-get update
# sudo apt-get install -y apache2
# SHELL
end
Any help would be appreciated

Box 'laravel/homestead' could not be found

I have downloaded the laravel/homestead box manually from here.
I successfully add the box:
vagrant box add file:///path/to/the/laravel/homestead.box --name 'laravel/homestead'
but when I run vagrant up it says: Box 'laravel/homestead' could not be found even though vagrant box list shows the box.
The download page says that run vagrant init laravel/homestead that generates a vagrantfile but the laravel/homestead repository itself provides a vagrantfile.
I can vagrant up with the vagrantfile that is generated with vagrant init laravel/homestead but it lacks the essential configs inside the laravel/homestead repository's vagrantfile.
This is the vagrantfile that is generated
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "laravel/homestead"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
# such as FTP and Heroku are also available. See the documentation at
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
# config.push.define "atlas" do |push|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
# end
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# sudo apt-get update
# sudo apt-get install -y apache2
# SHELL
end
it has this setting:
Vagrant.configure(2) do |config|
config.vm.box = "laravel/homestead"
end
I tried to add this to the default laravel/homestead's vagrantfile but it didn't work.
require 'json'
require 'yaml'
VAGRANTFILE_API_VERSION = "2"
confDir = $confDir ||= File.expand_path("~/.homestead")
homesteadYamlPath = confDir + "/Homestead.yaml"
homesteadJsonPath = confDir + "/Homestead.json"
afterScriptPath = confDir + "/after.sh"
aliasesPath = confDir + "/aliases"
require File.expand_path(File.dirname(__FILE__) + '/scripts/homestead.rb')
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if File.exists? aliasesPath then
config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
end
if File.exists? homesteadYamlPath then
Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))
elsif File.exists? homesteadJsonPath then
Homestead.configure(config, JSON.parse(File.read(homesteadJsonPath)))
end
if File.exists? afterScriptPath then
config.vm.provision "shell", path: afterScriptPath
end
## HERE I added the setting ############################################
config.vm.box = "laravel/homestead"
########################################################################
end
What should I do?
The Vagrantfile provided by the laravel/homstead project is more advanced than a generic Vagrantfile that is generated by vagrant init
The Vagrantfile provided by the laravel/homstead project uses some ruby code to assist in setting up the vagrant environment. What we can see from the homestead ruby code is that it is checking that you have a box with a version greater than or equal to 0.4.0:
config.vm.box_version = settings["version"] ||= ">= 0.4.0"
As you added the box manually you will see that it is present on your local machine:
$ vagrant box list
laravel/homestead (virtualbox, 0)
Note however the number next to the provider is 0. That number is the box version. As the box was added manually the box metadata was not available and by default you will get a version of 0.
When you now do a vagrant up the code is checking if you have a box >= 0.4.0 which you don't have so is why you are getting Box 'laravel/homestead' could not be found. It would then attempt to download the box at the minimal version required.
To circumvent around this you could create a metadata.json file locally in the same directory as your downloaded box file. e.g:
{
"name": "laravel/homestead",
"versions": [{
"version": "0.4.0",
"providers": [{
"name": "virtualbox",
"url": "file:///path/to/homestead.box"
}]
}]
}
Then run vagrant box add metadata.json
This will install the box with a version and can be confirmed by:
$ vagrant box list
laravel/homestead (virtualbox, 0.4.0)
You will now be able to perform vagrant up using your local box.
I have solved the problem by following. I test only on Mac El-capitan.
vagrant box add laravel/homestead homestead.box
it shows the following:
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'laravel/homestead' (v0) for provider:
box: Unpacking necessary files from: file:///Users/lwinmaungmaung/Vagrant%20Boxes/Homestead/homestead.box
==> box: Successfully added box 'laravel/homestead' (v0) for 'virtual box'!
And then I changed to vagrant file directory
cd ~/.vagrant.d/
Then list files and I saw My boxes
cent hashicorp-VAGRANTSLASH-precise64 laravel-VAGRANTSLASH-homestead
and choose to laravel by cd laravel-VAGRANTSLASH-homestead
and ls and see 0
I command by mv 0 0.4.0
When I list by vagrant box list
cent (virtualbox, 0)
hashicorp/precise64 (virtualbox, 0)
laravel/homestead (virtualbox, 0.4.0)
Then I edit Vagrant Homestead file vi ~/Homestead/Vagrantfile
and add the following:
config.vm.box = "laravel/homestead"
config.vm.box_url = "https://atlas.hashicorp.com/laravel/homestead"
config.vm.box_version = "0.4.0"
config.vm.box_check_update = false
and then vagrant up
I hope it will works for some whose cannot add by metadata.json directly. Thanks.
if someone have the same probelm and useing win, check if ms visual libraries are ok, the main is curl.
https://www.microsoft.com/en-us/download/confirmation.aspx?id=5555
Why download the box manually, if you can let Vagrant do all that for you?
As said in the homestead documentation:
vagrant box add laravel/homestead will add and download the box for you.
"If this command fails, you may have an old version of Vagrant that requires the full URL:"
vagrant box add laravel/homestead https://atlas.hashicorp.com/laravel/boxes/homestead
You can add a box manually like so:
vagrant box add laravel/homestead path/to/your/box/file.box
How to Install Manually Downloaded .box for Vagrant
El-Capitan OS
Vagrant 2.2.14
Virtualbox 6
Go to you directory like: /user/(name)/Homestead/scripts
This directory is where you make vagrant init and other installation processes.
Open homestead.rb file with sublime text or text editor then change the following:
config.vm.box_version = settings['version'] ||= '‍‍‍‍‍~> 9'
TO
config.vm.box_version = settings['version'] ||= '‍‍‍‍‍>= 10.1.1'
after this changings you can start your vagrant in the directory
vagrant up
This will take some minutes to import your box into virtualbox.
I followed the accepted answer but still it was trying to download the virtualbox "box". I had to modify the following settings in scripts/homestead.rb
#config.vm.box_version = settings["version"] ||= ">= 1.0.0"
config.vm.box_url = "file:///home/divick/Homestead/virtualbox.box"
Note I have commented out the version line because it was complaining with the following message:
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Box 'laravel/homestead' could not be found. Attempting to find and install...
homestead-7: Box Provider: virtualbox
homestead-7: Box Version: >= 1.0.0
==> homestead-7: Box file was not detected as metadata. Adding it directly...
You specified a box version constraint with a direct box file
path. Box version constraints only work with boxes from Vagrant
Cloud or a custom box host. Please remove the version constraint
and try again.
For anyone facing this issue, make sure you upgrade your vagrant and adding laravel/homestead should get installed without issues.

PHPStorm cannot see PHP interpreter for Windows Guest using Vagrant

Due to a legacy project, I am running Windows Server 2008 R2 Standard with Ampps using Vagrant. This is the environment I am stuck using for now...
My issue is that I cannot seem to get PHPStorm to see the interpreter. When I go to the interpreter settings, I select Vagrant and I can choose my vagrant directory that contains the vagrant file and set the local location of the php.exe file. It just gives me an error saying:
PHP Version: Not installed
Debugger: Not installed
When I try to verify the interpreter, I get the error:
Can not update phpinfo: Can't connect to remote host ssh://vagrant#127.0.0.1:22C:\Ampps\php\php.exe
I would assume the issue is that PHPStorm is connecting using ssh instead of rdp.
Is there any work-a-round for this or is this not possible?
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "opentable/win-2008r2-standard-amd64-nocm"
config.vm.hostname = "freshHub"
config.vm.communicator = :winrm
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
# xdebug
config.vm.network :forwarded_port, host: 33389, guest: 3389, id: "rdp", auto_correct: true
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: "192.168.33.20"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
config.vm.network :public_network, ip: "10.1.1.21", :netmask => "255.255.255.0", bridge: 'wlan0'
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
config.vm.synced_folder "~/Sites", "C:/Sites", :mount_options => ["dmode=777","fmode=777"]
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.
config.vm.provider "virtualbox" do |vb|
# Set VirtualBox VM Name
vb.name = "freshHub"
# Display the VirtualBox GUI when booting the machine
vb.gui = true
# Customize the amount of memory on the VM:vagrant
vb.memory = "4096"
end
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
# such as FTP and Heroku are also available. See the documentation at
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
# config.push.define "atlas" do |push|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
# end
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# sudo apt-get update
# sudo apt-get install -y apache2
# SHELL
#config.vm.provision :shell, inline: "C:\Ampps\Ampps.exe", run: "always", privileged: false
# C:\Ampps\Ampps.exe
end
You try to connect on your Vagrant OS in loopback IP (127.0.0.1) but your Vagrantfile notice that the IP for him is 192.168.33.20 or 10.1.1.21.

Resources