Greetings everyone! Today I’ll explain how to setup native testing environment for major browsers on Ubuntu. Or to be exact on VirtualBox (with Windows XP). My assumption is that you have installed WAMP under Linux and you have a working project on localhost. If you perhaps didn’t understand something in this brief introduction, please do “google it“. 😀
If you’ve ever done any front-end coding for a website, you know what pain in the ass cross-browser compatibility can be. And If you’re developing on Linux (Ubuntu distribution in my case), you will have quite a problem with testing it out properly. There’s a much simpler solution for this (IEs 4 Linux, Opera, Firefox) but at the same time, its not the right solution because you won’t have Safari, IE 7 nor IE 8 (or even IE 9). The other big problem are MS fonts, that you cant render in 100% same way as on Windows.
The solution I find the best is to download “VirtualBox OSE” under Ubuntu and then install Windows through it. That way you will get both native environment for Internet Explorers and for other browsers. So, my idea was to guide you through the process of setting it up.
Installation itself on Ubuntu is pretty much simple:
- Go to Application -> Ubuntu Software Center and download VirtualBox OSE.
- When you’re done, you need to get ISO file of Windows installation CD / DVD
- Start the VirtualBox OSE (on Application -> Accessories menu)
- Press the “New” button, and follow the instructions (let’s call our windows – “Virtual XP” for this example).
- After you set it up, right click on “Virtual XP” and go to “Settings”
- Under “Storage” part of the settings, you will have both your virtual disc and your CD / DVD drive already setup, so select the CD / DVD drive and on right side click on open icon
- Again, click on “New” button in Virtual Media Manager window
- Now navigate through your file system and locate your Windows XP image file
- After you open it, just set focus on it and click “Select”
- You should now see “CD/DVD Device: your_image_file.iso” – if so click “OK”
- Locate “Virtual XP” on VirtualBox OSE default widow and double-click it
- Your ISO file should boot at this moment, and you just need to follow Windows installation instructions
- After you install the Windows, you just need to download and install browsers
Note: You can choose other version of Windows if you wish, but You might do some specific changes that I haven’t described here.
And now to the fun part – setting up our “Virtual XP” to connect to our LAMP server on Linux.
- Open up Network Connections on Ubuntu (System -> Preferences -> Network Connections), edit your network connection
- Go to “IPv4 Settings” tab, and add yourself a fixed IP. In our example, I used “192.168.1.21” with gateway “192.168.1.1” (if you aren’t certain how IPs, Gateways and Netmasks work – look here)
- Navigate to “?C:\Windows\System32\drivers\etc” and open hosts file with Notepad.
- enter this line at the bottom of the file: “192.168.1.21 mysite.loc” where “mysite.loc” is your virtual host you setup on LAMP.
- Save the file.
- Open “mysite.loc” in browser you wish to test it out in, and enjoy the magic 😀
That’s about it. I hope you’ve learned something here today, and that this article helped you.
Until next time, bye!