We've covered the advantages and disadvantages to using Parallels to deploy virtual Windows "servers" on your Mac for development. Now let's get down to it. Here's how to successfully install Parallels, Windows, and ColdFusion on OS X.
- How does all of this work?
-
Well, Parallels creates a "virtual machine" (VM) running under OS X which Windows thinks is a real computer. And part of that machine is a virtual network card that Windows uses to access the outside world.
Amazingly enough, OS X can also see and access the other side of that virtual NIC, giving it access to the virtual system hidden inside, and access to any ports and services that machine may be running. - What do you need?
-
As I indicated before, you're going to need a copy of Parallels, a copy of Windows XP Professional SR2, and your computer may need some more RAM.
First, get Parallels Desktop for Mac. While you can get a boxed version from Amazon and save a few bucks, I'd get it directly from the Parallels website. That way you know you're installing the latest and greatest version.
Second, Windows. If you have a non-OEM version of Windows you can install or transfer, great. Otherwise, if you need to buy one, go to Amazon and get the Microsoft Windows XP Professional SP2B for System Builders version and save yourself $90.
Third, memory. While Parallels/Windows with a 512MB partition worked reasonably well on my 2GB MacBook Pro, upgrading to 3GB made a huge difference in performance and system responsiveness. Well worth doing even if you're not running Parallels. - Installing Parallels:
-
The first thing you need to do is install Parallels. Just run the installer and follow the instructions, installing it onto your boot drive.
Once done, open your Applications folder, and then double-click the orange Parallels icon. Enter your activation key. - Installing Windows:
-
Now you are ready to create a new virtual machine. Have an installation disc with the full version (not OEM version) of Windows XP ready and insert it into the CD/DVD-ROM drive.
In the OS Installation Assistant, tell Parallels you'd like to do a new XP installation, and on the next page, select the Windows Express option. It will then ask your for your Windows Product Key and your name. Enter them, then tell it to install from the inserted Windows CD.
Now take a break. Parallels will create a new virtual machine for you and install the guest OS in unattended mode. Moreover, it will install the Parallels Tools and any custom drivers needed when the OS installation is complete.
This part of the process is painless. Why is installing Windows on a Mac easier than installing it on a PC? - Installing Kaspersky:
- Windows is installed, but Windows is still Windows, and prey to all of those pesky virus thingies. To protect your new Windows XP virtual machine, select in the menu: Actions -> Install Kaspersky Internet Security. Follow instructions. Wait. Restart.
- Instal your Web Server:
-
I assume you're going to want to use IIS for your web server. If so, go to Control Panels > Add or Remove Programs > Add/Remove Windows Components. Select Internet Information Services and click Details. You want everything but the Front Page extensions.
Use the Internet Information Services control panel tool or MMC snap-in to configure your root web site, its path, and so on. Make sure the IP address is "All Unassigned".
If Apache or some other server floats your boat instead, do that installation now. - Install Security Updates:
-
Now would be a good time to install needed Windows security updates. Start IE and select Windows Update. Do a custom install of the critical security updates.
DO NO SELECT OR INSTALL IE7 AT THIS TIME. We're going to want at least one VM to have the base version of IE6 for testing our web sites.
Security update installation will take a while. Go have lunch. - Network Setup:
-
This is the tricky part. By default, Parallels acts as a NAT bridge with built-in DHCP, and the standard virtual NIC is set to ask it for its network settings. Mess with that too much, and Windows will not be able to access the web.
Plus, since the IP address is dynamically assigned it can make assigning host names or bookmarking your development "server" a pain.
So what we want to do is install another network card with a static IP address.
Shutdown Windows using the start menu (Always shutdown Windows using the Start menu option), then select the Parallels Edit > Virtual Machine menu item.
You'll get the VM dialog, with a list of the standard devices on the left. Click Add. Select Network Adaptor and go next, select Host-Only Adaptor and go next, and accept the given MAC address by clicking Finish.
Now restart your VM. You'll want to go into Window's Network Connections, select your new NIC, and give it a static IP address of 10.37.129.10 with a mask of 255.255.255.0. (The IP range of 10.37.129.1-254 is defined for Host-Only adaptors in Parallels' preferences dialog.)
Do NOT give it a gateway IP address. Leave that to the other NIC to handle.
Bounce back into OS X and run Safari. Go to http://10.37.129.10/
You should now see the standard IIS start page. Congratulations. You're now the proud owner of a virtual web server. - Backup:
-
Now would be a good time to Shutdown Windows once again, and use Parallels to clone this installation. Name it "Base Installation", and you can use it as a starting point to create new, custom VM's for new projects and clients.
If you're always going to use the same version of CF and the same database for your VM's, wait until you've completed the next two steps. - Install ColdFusion:
-
Fire up IE and download a copy of CF for Windows. Install it as you normally would, selecting the non-standalone version that integrates with IIS. Make sure you enable RDS, as that's the easiest way to work with your new server using Dreamweaver.
Note that you can also clone your VM and install other environments, such as Ruby or Python or Tomcat, or do the same and install different versions of ColdFusion as needed. Perhaps one client is stuck on CF4.5, or you want to test CF8. Parallels makes it easy. - Install your Database:
-
Download and install SQL Server, Oracle, mySQL, Postgres, or whatever database it is that you need and install as you normally would under Windows XP.
Again, multiple VM's let you use the database you need for each client, or lets you use the same database (like SQL Server), but with potentially conflicting logins, tables, database names, or stored procedues. - Setup a Hosts alias:
-
I've setup a hosts alias (http://winxp/) to make browsing to my new server easier. The hosts file is hidden in the /etc directory on OS X, and if you're going to want to edit it you're going to need root access.
Follow the instructions on Apple's site for Enabling and using the "root" user in Mac OS X. Now go to the /etc directory and edit "hosts" using TextEdit.
Add 10.37.129.10 WINXP (or whatever name you wish) and save. Logout and back into your normal account. - Mission Accomplished:
-
You can now run the Window's version of ColdFusion, SQL Server, Enterprise Manager, IIS, IE6/IE7, and any other Window's applications and services you may need, in as many different configurations as needed.
Take another break. You've earned it.
As a happy owner of a 2G MacBook Pro, I'd like to be happier. What was the effort level and process required to upgrade to 3G?
Thanks.
Posted by: Rob Wilkerson | June 11, 2007 at 07:39 AM
Rather than enabling the root user, some may find it preferable to edit /etc/hosts using sudo:
$ sudo vi /etc/hosts
Just an option for anyone concerned with security.
Posted by: Rob Wilkerson | June 11, 2007 at 07:42 AM
@Rob, Unlike changing a HD, upgrading RAM is easy. Turn your MBP over and remove the battery. You'll see a little metal cover held in by four screws. Remove it and the memory sticks are exposed. Swap out the top one for a 2GB stick, put everything back, and you're done.
Posted by: Michael Long | June 11, 2007 at 11:23 AM
Great guide - thanks for all your assistance in getting this environment set up!
Posted by: Andrew Jones | June 11, 2007 at 12:34 PM
Great guide...especially on the network stuff...many thanks.
Posted by: Sam Farmer | September 05, 2007 at 09:33 AM
Thanks for posting this. I've been struggling to get CF and msql to work with Apache on Leopard. I need a portable development environment and this looks quite doable. I was going to have to install Parallels anyway because I have clients give me Access files which I export to MySql using Navicat. Setting this up is on my todo list this week.
Posted by: J Murphy | November 03, 2007 at 09:10 PM
This is a great and well detailed tutorial. Thank you for spending the time to write it.
I need a little help with the network setup. I cannot seem to get OS X to access the default site using the IP in Safari. I stepped through the process very diligently. Do you have any suggestions to troubleshoot?
Posted by: Boomer | November 29, 2007 at 10:57 PM
Here's the solution (I had a last ditch thought after I posted me plea moments ago) to the network connection problem.
You may need to go into Windows Firewall panel through the control panel. In there, click on the advanced tab then select the new NIC and click "settings."
Once in settings, you'll need to place a check-mark next to "Web Server." The settings window will display. Simply place the IP address in the input field.
If you run into challenges getting the network to talk, this may help you.
Posted by: Boomer | November 29, 2007 at 11:12 PM
Michael,
Can the fixed IP assigned the virtual guest (winXP) access the webserver by entering the IP address: 10.37.129.10?
I ran into a problem whereby I installed Wamp and sugar crm on winxp (guest) on mac leopard where I have parallels. I tried both giving it a DHC assigned IP by selecting en1 under Devices/network adapter (airport), thus winxp guest has an ip like 192.168.1.8. I can pind the ip from other computers on the lan. but when I attempt to connect to 192.168.1.8/sugarcrm which is the web address, I get permission denied. Same result when I try to do that from a browser on mac x.
There must be something with parallels giving permissions to guest xp.
Posted by: jsahiri | January 10, 2008 at 09:27 PM
Setting up the host-only ip is not working for me at all... I can't seem to connect to the VM.
I'm running windows xp, not using Parallels but instead using VMware.
Set the second network adapter to host-only...
What am I doing wrong?
Posted by: Devin Columbus | January 17, 2008 at 07:20 PM
A newbie here:
I am using Parallels on a Mac with Leopard 10.5.6. I have Cold Fusion 8 and Dream Weaver 8 installed on the windows side.
I cannot get my local server set-up to test successfully, using the http://localhost:8500/mywebsite can anyone tell me how to correct this issue? Is it a problem on the Dream weaver side?
I had Cold Fushion 7 installed and did not have this problem.
Posted by: S Graham | April 15, 2009 at 06:18 PM