Symfony 2 Crash Course
Enforce Coding Standards with PHP_CodeSniffer and Eclipse IDE on Ubuntu Linux
Changing Mailman Python Scripts for Virtual Host Support
Using Multi-Byte Character Sets in PHP (Unicode, UTF-8, etc)
Using PHP pspell Spell Check Functions with a Custom Dictionary
ENUMs, User Preferences, and the MySQL SET Datatype

How to Run Internet Explorer 7, 8 and 9 in Linux with or without Wine

Friday, 29 June 12, 11:34 am
Microsoft have a wonderfully long history of badly designed software that they're proudly continuing to this day with the abomination of IE 9 and the ghastly sham that is Windows 7. It's a tribute to the skills of the many hard-working marketing heads over at Redmond that despite the poor quality and the easy availability of superior cost-free alternatives, people the world over keep coming back to Microsoft like hookers on crack.

IEs4Linux

IE's popularity has exasperated professional web developers ever since the internet became more than an academic curio in the late 90s. Other than simple dual booting, the first option for those who wanted to test their sites on IE was tatanka's IEs4Linux, which uses wine to run the IE web installer. Just as if it were running under Windows, the installer connects to MS's servers, downloads, and then installs IE on your Linux machine. It's still available, but has for the most part been superseded by the winetricks installation described below.

Running Recent IE Versions

However, IE 6 usage has finally shrunk down to a mere couple of percent of web users, and can at last be ignored for the vast majority of web sites. Sure, there are people out there using IE 6, but in most cases they can be safely ignored as such people - with their ancient dusty desktops clunking along - are, to be blunt, unlikely to be big spenders on the internet.

More recent versions however remain popular, and while standards support is much better now than it used to be, there are still gotchas that will destroy your IE-using customers' confidence if allowed to make their way onto a live web site.

If your only concern is styling, and your site uses no fancy JavaScript, you may be able to get by using browsershots.org which will produce screenshots of your site on a variety of browsers. For anything else however, you're going to need a running version of the browser in question.

winetricks

winetricks can install IE 6, 7 and 8 using the Windows installer in much the same way as IEs4Linux does above. Unfortunately, IE 9 cannot be installed this way, and if you want more than one of IE 6, 7 and 8 available at the same time, you'll need to install each with a different WINEPREFIX (as shown above). During the installation, uncheck the 'Install updates' option when asked and choose 'Restart later' at the end. Installation is straightforward though:
WINEPREFIX=~/.wine32ie7 WINEARCH=win32 winetricks ie7


For IE 8:
WINEPREFIX=~/.wine32ie8 WINEARCH=win32 winetricks ie8 crypt32
Note we're also installing crypt32 for IE8 - a workaround for a crash in ntdll that otherwise occurs as soon as you try to interact with the browser. Instead of the crash, you will now see this error:



Click OK, which should bring up IE's 'Manage Add-Ons' dialog, which you can just close and then carry on to do whatever dastardly scheme you'd needed IE 8 for.

You can then run your copy of IE thus, changing WINEPREFIX according to the IE version you want:
WINEPREFIX=~/.wine32ie7 WINEARCH=win32 wine 'C:\Program Files\Internet Explorer\iexplore'
You may well encounter stability problems however, and you'll notice some graphical glitchiness, particularly when scrolling. Some people may also have a legal problem installing IE 7/8 this way, because the licences require you have a licence for Windows. This condition sounds a bit anti-competitive to me, and there's debate over whether it would hold up in a non-US court; nevertheless it may rule out the wine solutions for any companies or individuals that do not own a copy of Windows (note that Windows does not need to be installed on the machine in question, or indeed on any machine: you or your company just need to own a Windows licence). The offending passages are highlighted below:

VirtualBox

This leaves the final and most satisfactory option - running Windows in a Virtual Machine with an image containing the IE version you're targeting. You may think this also requires a paid-for licence from Redmond, but this is not the case. Microsoft itself has made virtual machine images freely available for each of IE 6, 7, 8 and 9 to try and encourage web designers and developers to support their tatty software.

Whilst this is the best option, the downside is that these images contain a full Windows setup, and therefore consume a huge amount of disk-space: around 10 GB for each version you plan to test. Running them is also rather demanding on system resources. VirtualBox is Open Source (GPLv2), and will need to be installed first. Most distros will have it in their package managers. In Ubuntu, the package is virtualbox-4.1:
sudo apt-get install virtualbox-4.1
In Arch Linux, it's just virtualbox; however additional packages are needed for the necessary kernel modules:
sudo pacman -S virtualbox virtualbox-modules
Next get the shell script that some very nice fellow has made available on GitHub which handles the downloading and setup of the VHDs.

Azee

1:09 pm, Saturday, 28 September 13

Its good to see this much information. By the way... Much simpler way to install IE8 or 7 through winetricks is:
in terminal type

winetricks ie8

and to launch type

wine 'C:\Program Files\Internet Explorer\iexplore'

t

Please enter your comment in the box below. Comments will be moderated before going live. Thanks for your feedback!

Cancel Post

/xkcd/ The Future of Orion