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.1
Inside VM:
sudo apt update && sudo apt -y upgrade
sudo apt -y install build-essential curl git unzip ca-certificates ripgrep
curl -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 -v
npm install -g @anthropic-ai/claude-code
claude doctor
Set API key:
echo 'export ANTHROPIC_API_KEY="sk-ant-..."' >> ~/.bashrc
source ~/.bashrc
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
git config --global init.defaultBranch main
git config --global pull.rebase false
Generate SSH key:
ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/id_ed25519 -N ""
cat ~/.ssh/id_ed25519.pub
Add the printed key to GitHub SSH keys.
Test:
ssh -T [email protected]
curl -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 login
From macOS:
ssh -p 2222 <username>@127.0.0.1
Inside the VM, go to your project folder and run:
claude
You 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)