Install Wine Mac Lion OS X 10.7 / 10.8 Mountain Lion

Wine (Windows Emulator) is a free and open-source application that aims to allow programs / softwares written for Microsoft Windows to run on Unix-like operating system such as Linux, BSD, Solaris and Mac OS X.

That said if you own Mac OS X based computers, you can run Windows applications such as Notepad, Mikrotik Winbox and more.

In this post I want to show you how to install Wine on Mac OS X Lion 10.7.2 (it should be also applicable for Snow Leopard 10.6, Leopard 10.5, and Tiger 10.4) via MacPorts.

UPDATE: For those of you who have upgraded to OS X Mountain Lion, you will be surprised that Wine will no longer work because Apple removes the X11 from Mountain Lion. The solution is you have to install XQuartz as the substitute of X11. You can download and install the XQuartz from XQuartz project website.

1. Download the MacPorts from its website. Select the appropriate file to meet with your Mac version. Note that you must have XCode and X11 (XQuartz in Mountain Lion) window environment installed in the system.

2. Once it’s downloaded, double-click the dmg file and follow the on-screen installation process. You have to be connected to internet while installing the MacPorts because it downloads the port files in a background process.

3. Once the MacPorts has been successfully installed, check whether the ‘port’ command is already in your PATH or not. In Mac OS X Lion, it should be already in the PATH. Otherwise run the below command to export the port into the PATH.

$ export PATH=$PATH:/opt/local/bin

4. Now we are ready to install the Wine via MacPorts by issuing ‘sudo port install wine’ as follow

$ sudo port install wine
Computing dependencies for wine
Dependencies to be installed: apple-gcc42 expat expat flex gettext libiconv gperf libiconv ncurses ncursesw ncurses fontconfig freetype bzip2 zlib zlib zlib freetype gnutls libgcrypt libgpg-error libtasn1 lzo2 pkgconfig glib2 libffi libffi perl5 perl5.12 gdbm gdbm perl5.12 perl5 perl5 xz xz glib2 pkgconfig readline jpeg jpeg lcms tiff tiff libpng libxml2 libxml2 libxslt mesa makedepend xorg-xproto py27-libxml2 python27 db46 libedit openssl openssl python_select sqlite3 xorg-dri2proto xorg-glproto xorg-libXfixes xorg-fixesproto xorg-libX11 xorg-bigreqsproto xorg-inputproto xorg-kbproto xorg-libXau xorg-libXdmcp xorg-libxcb xorg-libpthread-stubs xorg-xcb-proto xorg-util-macros xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-libXi xorg-libXext autoconf help2man p5.12-locale-gettext m4 automake libtool xorg-libXi xorg-libXmu xorg-libXt xorg-libsm xorg-libice xorg-libsm xorg-libXcomposite xorg-compositeproto xorg-libXcursor xorg-renderproto xrender xrender xorg-libXinerama xorg-xineramaproto xorg-libXrandr xorg-randrproto xorg-libXxf86vm xorg-xf86vidmodeproto

Fetching apple-gcc42
Attempting to fetch gcc-5666.3.tar.gz from

It will take a couple of minutes for the port script to retrieve, download, building and then install the wine and its dependency softwares. So be patient!.

When it’s done, you should see something like below:

Fetching archive for wine
Attempting to fetch wine-1.2.3_1.darwin_11.i386.tbz2 from
Fetching wine
Attempting to fetch wine-1.2.3.tar.bz2 from
Attempting to fetch from
Verifying checksum(s) for wine
Extracting wine
Configuring wine
Building wine
Staging wine into destroot
Installing wine @1.2.3_1
Activating wine @1.2.3_1
Cleaning wine

If there is no error like above, the Wine has been successfully installed on Mac OS X and you are ready to run Microsoft Windows programs.

11 thoughts on “Install Wine Mac Lion OS X 10.7 / 10.8 Mountain Lion

  1. When I run sudo port install wine it says ‘sudo: port: command not found’ – How can I fix this?

    1. The error says that the ‘port’ command can not be found in the current path. Have you installed the MacPort package? By default, in my system it is in /opt/local/bin/port. Please check in your system, where the port is installed.

  2. I followed all the steps but when I run sudo port install wine, my Mac freezes at “Building llvm-3.1” to the point where I have to manually reboot it :(

  3. I have Xcode 4.4.1 and XQuartz, on my OSX 10.8. I have been trying to install wine onto my laptop for a couple days now without success. Even before finding this article and learning that I needed XQuartz I received this error when attempting to “sudo port install wine” :

    Error: for port libunwind-headers returned: command execution failed
    Error: Failed to install libunwind-headers

    1. Hi, thanks for leaving comment here. If you got this error, try to run ‘sudo xcodebuild -license’ and agree the license agreement. You may also need to update the port using ‘sudo port selfupdate’ and then upgrade the outdated packages using ‘sudo port upgrade outdated’. I hope this solve your problem.

  4. I have XCode4 on my MacBook OSX 10.7.2, but sudo port install wine returns:

    —> Computing dependencies for pkgconfig
    —> Configuring pkgconfig
    Error: Target org.macports.configure returned: configure failure: shell command failed (see log for details)
    Log for pkgconfig is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_pkgconfig/pkgconfig/main.log
    Error: Unable to upgrade port: 1
    Error: Unable to execute port: upgrade pkgconfig failed
    To report a bug, see

    Have you run into this or heard of this?


    1. Hi Gwong,

      Thanks for dropping comment here.
      I’ve never run into this problem, but someone already posted the same problem in the MacPorts ticket. You can find the ticket at

      According to the ticket discussions, some of your MacPorts might have been replaced with ones that are not the right architecture.

      I hope it will be useful for you to solve the problem.

      1. I have tried what is above, unfortunately this what happened.

        Last login: Sun Sep 9 00:36:29 on console
        unknown-20-c9-d0-42-bb-5b:~ Bilan$ sudo port install wine
        Sorry, try again.
        sudo: port: command not found
        unknown-20-c9-d0-42-bb-5b:~ Bilan$

        1. The error message ‘port: command not found’ means that either you don’t have MacPorts installed or the path is not correctly set. Please refer to step 2 and 3 in the tutorial above.

Comments are closed.