Get a MacOS or Linux shell, for free, in around 2 minutes
I don’t have a Mac, but I often want to test my software on a Mac, or build software for folks using Macs. Rather than shelling out thousands of dollars to buy a Mac, it turns out we can use GitHub Actions to give us access to one for free!
fastmacmakes this process as simple as possible. Note that this only gives us access to a terminal shell, not a full GUI.
Description above is from fastmac repo, and also:
fastmacis a very thin wrapper around tmate, so all the features of tmate are available. tmate itself is based on tmux, so you have all that functionality too. In practice, that means other people can connect to the same ssh session, and you’ll all be sharing the same screen! This can be very handy for debugging and support. The integration with Github Actions is provided by action-tmate.
This post will show you how to setup fastmac.
Instead of reading this post, you can also follow the guide fastmac creator provides.
Fastmac uses GitHub Actions, so you need to get a GitHub account first.
- Clone template
- Open this link to create a fastmac repository of your own.
- Note that the repository name needs to be “fastmac”, and the repo publicity needs to be “Public”, otherwise you have a strict monthly limit on how many minutes you can use, as the fastmac guide says, according to GitHub Actions ToS.
- This is my clone
- Run workflow
- Click Actions in your repo
- Choose mac workflow if you want a MacOS shell, otherwise choose Linux
- Click Run Workflow and the building process should start
- Once the building finished, the Setup tmate session part will output the ssh command and the Web URL you need to access the shellNote that the shell can be accessed by anyone, if anyone knows the right url or ssh address.
- Open shell
- Open the URL that workflow provides or connect through ssh.
- Note that the web shell and the ssh shell is in the same session, if you type commands in web, the ssh shell will display the same thing.
- Once you finished using fastmac, do not forget to click Cancel workflow to end the session, since you are actually taking up a computer that someone else could be using.