Install Wine on a Mac with Homebrew to run Windows programs

I’ve always gravitated to the Mac as my platform of choice to get things done. However there are some terrific programs out there that are only available for Windows. For instance my favorite GUI based text editor Notepad++ isn’t Mac compatible (VIM will still rule the command line).

Granted there are several commercial solutions like Apple’s Bootcamp, Parallels, VMWare Fusion, and Oracle’s Virtual Box, but all require a full blown Microsoft Windows environment to run in. This eats up disk space, and is costly.

I set out get Notepad++ running on my Mac without needing these aforementioned emulators. And I did it on Mac OS 10.6 Snow Leopard and 10.7 Lion, (this will presumably work on 10.8 Mountain Lion as well, but I’m cheap and haven’t upgraded yet).

Here’s what you’ll need to pull this off:

  • An Intel Based Mac running OS X 10.6+
  • A little command line interaction (don’t freak out, it’s easy)
  • Install Homebrew
  • Install wine from Homebrew
  • Install XQuartz for X11 emulation

Step 1: Install Homebrew - http://mxcl.github.com/homebrew/

This is a great project which is a package manager for anyone that’s  wanted linux apps on their mac without the hassel of having to do a lot of comandline kung-fu.

  • Open /Applications/Utilities/Terminal.app
  • Enter the following:
    • ruby -e “$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)”
  • Press ENTER when prompted
  • Put in your password when prompted, and press enter
  • Give it a couple minutes to download and install, don’t worry if you don’t see anything happening immediately
  • Enter the following:
    • brew doctor
  • This will check to make sure the Homebrew install is OK to run, review any errors or warnings as depending on your setup there might be some things you’ll need to correct

Step 2: Install WINE

Wine is a Windows emulator that runs on many Linux platforms. See http://www.winehq.org/ for more info. We’re going to make use of the Homebrew package to save some time.

  • Enter the following:
    • brew fetch -deps wine
    • brew install wine
  • This took about 15 minutes to complete on my Mac Mini, so be patient.

Step 3: Install XQuartz - http://xquartz.macosforge.org

The Homebrew install suggests you download this X11 package, and I concur. You could go with Apple’s X11 implementation, but it doesn’t seem to have the actively maintained updates of XQuartz.

  • Go to : http://xquartz.macosforge.org
  • Download the newest disk image
  • Run the XQuartz.pkg installer, and follow the prompts
  • Note the application is installed in /Applications/Utilities/XQuartz.app

Step 5: Running Wine and installing a windows EXE

  • Download Notepad++ Installer from http://notepad-plus-plus.org
  • Open XQuartz
  • Under the Applications Menu, choose Terminal
  • A new xterm window will popup

Here’s where things may differ between computer, adjust for your setup.

  • Enter the following:
    • cd /Users/youruser/Documents/Downloads
    • wine npp.6.3.Installer.exe
  • After a couple seconds, the wine window should popup and setup your system for a first run.
    • Note: wine make a virtual windows “C:\” drive in your home folder
    • /Users/youruser/.wine/drive_c/
  • Run the installer program like normal, it will install to the Program Files folder.

Step 6: Wrapping up

So now you should have a functioning wine install, as well as Notepad++, congrats. However, it’s a pain to have to open up an xterm and cd to folders and run commands everytime we want to open the program. Here’s how to add it to the XQuartz Application menu.

  • Open XQuartz
  • Under the Applications menu choose: Customize…
  • Click on: Add Item
  • Give it a Name (ie: Notepad++)
  • For the Command use:
  • /usr/local/bin/wine /Users/youruser/.wine/drive_c/Program\ Files/Notepad++/notepad++.exe

Now any time you want to launch this Windows program, just open XQuartz and click on it’s name from the Application Menu.

This entry was posted in Mac OS X, Tech Tips. Bookmark the permalink.

Comments are closed.