This guide shows how to set up an isolated Ubuntu ARM server VM using UTM with QEMU emulation on macOS, configure SSH access via port forwarding, and install Claude Code and GitHub tools.
brew install --cask utm- Download Ubuntu Server (ARM64 ISO):
Ubuntu Server ARM64 ISO - Open UTM → Create a New VM.
- Do NOT use apple virtualization - we need Emulated VLAN mode to support Port Forwarding
- Select the Ubuntu ARM64 ISO.
- Configure resources:
- CPU: 6–8 cores
- Memory: 8–16 GB
- Disk: 50–100 GB (virtio)
- Network: Emulated VLAN (Shared).
- Save and start VM to launch installer.
Follow the installer prompts:
- Guided storage → use entire disk
- Set hostname, username, password
- Select Install OpenSSH server
- Complete install and reboot
- Shut down the VM.
- In UTM → Edit → Network → Emulated VLAN (Shared).
- Add Port Forwarding rule:
- Protocol: TCP
- Host Address: leave blank
- Host Port:
2222 - Guest Address: leave blank
- Guest Port:
22
- Start VM.
- From macOS terminal, connect:
ssh -p 2222 <username>@127.0.0.1Inside VM:
sudo apt update && sudo apt -y upgrade
sudo apt -y install build-essential curl git unzip ca-certificates ripgrepcurl -fsSL https://fnm.vercel.app/install | bash
export PATH="$HOME/.local/share/fnm:$PATH"
eval "`fnm env`"
fnm install 20
fnm default 20
node -v
npm -vnpm install -g @anthropic-ai/claude-code
claude doctorSet API key:
echo 'export ANTHROPIC_API_KEY="sk-ant-..."' >> ~/.bashrc
source ~/.bashrcgit config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global init.defaultBranch main
git config --global pull.rebase falseGenerate SSH key:
ssh-keygen -t ed25519 -C "you@example.com" -f ~/.ssh/id_ed25519 -N ""
cat ~/.ssh/id_ed25519.pubAdd the printed key to GitHub SSH keys.
Test:
ssh -T git@github.comcurl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update && sudo apt -y install gh
gh auth loginFrom macOS:
ssh -p 2222 <username>@127.0.0.1Inside the VM, go to your project folder and run:
claudeYou now have an isolated Ubuntu VM with Claude Code and GitHub access, running inside UTM on macOS.
Emulated VLAN mode for environments where Bridged networking doesn't work (some Wifi routers apparently block bridging)