Installing Wine on Mac OS X

Installing Wine on Mac OS X
This tutorial is for intermediate users who want to install and use Wine on their computer running Mac OS X. You should already know the basics of how to use the command line. If you don't, read this tutorial first.

What is Wine?
Requirements
Part 1: Install MacPorts
Part 2: Install Wine Using MacPorts
Part 3: Install Windows Programs Using Wine
Part 4: Run Windows Programs Using Wine
Keeping Wine Up to Date
What is Wine?

Wine is awesome. No, I'm not talking about the kind you drink, I mean the kind that lets you run Windows apps without the Windows operating system.

It's kind of Zen, when you think about it. Oh, and did I mention it's completely free, legal, and open source?

Nowadays, Windows and Mac play nicely together. You can install Windows and Mac side by side and switch between them using Boot Camp, but that requires a reboot every time, and you can only use one operating system at a time. You can also use a tool like Parallels Desktop or VMware Fusion to virtualize Windows and run it together with Mac, but virtualization is slow and it takes up a lot of memory. (Your physical computer creates an imaginary "virtual" computer within itself, and runs Windows on that. That takes a lot of resources!) On top of that, all of these solutions require you to own a legal copy of Windows, which isn't cheap!

Wine is different. When any program runs, it requests resources like memory and disk space from the operating system. All that Wine does is make sure that those requests get answered so that the program can run correctly. As far as the program knows, everything is going smoothly because it has everything it needs. It never even realizes that it's not running on Windows! It's simpler than emulating a whole new computer, so it's faster. Since it's just translating requests, you don't need a copy of the actual Windows operating system. Plus, Wine is open source, which means people are continually improving it and adding new features. And you can't beat the price!

Requirements
To install Wine on your Mac, you will need the following:

An Intel Mac
Unfortunately, you can't install Wine on an older PowerPC Mac: it will only work with an Intel Mac. All new Macs use Intel processors. To see if your Mac has an Intel processor, go to the Apple logo on the far left of the toolbar, select About This Mac, and look at the Processor description. If it contains the word "Intel," you're good to go!
Access to an Admin account
You can't install software unless you're an Admin. You will need to be logged in to this Admin account during the installation. If there is only one account on your computer, it is an Admin account.
Apple Xcode
You can install Xcode from your Mac OS X installation DVD, or you can download it from the Apple website. It's free, but to download it you'll need to get a free Apple Developer account first. If you're running Leopard, you'll need Xcode 3.0 or higher. If you're running Tiger, you'll need Xcode 2.5.
X11
X11 is installed by default on 10.5 Leopard. If you are running 10.4 Tiger, you can install X11 from your Tiger installation DVD using the "Optional Installs.mpkg" file.
An internet connection
If you're reading this tutorial, you should be set.
About an hour
Don't worry, you won't need to be actually sitting at your computer for most of that time.
Part 1: Install MacPorts
MacPorts is a package manager that makes installing open source programs much easier. In particular, trying to install a large program like Wine without the help of a package manager would be tremendously difficult. Fortunately, MacPorts itself is simple to install.

On the MacPorts website, go to the Download and Installation page and download the appropriate "dmg" disk image for your computer.
Double-click the file you downloaded, and double-click the .pkg file to run the installer. You're almost done!
Open up the Terminal and copy and paste the following into it. Remember not to include the dollar sign ($). $ echo export PATH=/opt/local/bin:/opt/local/sbin:\$PATH$'\n'export MANPATH=/opt/local/man:\$MANPATH | sudo tee -a /etc/profileThe Terminal will ask for your password: this is the password to the Admin account on your computer. If you ran the command correctly, the Terminal should respond with:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export MANPATH=/opt/local/man:$MANPATHClose the Terminal. MacPorts has been installed!
Part 2: Install Wine Using MacPorts
Let's start using MacPorts right away! To tell MacPorts that you want it to install Wine for you, all you have to do is open up the Terminal again and enter this command (without the $):

$ sudo port install wineYou may be asked for your Admin account password again. The Terminal will start displaying lots of information. This is absolutely normal — MacPorts is just keeping you updated on what it's doing. This flow of information will be your guide to let you know whether or not the computer is still working. It will take a while for the install to finish: at least half an hour. As long as the Terminal keeps on giving you more information about what it's doing, don't interrupt it. Feel free to leave and do something else while the computer is installing Wine. When the Terminal stops giving you more information and is ready for another command, Wine is installed and ready to go!

Part 3: Install Windows Programs Using Wine
To install a Windows program, first download the installer file: it should end with .exe. Remember the location you put it, and open up the Terminal again. cd to the location, and use ls to make sure you can see the installer file. Once you are in the correct directory, run the installer through Wine by running the following command in the Terminal:

$ wine $INSTALLER.exeWhere $INSTALLER is the name of the installer file. X11 will open (if it isn't already), and soon you will see a regular graphical Windows installer. Click through it, and you're done!

Part 4: Run Windows Programs Using Wine
Open up the Terminal and run this to get to your Program Files folder:

$ cd ~/.wine/drive_c/Program\ Files/Run ls to see what programs you have installed. Pick a program, and enter its directory using cd. (If the folder has a space in it, you must type a \ before the space. For example, Program\ Files. If you're having problems, try using tab autocomplete.) There should be a file that ends in .exe: this is the program file. Type this into Terminal:

$ wine $PROGRAM.exeWhere $PROGRAM is the name of the .exe file. X11 will open (if it isn't already), and the program will pop up, ready to use! It will probably open fullscreen: to reduce it in size, go open the Window menu from the Mac OS X menu bar, and select Zoom Window. You can then resize the program normally. Enjoy using Windows on your Mac, freely and legally!

Keeping Wine Up to Date
Wine is an open source program. That means that programmers around the world are continually improving it, adding new features and squashing bugs. If you don't update Wine, though, it will never get those improvements, so it's generally a good idea to check for updates every so often. We can use MacPorts to keep Wine up to date: it's easy! Just run this command:

$ sudo port selfupdate && sudo port upgrade outdatedOnce again, you will need to enter your Admin account password. With this command, MacPorts will first update itself, if any updates are available. It will then find all the outdated software it knows about (including Wine) and upgrade them all to the latest version. Checking for updates isn't strictly necessary, as Wine runs quite well currently. However, it's a good idea to run this command every few months or so.

Comments

Post a Comment

Popular posts from this blog

How to put java applet in aspx page‏‏

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net