With macOS Ventura, Apple added support for amd64 instruction translation to Linux VMs in Rosetta 2. This means that in addition to Virtio file sharing (macOS Monterey), applications using the Virtualization framework can perform significantly better. Now, this allows you to be able to develop legacy software in an emulated Linux virtual machine (in this context, legacy refers to non-AArch64 compliant software).

Now, to be clear, emulated amd64 is still very slow compared to native instructions, but, it is better than nothing. To get started, you are going to want to download UTM and then create an emulated Linux virtual machine. To reduce the slowness, a headless distro is recommended, e.g. Ubuntu Server.

Once the OS is installed, you are going to want to setup the development environment. For my use case, I need Python, Ruby, Node, and MySQL.

Python

Most distros ship with Python 3, but this legacy use case requires Python 2, so we need a Python version manager. pyenv is what I use and the setup is straightforward:

  1. Install pyenv
curl -fsSL https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
  1. Add pyenv to your shell
# Append to ~/.bashrc
export PATH="/home/<username>/.pyenv/bin:$PATH
eval "$(pyenv init -)"
  1. Restart the shell
exec "$SHELL"
  1. Install Python
pyenv install 2.7.18
  1. Set global Python
pyenv global 2.7.18

Ruby

Like Python, most distros ship with Ruby 3, but Ruby 2.7 is needed, so again we need a Ruby version manager. rbenv is what I use and the setup is just like pyenv:

  1. Install rbenv:
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
  1. Add rbenv to your shell
# Append to ~/.bashrc
eval "$(rbenv init -)"
  1. Restart the shell
exec "$SHELL"
  1. Install Ruby
rbenv install 2.7.7
  1. Set global Ruby
rbenv global 2.7.7
  1. Update gem and bundler
gem update --system && gem update bundler

Node

Node typically doesn’t come preinstalled, so, surprise, we need another version manager. fnm is what I use and you can probably now guess what the setup is like:

  1. Install fnm:
curl -fsSL https://fnm.vercel.app/install | bash
  1. Add fnm to your shell
# Append to ~/.bashrc
export PATH="/home/<username>/.local/share/fnm:$PATH"
eval "$(fnm env --use-on-cd)"
  1. Restart the shell
exec "$SHELL"
  1. Install Node
fnm install 14.21.2
  1. Set global Node
fnm default 14.21.2
  1. Update npm
npm i -g npm@^8.x.x

MySQL

Like everything else, MySQL is typically packaged for distros using version 8. Needing 5.7 proves a bit more challenging since getting packages will likely stop working at some point in the future. In order to get this working, we need to add the community repository:

  1. Grab the repository (for non-debian based OSes, a different location is required)
curl -fsSL https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb
  1. Install the repository
sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb
  1. During repository configuration, select Ubuntu Bionic as the source
  2. Select MySQL 5.7 for all available options
  3. Update APT
sudo apt update
  1. Verify MySQL 5.7 shows as available
sudo apt-cache policy mysql-server
  1. Install MySQL
sudo apt install -f mysql-client=5.7* mysql-community-server=5.7* mysql-server=5.7*

The last note I’ll share is that networking and file sharing can be a bit cumbersome to setup and, depending on your use case, could require advanced setup. However, it is worth noting that you can VPN just the virtual machine using openconnect.