Testing Websites In Both IE 6 and IE 7 On Linux

vim-html-code

As anyone who works with web sites knows, Internet Explorer, is not the most standards compliant browser available. It is, however, for better or for worse, one of the most widely used. The closest competitor is the firefox web browser which we strongly recommend. Firefox is generally more compliant, runs on all common operating systems, and is free.

This article discusses how to run multiple versions of Internet Explorer (IE 6, IE 7, IE 8, etc.) on the same computer – whether that computer is running Windows or Linux. This is vital for production web work as there are vast differences between versions of IE and other browsers such as firefox, opera, etc. in their interpretation of CSS markup, the use of Javascript, and the display of graphics such as png files.

To assist people developing for Microsoft products, Microsoft offers a free download of their Virtual PC software along with images for their various web browsers. This allows you to run different web browser within separate virtual environments, for free.

You will need the following products:

* Microsoft Virtual PC 2007

* Microsoft Virtual PC Images with various Web Browsers

If linux is your primary operating system, then there are a few options. We tend to use an open source virtualization process and then run the software listed above with that program. For this, you will, however, need a copy of windows. We use virtualbox by Sun Microsystems, which is available for free.

If you are testing on your localhost with a xampp installation, for example you will need to load your websites by ip, not by http://localhost – so in linux this would be ifconfig to find your current ip address, or ipconfig in windows.

Setup of Virtualbox on Linux

vim2-html

This article is a collection of helpful tips for using VirtualBox on linux. It discusses basic setup information and common problems that people have including getting USB cards to work, COM errors, permission problems, problems after upgrading kernels, and helpful command line tips. For those not familiar with VirtualBox it is a free virtualization program from Sun Microsystems available for many platforms that, on linux, will allow you to run windows and other linux distributions on one computer. This often helpful for apps like quicken and quickbooks that do not have decent linux counterparts (the last windows app for many people), and for testing websites with windows without having to do dual booting or using a different computer.

* Basic Installation Information

* Getting USB Cards to Work With VirtualBox on Linux

* VirtualBox Fails to Start After Kernel Upgrade

* Failed to Open VirtualBox COM Object Critical Error

* Slow Printing With Windows Guest

* Command Line Tips

Basic Installation Information

Installation is fairly simple on most platforms (linux, osx, windows, etc.). Go to the VirtualBox Downloads page and choose what you need. The install should go smoothly.

Getting USB Cards to Work With VirtualBox on Linux

One problem that many people have on linux is getting the USB cards recognized in VirtualBox. Starting the program as root will often help and if that works for you that is probably a fine solution. To fix it for your user account (or other users) you would do the following (adapt for whichever distribution you have – this is for red hat/fedora, but should apply to all):

1. Add a “USB” Group – Under the System Menu, go under Administration, and then choose Users and Groups. Click to add a new group and call it “usb”, then add yourself and/or any users you want to run VirtualBox to that group – also make note of the group #, you will need it for the next command.

2. Now go to a command line and edit /etc/fstab and add the following: sudo nano /etc/fstab add the following line to the end none /sys/bus/usb/drivers usbfs devgid=502,devmode=664 0 0 save, then do sudo mount -a (or just restart)

3. Insert your usb card and make sure it works within linux

4. Then start VirtualBox (Under Applications/System Tools)

5. Under the Machine Menu, choose settings and then click on the USB item on the left

6. Check the appropriate box to enable the USB controller

7. You should now be able to mount the usb device when you start your image (windows or otherwise).

8. If you want that particular usb card permanent, then within the usb tab (from above) click on the second item on the right “Add Filter From Device” – choose the name of the device and then this will automatically be mounted within your image if it is available each time.

VirtualBox Fails to Start After Kernel Upgrade

After a kernel upgrade VirtualBox will often fail to start. The fix is usually fairly straightforward and consists of typing the following two commands from the command line:
sudo yum install kernel-devel

sudo /etc/init.d/vboxdrv setup

Failed to Open VirtualBox COM Object – Critical Error

This error “Failed to Create the VirtualBox COM Object” can come about for many reasons. When you are running on linux this is usually a permissions issue that often comes out from having run VirtualBox as superuser a time or two. To fix it you can do the following commands from the terminal (also running the VirtualBox from the command line will tell you which file(s) are causing the problem).
cd ~

sudo chown -R myusername:mygroup ~/.Virtualbox

then

cd /tmp sudo -R /tmp/.vbox-yourusername-ipc

Slow Printing With Windows Guest

The default setup for running a windows guest is to use NAT for networking. This generally means that communication from your guest computer to your host is fairly slow. This often effects printing speeds, making them painfully slow. Previously you fixed this by doing a fairly complicated setup of bridges. As of the 2.1.x branches, however, you can simply select HFI for the networking type in the network setup screen for your host (within virtualbox). This will remedy the issue in most cases.

Command Line Tips

VirtualBox has a number of helpful command line tools which are particularly helpful if you are running headless servers. For the general user, however, setting up scripts to start a particular image instead of starting the program and the starting the image may be helpful. To accomplish this you can do the following:
From a terminal:

cd ~ nano startyourimage.sh

In this file add:

#!/bin/sh /usr/bin/VBoxManage startvm "imagename"

Close the file and make it executable:

chmod 755 startyourimage.sh

Then if you want to do a launcher for it you can right click on the top bar in gnome and select “add to panel”, then choose “custom application launcher”, under command tell it /home/yourusername/startyourimage.sh