Skip to content

Instantly share code, notes, and snippets.

@fedemp
Created April 12, 2012 18:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fedemp/2369775 to your computer and use it in GitHub Desktop.
Save fedemp/2369775 to your computer and use it in GitHub Desktop.
Running Windows under Ubuntu to test in Internet Explorer

How to test Internet Explorer 6 to 9 in Ubuntu

The final purpose of this tutorial is to have a Windows (XP, Vista, 7) running a native installation of Internet Explorer (6, 7, 8, 9). Windows will work as a guest in on Virtualbox running on Ubuntu. We will also make sure to have access to virtual hosts configured in the host OS.

Following steps have to be run on Ubuntu (or whatever flavor of Linux you have)

Download disk images of Windows

First step is to download Windows Virtual PC VHDs for testing websites with different Internet Explorer versions . These disk images are installations of different Windows versions with Internet Explorer installed. It's perfectly legal to use to any of these images; free as in beer.

Once you have download them, you will find that they are RAR files and one of them is an .exe file. Just rename the .exe file to .rar and we can continue.

You will need unrar to extract the files: sudo apt-get install unrar-nonfree. Be sure to install the nonfree package cause the free one won't work. Once the package is installed we can extract the files: unrar e filename.part01.rar

Getting VirtualBox

Now we will install VirtualBox: sudo apt-get install virtualbox-ose. Once installed just run virtualbox.

On the main interface of VirtualBox select option to create a new virtual machine. Give it a name, assign some RAM to it (I used 1.5GB), select the extracted .vhd file and almost ready.

Once the new virtual machine has been created, select it (without running it) and choose Settings. In the new window, click Storage on the left. It will show that VirtualBox will use a SATA controller with the current disk image. We will just remove the controller and add a new IDE controller. Under this controller, add the disk image as a hard disk.

Now your virtual Windows is ready to run. The password for both available users is Password1. If you can make mouse work, just press right CTRL+i to enable mouse capture.

Every time you boot it, Windows will say that you must activate it and that is copy is not genuine. Just ignore it and say that you will activate it later. This is an excepted behaviour.

*Note: You may be required to activate the OS as the product key has been deactivated. This is the expected behavior. The VHDs will not pass genuine validation. Immediately after you start the Windows 7 or Windows Vista images they will request to be activated. You can cancel the request and it will login to the desktop. You can activate up to two “rearms” (type slmgr –rearm at the command prompt) which will extend the trial for another 30 days each time OR simply shutdown the VPC image and discard the changes you’ve made from undo disks to reset the image back to its initial state. By doing either of these methods, you can technically have a base image which never expires although you will never be able to permanently save any changes on these images for longer than 90 days.

Access to host localhost and host virtual hosts

Since the point of this is to make all development work under Linux and use Windows just to test Internet Explorer, the only missing thing is to access from the guest OS to the web server on the host system. The solution comes from the great mind of Jorge Vazquez

Stop the virtual machine if it's running. On VirtualBox main screen choose File > Preferences. In the new window, select Network on the left and then Add host-only network. Once it's created, choose Edit host-only network and from the newly opened window write down the IPv4 address cause it's your key from the guest to the host.

Select once again the virtual machine and choose Settings. On the left select Network and then the tab that reads Adapter 2. Check the Enable Network Adapter, Attached to: Host-only Adapter and under name choose the only option available: vboxnet0. Confirm all the changes.

Boot the virtual machine and use notepad to open the hosts file (under C:\Windows\system32\drivers\etc\). At the end of it add the IPv4 address you got earlier and the virtual host name configured in the host machine.

192.168.56.1    virtual-host-url    # example: my-project.localhost

Save the file and try connecting to the virtual host using Internet Explorer. Hope it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment