Complete guide for setting up Windows, Linux, and macOS VMs
This guide covers multiple VM solutions, from simple to advanced, to help you test Gopher on all platforms.
| Your Host OS | Best for Windows VM | Best for Linux VM | Best for macOS VM |
|---|---|---|---|
| macOS | UTM (free) or Parallels | UTM or Multipass | Not needed (native) |
| Windows | Native testing | WSL2 or VirtualBox | Not legally possible |
| Linux | VirtualBox + Wine | Native testing | Not legally possible |
# Install via Homebrew
brew install --cask utm
# Or download from https://mac.getutm.app/
Or use the free Windows 11 Development Environment:
Open UTM and click âCreate a New Virtual Machineâ
Select Virtualize (not Emulate)
# In Windows VM, open PowerShell as Administrator
# Install Chocolatey (package manager)
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# Install Git
choco install git -y
# Install Go (for testing)
choco install golang -y
# Refresh environment
refreshenv
# On your Mac, in gopher directory
make build-all
# The Windows binary is at: build/gopher-windows-amd64.exe
# Copy it to a shared folder or use GitHub
# Option A: Via GitHub
git push
# Then clone in Windows VM
# Option B: Via UTM shared folder
# In UTM: Settings â Sharing â Enable Directory Sharing
# On macOS
brew install --cask virtualbox
# On Linux (Ubuntu/Debian)
sudo apt update
sudo apt install virtualbox
# On Linux (Fedora)
sudo dnf install VirtualBox
# Or download from: https://www.virtualbox.org/
Same as UTM Option 1, Step 2
Open VirtualBox â Click âNewâ
Start VM and follow Windows installation
If youâre already on Windows, you can test directly! But you might want a clean VM for testing:
# Run PowerShell as Administrator
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
# Reboot after this
This is the easiest way to get Ubuntu VMs running!
# On macOS
brew install multipass
# On Windows
# Download from: https://multipass.run/download/windows
# Or: choco install multipass
# On Linux
sudo snap install multipass
# Create a VM named "gopher-test" with 2 CPUs, 4GB RAM, 20GB disk
multipass launch --name gopher-test --cpus 2 --memory 4G --disk 20G
# Or use defaults (1 CPU, 1GB RAM, 5GB disk)
multipass launch --name gopher-test
# Access the VM
multipass shell gopher-test
# Inside VM - Set up for testing
sudo apt update
sudo apt install -y git build-essential curl
# Install Go (optional, for testing system Go detection)
curl -OL https://go.dev/dl/go1.21.0.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.21.0.linux-amd64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc
# Clone your project
git clone https://github.com/yourusername/gopher.git
cd gopher
# Build and test
go build -o gopher cmd/gopher/main.go
./gopher version
# List all VMs
multipass list
# Stop a VM
multipass stop gopher-test
# Start a VM
multipass start gopher-test
# Delete a VM
multipass delete gopher-test
multipass purge # Actually removes deleted VMs
# Mount a folder from host to VM
multipass mount ~/gopher gopher-test:/home/ubuntu/gopher
# Copy files to VM
multipass transfer ./file.txt gopher-test:/home/ubuntu/
# Get VM info
multipass info gopher-test
# Execute command without entering VM
multipass exec gopher-test -- ls -la
# Visit: https://ubuntu.com/download/desktop
# Download Ubuntu 22.04 LTS (3+ GB)
# Or use the minimal ISO for servers
Open UTM â âCreate a New Virtual Machineâ
Select Virtualize
# Update system
sudo apt update && sudo apt upgrade -y
# Install essential tools
sudo apt install -y git build-essential curl vim
# Install Go (optional)
curl -OL https://go.dev/dl/go1.21.0.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.21.0.linux-amd64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc
# Clone and test Gopher
git clone https://github.com/yourusername/gopher.git
cd gopher
make build
# Run PowerShell as Administrator
# Install WSL2 with Ubuntu
wsl --install
# Or specify Ubuntu version
wsl --install -d Ubuntu-22.04
# Reboot if prompted
# After reboot, Ubuntu terminal will open
# Create username and password
# Update system
sudo apt update && sudo apt upgrade -y
# Install tools
sudo apt install -y git build-essential curl
# Install Go (optional)
curl -OL https://go.dev/dl/go1.21.0.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.21.0.linux-amd64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc
# Your Windows files are accessible at /mnt/c/
# Clone your project
git clone https://github.com/yourusername/gopher.git
cd gopher
make build
# List installed distributions
wsl --list
# Set default distribution
wsl --set-default Ubuntu-22.04
# Shutdown WSL
wsl --shutdown
# Enter WSL
wsl
# Or enter specific distribution
wsl -d Ubuntu-22.04
â ď¸ Legal Restrictions:
If youâre on macOS, you can test Gopher natively:
# Just build and test
make build
./build/gopher version
# Follow the macOS testing script from TESTING_GUIDE.md
If you want to test on a different macOS version:
# For macOS 13 Ventura and later
# Download from App Store
# Or use softwareupdate command
softwareupdate --list-full-installers
softwareupdate --fetch-full-installer --full-installer-version 13.5.2
Since setting up macOS VMs is complex, use Docker:
# Use the pre-configured Docker tests
make docker-test-macos-with-go
make docker-test-macos-no-go
These simulate macOS-like environments (not perfect, but good for basic testing).
If local VMs are problematic, use cloud VMs:
Free for personal use with GitHub!
# Already in your repository
make build
./build/gopher version
# Run all tests
make test
Get free VMs for 12 months!
# Using AWS CLI (after configuring credentials)
aws ec2 run-instances \
--image-id ami-0c55b159cbfafe1f0 \
--instance-type t2.micro \
--key-name YourKeyPair
# Or use AWS Console web interface
Simple and cheap ($6/month, $200 credit for new users).
# SSH into droplet
ssh root@your-droplet-ip
# Set up testing environment
apt update && apt upgrade -y
apt install -y git build-essential curl
# Install Go
curl -OL https://go.dev/dl/go1.21.0.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.21.0.linux-amd64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc
# Clone and test
git clone https://github.com/yourusername/gopher.git
cd gopher
make build
Free tier includes Windows VMs!
The fastest way to test on all platforms:
# Test on Linux (Ubuntu)
make docker-test-unix-no-go
make docker-test-unix-with-go
# Test on simulated macOS
make docker-test-macos-no-go
make docker-test-macos-with-go
# Test Windows build (simulation)
make docker-test-windows-simulated
# Or run all at once
make docker-test
Why Docker is easier:
Limitations:
Solutions:
1. Increase RAM allocation (4-8 GB recommended)
2. Increase CPU cores (2-4 recommended)
3. Enable hardware virtualization in BIOS
- Intel: Enable VT-x
- AMD: Enable AMD-V
4. Use SSD instead of HDD for VM storage
5. Close other applications while running VM
Solutions:
1. On Intel Macs: Check that VT-x is supported
2. On Apple Silicon: Use UTM (native support)
3. Ensure Parallels/VMware is not running simultaneously
4. Try UTM instead of VirtualBox
Solutions:
1. Check that TPM 2.0 is enabled in VM settings
2. Enable UEFI boot mode
3. Allocate at least 4 GB RAM
4. Try Windows 10 instead of Windows 11
5. Use the official Windows 11 Dev VM
# Check network adapter in VM settings
# Should be set to "NAT" or "Bridged"
# Inside VM, check network:
ip addr show
ping google.com
# Restart networking
sudo systemctl restart NetworkManager
VirtualBox:
1. Install Guest Additions
2. Settings â Shared Folders â Add folder
3. In VM: mount shared folder
sudo mount -t vboxsf ShareName /mnt/shared
UTM:
1. Settings â Sharing â Enable Directory Sharing
2. Files appear automatically in VM
Multipass:
multipass mount ~/gopher gopher-test:/home/ubuntu/gopher
Solutions:
1. Use "dynamically allocated" storage
2. Delete snapshots if not needed
3. Clean up inside VM:
- Windows: Disk Cleanup tool
- Linux: sudo apt clean && sudo apt autoremove
4. Compact VM disk:
- VirtualBox: VBoxManage modifymedium --compact
- UTM: Settings â Compress image
Solution:
1. Open System Preferences
2. Security & Privacy
3. Click "Allow" next to Oracle message
4. Restart VirtualBox
Solution:
1. Make sure you downloaded UTM (not UTM SE)
2. Use "Virtualize" not "Emulate" for x86_64 guests
3. For ARM guests, use "Virtualize" for best performance
4. Update to latest macOS version
# They can't run simultaneously
# Choose one:
# Disable Hyper-V (to use VirtualBox):
bcdedit /set hypervisorlaunchtype off
# Reboot
# Enable Hyper-V (to use Hyper-V):
bcdedit /set hypervisorlaunchtype auto
# Reboot
# Run as Administrator
# Enable required features
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
# Reboot
# Download and install WSL2 kernel update
# From: https://aka.ms/wsl2kernel
# Set WSL2 as default
wsl --set-default-version 2
| Solution | Setup Time | Cost | Platforms | Performance | Best For |
|---|---|---|---|---|---|
| Multipass | 5 min | Free | All | âââââ | Quick Ubuntu testing |
| UTM | 30 min | Free | macOS | ââââ | Mac users |
| WSL2 | 5 min | Free | Windows | âââââ | Windows users + Linux |
| VirtualBox | 60 min | Free | All | âââ | Cross-platform |
| Parallels | 30 min | $99 | macOS | âââââ | Best Mac experience |
| Docker | 5 min | Free | All | ââââ | Automated testing |
| GitHub Codespaces | 2 min | Free* | All | ââââ | Cloud-based |
| Cloud VMs | 15 min | $-$$ | All | ââââ | Production-like |
1. Use native macOS for Mac testing (no VM needed)
2. Install Multipass for Linux testing (5 minutes)
3. Install UTM for Windows testing (30 minutes + download)
4. Use Docker for quick automated testing
1. Use native Windows for Windows testing (no VM needed)
2. Install WSL2 for Linux testing (5 minutes)
3. Use Docker for automated testing
4. Cannot legally test macOS (use Docker simulation)
1. Use native Linux for Linux testing (no VM needed)
2. Install VirtualBox for Windows testing (60 minutes)
3. Use Docker for automated testing
4. Cannot legally test macOS (use Docker simulation)
Need Help?
If youâre still having issues:
Last Updated: 2025-10-11 Version: 1.0