Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Handy Vagrantfile for IE testing with Vagrant.
# Usage: IE={box} vagrant up
#
# Eg. IE=XPIE6 vagrant up
boxes = {
"XPIE6" => "http://aka.ms/vagrant-xp-ie6",
"XPIE8" => "http://aka.ms/vagrant-xp-ie8",
"VistaIE7" => "http://aka.ms/vagrant-vista-ie7",
"Win7IE8" => "http://aka.ms/vagrant-win7-ie8",
"Win7IE9" => "http://aka.ms/vagrant-win7-ie9",
"Win7IE10" => "http://aka.ms/vagrant-win7-ie10",
"Win7IE11" => "http://aka.ms/vagrant-win7-ie11",
"Win8IE10" => "http://aka.ms/vagrant-win8-ie10",
"Win8IE11" => "http://aka.ms/vagrant-win81-ie11",
}
unless boxes.has_key? ENV['IE']
abort('Invalid box supplied')
end
Vagrant.configure("2") do |config|
config.vm.box = ENV['IE']
config.vm.box_url = boxes[ ENV['IE'] ]
config.vm.guest = :windows
config.vm.boot_timeout = 1
config.vm.communicator = "winrm"
config.vm.provider "virtualbox" do |vm|
vm.gui = true
end
end
@anthonysterling

This comment has been minimized.

Copy link
Owner Author

commented Sep 8, 2014

The URL for Win8IE11 is wrong, as it's wrong on the blog post, hopefully they'll fix it as http://aka.ms/vagrant-win8-ie11 is a 404.

@ghost

This comment has been minimized.

Copy link

commented Feb 9, 2015

try win8.1-ie11

@anthonysterling

This comment has been minimized.

Copy link
Owner Author

commented Apr 1, 2015

Win8IE11 box url fixed.

@gandra

This comment has been minimized.

Copy link

commented Nov 17, 2015

Win7 IE 10 didn't work for me .. here is what I did:

D:\vagrant>vagrant box add Win7IE10 http://aka.ms/vagrant-win7-ie10
D:\vagrant>mkdir win7_ie10
D:\vagrant>cd win7_ie10

D:\vagrant\win7_ie10>vagrant init Win7IE10
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.

D:\vagrant\win7_ie10>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'Win7IE10'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: win7_ie10_default_1447752886051_84719
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

@ohjames

This comment has been minimized.

Copy link

commented Nov 26, 2015

@gandra Actually it's "supposed" to work this way, Vagrant is trying to ssh into the windows VM but the VM doesn't have an ssh daemon installed.

What you have to do is type virtualbox to get the virtualbox GUI up and running before you start the VM with vagrant. Then when you boot the VM using vagrant the virtualbox GUI will show you the windows desktop so you can interact with the VM.

@antongorodezkiy

This comment has been minimized.

Copy link

commented Feb 23, 2016

Thanks @ohjames

@kylegibson

This comment has been minimized.

Copy link

commented Mar 10, 2016

Does anyone know the shortcut URL for the Win10 MSEdge Vagrant box?

@ryanrankin

This comment has been minimized.

Copy link

commented Apr 27, 2016

@kylegibson

https://az792536.vo.msecnd.net/vms/VMBuild_20160322/Vagrant/MSEdge/MSEdge.Win10TH2.Vagrant.zip

Presumably, the "VMBuild_20160322" portion of the url changes every build.

@kadimi

This comment has been minimized.

@ViieeS

This comment has been minimized.

Copy link

commented Nov 10, 2016

Don't work on macOS Sierra...

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'XPIE6' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Box file was not detected as metadata. Adding it directly...
==> default: Adding box 'XPIE6' (v0) for provider: virtualbox
    default: Downloading: http://aka.ms/vagrant-xp-ie6
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
@trout-adrian-beyerle

This comment has been minimized.

Copy link

commented Nov 17, 2016

For macOS, the latest version of Vagrants embedded curl has compatibility issues.
try running -
sudo rm /opt/vagrant/embedded/bin/curl

@galeksandrp

This comment has been minimized.

@Puneeth-n

This comment has been minimized.

Copy link

commented Aug 12, 2019

can we execute selenium tests on internet explorer via vagrant powershell -c '...'

@dragon788

This comment has been minimized.

Copy link

commented Sep 26, 2019

You should use https:// for these URLs now, I've been getting connection failures if I just try to use http:// as I'm betting Microsoft enabled a forced security upgrade that the Ruby/Vagrant embedded curl/download library doesn't handle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.