Cross-browser testing of Internet Explorer in a Ubuntu 14.04 development environment - using VirtualBox and Microsoft VM.
VirtualBox is a system emulator that can run a guest operating system in a window of the host operating system.
This allows us to test websites on a range of platforms without dual-booting or running a dedicated test-machine.
There are two versions of Virtualbox available for Ubuntu. Both open-source, one is packaged by Ubuntu, the other provided by VirtualBox. Either download Virtualbox for Linux and build it yourself, or access Virtualbox in the Ubuntu software manager:
- Download VirtualBox for Linux hosts
- Search for “virtualbox” in Ubuntu software centre & install as usual
Build a Windows VM
Go to modern.ie and create the build you need. You can select an OS and a version of Internet Explorer.
Select “VirtualBox for Linux” as the Platform, and select “Download your Virtual Machine”.
Click “Batch File Download” - this opens a txt file with a list of URLS. The URLS are the files required to build the Windows VM.
Create a new directory for the VM, and move into the directory:
cd mkdir win7IE11 cd win7IE11
Run wget -i against the URL of the batch txt file to download all the necessary files:
wget -i https://az412801.vo.msecnd.net/vhd/VMBuild_20131127/VirtualBox/IE11_Win7/Linux/IE11.Win7.ForLinuxVirtualBox.txt
Go and have a cup of tea, cos it’s gonna take a while…
Make the file executable…
sudo chmod +x IE11.Win7.ForLinuxVirtualBox.part1.sfx
To extract the files, you may need to install the following:
apt-get install lib32stdc++6
Run the .sfx file to build the VM:
The VM files should be extracted to a
Import & Use the VM
Open VirtualBox. Click “Import Appliance” in the menu bar, and navigate to the .ova file.
VirtualBox will build the VM. To use it, open VirtualBox and launch the relevant VM.
The local server can be accessed on the VM at
http://10.0.2.2/. However, my out-of-the box settings give me access to localhost files, but built in references to stylesheets etc are broken - since “localhost” is referenced.
This is fixed by amending
C:\windows\system32\drivers\etc\hosts - just add the line
10.0.2.2 localhost. To open this as a Windows admin, open notepad as administrator (by right clicking) and then navigate to the hosts file.
comments powered by Disqus