DEV Community

Cover image for Try Wine before using VM on macOS
Kelvin Ng
Kelvin Ng

Posted on

Try Wine before using VM on macOS

I came across an astrology app called Astrolog, which is a Windows app. It's compiled into an .exe file, nothing fancy.

I wondered if there was a better way than installing Windows on my Mac, for just to run such a small program.

I gave Wine a try, and it worked!

Before installing Wine, you can check if your app has been tested with Wine by others in its app database. If someone has succeeded before, you'll have a higher chance of success too.

Installation

First, install Wine with Homebrew:

brew tap homebrew/cask-versions
brew install --cask --no-quarantine wine-stable
Enter fullscreen mode Exit fullscreen mode

Then, run the Windows app in Terminal:

wine64 /path/to/your/app.exe
Enter fullscreen mode Exit fullscreen mode

Note that wine and wine64 target 32-bit and 64-bit Windows apps respectively.

Easy Launching with Raycast (Optional)

One neat trick to enhance usability is to write a Raycast script to automate the launch of your Windows app. Essentially, it's just a one-liner besides the metadata.

#!/bin/bash

# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Astrolog
# @raycast.mode silent

# Optional parameters:
# @raycast.icon img/astrolog.svg

# Documentation:
# @raycast.description Open Astrolog in Wine

wine64 ~/ast76win64/Astrolog.exe
Enter fullscreen mode Exit fullscreen mode

Voilร ! You can now open a Windows app just like a native macOS app ๐ŸŽ‰

Top comments (0)