AWS EC2 vs Azure Virtual Machines

AWS EC2 and Azure Virtual Machines are the same kind of product: plain cloud VMs with their own kernel that you set up yourself. They differ in the details. EC2 bills per second and rents Mac hosts. Azure bills per full minute, lists more regions and keeps three replicas of each managed disk.

The companies and products

AWS EC2

AWS EC2 is Amazon's general-purpose cloud VM service, not a sandbox product: you rent virtual servers by the second and set them up yourself.

You pick an instance type (Intel, AMD, Graviton Arm, GPU or Mac), a machine image and a network, and EC2 boots a Nitro VM with its own kernel and root access. Disks are EBS volumes, and security groups control inbound traffic. You set up the agent parts yourself: agents, desktops, HTTPS URLs and key handling. AWS also sells managed agent sandboxes, Bedrock AgentCore Code Interpreter and Browser, as a separate product. EC2 serves every kind of server workload, from websites to GPU training, across AWS's worldwide regions.

Azure Virtual Machines

Azure Virtual Machines is Microsoft's general-purpose cloud VM service: you rent Linux or Windows machines by the minute in Azure regions worldwide.

It is a hyperscaler IaaS product, not a sandbox API. Each VM runs on Microsoft's Hyper-V hypervisor with its own kernel, root and SSH. You pick from hundreds of sizes, including Arm, burstable and GPU families. Networking, disks, images, firewalls and agent tooling are separate pieces that you set up. It suits teams that already run on Azure and want full control.

Which use cases each one fits

For each use case, Battleships prices every sandbox provider on the same workload and sorts them from the cheapest monthly bill up. “7th cheapest of 359” means 6 of the other 358 providers run that workload, with every feature it needs, for less. “With limits” means the provider runs it but misses something, so it is listed after every full match. Open a use case for its whole ranking and what each provider misses.

Use case and its workloadAWS EC2: price rankAzure Virtual Machines: price rankboat: price rank
Software factory
100 at once · 4 vCPU / 8 GB · 2,200 sessions of 8 h a month
118th of 365, with limits
$775 a month
114th of 365, with limits
$730 a month
5th cheapest of 365
$634 a month
Always-on AI employees
50 machines 24/7 · 2 vCPU / 4 GB
177th of 361, with limits
$646 a month
176th of 361, with limits
$644 a month
6th cheapest of 361
$657 a month
Code interpreter bursts
100 at once · 1 vCPU / 2 GB · 200,000 sessions of 1 min a month
Both clouds handle short code bursts better than boat's start limits allow, though each VM takes tens of seconds to boot. All three are a compromise here.
106th of 336, with limits
$165 a month
118th of 336, with limits
$222 a month
189th of 336, with limits
$2,000 a month
Sandboxes for your users
300 at once · 2 vCPU / 4 GB · 30,000 sessions of 23 min a month
Azure comes out a little ahead of EC2 for sandboxes for your users, but on both you build the URLs, auth and cleanup yourself. boat ships that layer.
76th of 349, with limits
$607 a month
69th of 349, with limits
$500 a month
3rd cheapest of 349
$209 a month
RL rollouts
1,000 at once · 2 vCPU / 4 GB · 1,000,000 sessions of 3 min a month
EC2 ranks above Azure for RL rollouts once your vCPU quota is raised. Both rank above boat, whose start limits charge for or refuse starts in large bursts. All three are a compromise here.
15th of 349, with limits
$830 a month
22nd of 349, with limits
$1,039 a month
39th of 349, with limits
$2,000 a month
Agent evals
250 at once · 4 vCPU / 8 GB · 15,000 sessions of 20 min a month
Both clouds fit agent evals fully and sit near the top: Azure at $173 a month and EC2 at $177. boat comes to $200.
7th cheapest of 359
$177 a month
5th cheapest of 359
$173 a month
10th cheapest of 359
$200 a month
CI runners
40 at once · 8 vCPU / 16 GB · 6,000 sessions of 12 min a month
Both run CI fully, EC2 at $255 a month and Azure at $335. boat comes to $86, with Docker and /dev/kvm on every sandbox.
19th cheapest of 374
$255 a month
33rd cheapest of 374
$335 a month
2nd cheapest of 374
$86 a month
24/7 dev boxes
1 machine 24/7 · 4 vCPU / 8 GB
A 24/7 dev box is $76 a month on EC2 and $94 on Azure, and both keep billing the disk while stopped. boat is $26; a stopped boat disk is kept for at least 14 days.
60th cheapest of 371
$76 a month
74th cheapest of 371
$94 a month
19th cheapest of 371
$26 a month
Computer-use agents
50 at once · 4 vCPU / 8 GB · 20,000 sessions of 15 min a month
Neither cloud has a built-in desktop stream or computer-use API on Linux. You can install one: Amazon DCV on EC2, xfce and xrdp on Azure. boat streams a 60fps desktop on every sandbox.
145th of 367, with limits
$195 a month
143rd of 367, with limits
$192 a month
7th cheapest of 367
$200 a month
Browser-use agents
50 at once · 2 vCPU / 4 GB · 30,000 sessions of 10 min a month
232nd of 356, with limits
$101 a month
233rd of 356, with limits
$107 a month
7th cheapest of 356
$200 a month
Scraping & bots (startup scale)
50 at once · 1 vCPU / 2 GB · 100,000 sessions of 3 min a month
259th of 343, with limits
$116 a month
258th of 343, with limits
$116 a month
6th cheapest of 343
$90 a month
Mass scraping & bots (undetectable)
1,000 at once · 1 vCPU / 2 GB · 3,000,000 sessions of 2 min a month
85th of 327, with limits
$2,046 a month
84th of 327, with limits
$2,044 a month
73rd of 327, with limits
$1,800 a month
Parallel red teaming
200 at once · 2 vCPU / 4 GB · 5,000 sessions of 30 min a month
162nd of 351, with limits
$45 a month
164th of 351, with limits
$46 a month
3rd cheapest of 351
$200 a month
GPU eval jobs
10 at once · 8 vCPU / 32 GB · 500 sessions of 30 min a month
Of these three, only AWS EC2 fits GPU eval jobs in our table, at $1,723 a month. Azure rents GPU sizes too, but has no fitting row here, and boat has no GPU.
26th cheapest of 102
$1,723 a month
Not ranked: misses a requirementNot ranked: misses a requirement
macOS agents
5 at once · 4 vCPU / 8 GB · 1,000 sessions of 20 min a month
Not ranked: misses a requirementNot ranked: misses a requirementNot ranked: misses a requirement

Key features

FeatureAWS EC2Azure Virtual Machinesboat
What you getA general cloud VM; you install and wire everything elseA general cloud VM; images, networking and tooling are yours to set upAn agent sandbox: a full VM with agents, desktop, URLs and snapshots set up
IsolationNitro VM with its own kernelHyper-V VM with its own kernelFull VM with its own kernel; vCPUs are shared, not dedicated cores
BillingPer second for Linux and Windows, 60 second minimumPer full minute; a VM shut down from inside the OS keeps billing until deallocatedPer second while running, from a monthly plan ($20 minimum); no compute charge while stopped
Nested virtualizationKVM or Hyper-V on Intel 7th/8th-gen families (C7i, M7i, R7i, C8i, M8i, R8i, X8i, I7i and variants) and metal; not on Graviton or AMDOn many Intel and AMD sizes (such as D, E and F series); not on Arm or B-series/dev/kvm, Docker, root and systemd on every sandbox
Operating systems and CPUsLinux and Windows on Intel, AMD and Graviton Arm; macOS on Mac Dedicated HostsLinux and Windows on Intel, AMD and Arm (Cobalt 100, Ampere Altra); no macOSUbuntu 24.04 x86_64 on AMD Ryzen 7 9700X and Ryzen 9 9950X hosts; Windows programs through Wine
GPUsNvidia GPU instances, from L4 and L40S up to H100 and H200GPU families such as NC with Nvidia H100 and A100No GPU on any size
Coding agentsYou set it up: install and drive them over SSH or Systems ManagerYou set it up: install and run them with Run Command, scripts or SSHSeven harnesses installed, including Claude Code, Codex and OpenCode, with a prompt, steer and events API
Keeping keys out of the machineIAM roles give the instance short-lived AWS credentials; for other API keys you set up your own proxyKey Vault secrets are fetched into the VM, where its code can read them; you can set up your own proxyOptional paid AI credentials proxy ($1 a day plus $1 per 1,000 requests): real keys of supported model providers stay out; other secrets still enter
Desktop and computer useLinux images have no desktop by default; install one and stream it with Amazon DCV (no license fee on EC2); Remote Desktop on Windows; no computer-use APIYou set it up: install a desktop such as xfce and xrdp, then open port 3389; no computer-use APIBuilt-in desktop and Chrome at 1920x1080, 60fps, with computer-use tools and an embeddable stream
Reaching the machinePublic IPv4 ($0.005 an hour), static Elastic IPs and any port through security groups; HTTPS needs your own domain, certificate and load balancer or web serverPublic IPv4, static if you pay for it, and any port through security groups; HTTPS is yours to run, or you add a load balancer or gatewayHTTPS URLs on up to 50 ports, token-gated by default; SSH; no static IPv4, and the IP changes at each resume
Files after a stopEBS disks kept until you delete them and billed while stopped; snapshots manual or scheduled with Data Lifecycle ManagerDisks kept and billed while deallocated; managed disks keep three replicas (at least 11 nines a year on LRS)Disk saved every minute and at each stop; kept at least 14 days after a stop, longer with a saved snapshot
Fork and pauseClone by making an image and booting a new instance; hibernation keeps memory for the same instanceCapture a gallery image (the VM stops briefly) or snapshot its disks, then boot new VMs cold; hibernation up to 64 GB of RAM on general-purpose sizesFork a running sandbox in one call from its last 1-minute snapshot; resume reboots from disk (no memory kept)
Outbound network rulesSecurity groups; domain allowlists with AWS Network Firewall or DNS Firewall (paid)Security groups; domain allowlists with the paid Azure FirewallOpen internet on every plan; no provider-side allowlist
Regions39 regions and 124 availability zones77 regions listed as available or coming soonGermany, Finland and France; no US or Asia region, and you cannot pick one
Every feature Battleships tracks (43)
FeatureAWS EC2Azure Virtual Machinesboat
Full VM (own kernel)YesYesYes
Docker insideYesYesYes
Nested virtualizationYesYesYes
RootYesYesYes
SystemdYesYesYes
Desktop GUIWith your own setupWith your own setupYes
BrowserNo documented wayNo documented wayYes
Computer-use APINo documented wayNo documented wayYes
SSHYesYesYes
Persistent diskYesYesYes
Pause/resumeYesYesYes
Automatic snapshotsYesNo documented wayYes
Fork/cloneYesYesYes
Live fork (no pause)No documented wayNo documented wayYes
Memory forkNo documented wayNo documented wayNo documented way
Custom image (Docker or snapshot)YesYesYes
≥24 h sessionsYesYesYes
Idle auto-stopNo documented wayNo documented wayNo documented way
Wake on requestNo documented wayNo documented wayNo documented way
HTTPS preview URLsNo documented wayNo documented wayYes
Raw TCP inboundYesYesYes
Public IPv4YesYesNo documented way
Egress allowlistYesYesNo documented way
Secret proxyNo documented wayNo documented wayYes
Secret proxy for any APINo documented wayNo documented wayYes
Preinstalled agentsNo documented wayNo documented wayYes
Agent harness APINo documented wayNo documented wayYes
MCP serverNo documented wayYesNo documented way
GPUYesYesNo documented way
WindowsYesYesNo documented way
Arm64YesYesNo documented way
Self-hostingNo documented wayNo documented wayNo documented way
BYOCNo documented wayNo documented wayNo documented way
Open sourceNo documented wayNo documented wayNo documented way
Scoped API keysNot publishedNot publishedYes
Spend limitsNot publishedNo documented wayYes
Usage per sandbox (API)YesYesYes
Audit logsNot publishedYesNo documented way
SSOYesYesNo documented way
SOC 2YesYesNo documented way
HIPAAYesYesNo documented way
EU data residencyYesYesNo documented way
Zero data retentionNot publishedNot publishedYes

Performance

AWS EC2Not measured
Azure Virtual MachinesNot measured
boat28.06 runs/s

Neither AWS EC2 nor Azure Virtual Machines is in the public benchmarks we use, so we cannot say which is faster. On both clouds, speed depends on the CPU family you pick. In StarSling's run of 3 October 2026 (run 37073680030), boat did 28.06 runs/s on the V8 Web Tooling Benchmark at 4 vCPU / 8 GB, second of 15. Every boat sandbox in this run ran on an AMD Ryzen 9 9950X host. boat also places some sandboxes on AMD Ryzen 7 9700X hosts, which this run did not measure.

V8 Web Tooling Benchmark at a 4 vCPU / 8 GB target, runs per second, higher is better. Source: StarSling's run of 3 October 2026 (run 37073680030), median of 5 sandboxes. Providers ran on different hardware in different regions. StarSling gives a shared rank when the run cannot separate two providers. Every boat sandbox in this run ran on an AMD Ryzen 9 9950X host. boat also places some sandboxes on AMD Ryzen 7 9700X hosts, which this run did not measure. AWS EC2 and Azure Virtual Machines are not in the public benchmarks we use, so we cannot say which is faster.

Pricing in five scenarios

Each bill is priced from the providers' public price lists by the open Battleships engine, with the cheapest plan that runs the scenario. Start limits, per-start fees and plan minimums are in the price, boat's included.

ScenarioAWS EC2, a monthAzure Virtual Machines, a monthboat, a month
One coding agent, workdays
4 vCPU / 8 GB, 50 GB disk, 8 hours a day, 22 days a month, files kept between days
$21 · Pay-as-you-go (no platform fee)$26 · Pay-as-you-go subscription (no plan fee)$20 · $20/mo
One agent that never stops
4 vCPU / 8 GB, 50 GB disk, running 24/7 all month
$51 · Pay-as-you-go (no platform fee) · with limits$48 · Pay-as-you-go subscription (no plan fee) · with limits$26 · $20/mo
50 agents in parallel
50 machines of 4 vCPU / 8 GB at once, 8-hour sessions, 1,100 sessions a month, Docker inside
$944 · Pay-as-you-go (no platform fee)$1,168 · Pay-as-you-go subscription (no plan fee)$317 · $20/mo × 3 seats
Sandboxes for your users
2 vCPU / 4 GB, 30,000 sessions of 10 minutes a month, up to 300 at once
$269 · Pay-as-you-go (no platform fee)$225 · Pay-as-you-go subscription (no plan fee)$200 · $100/mo × 2 seats
1,000 short jobs at once
2 vCPU / 4 GB, 1,000 at once, 3 minutes each, 200,000 jobs a month
$502 · Pay-as-you-go (no platform fee)$483 · Pay-as-you-go subscription (no plan fee) · with limits$8,800 · $2000/mo · with limits

AWS EC2: EC2 bills each instance per second (60 second minimum) at its list rate, here the Graviton c7g sizes on demand, with no platform fee. EBS disks bill on top, also while stopped. A public IPv4 address bills while the instance runs, and an Elastic IP you keep also bills while stopped. Lower rates need a 1-year or 3-year commitment.

Azure Virtual Machines: Azure bills each VM per full minute while it runs, with no plan fee. Disks, public IPv4 addresses and egress bill on top, and disks keep billing while deallocated. The lowest prices here use Arm Cobalt sizes, B-series burstable sizes, or a 3-year reservation for a machine that never stops.

Limits in those scenarios

A new AWS account can run only 5 vCPUs of standard On-Demand instances per region. Azure caps vCPUs per region and per VM family, and stopped VMs still count. So 50 agents in parallel need a quota raise on both. One agent that never stops reaches the prices shown ($51 a month on EC2, $48 on Azure) only with a 3-year commitment. For 1,000 short jobs at once, EC2 fits at $502. Azure's figure uses B-series VMs, which guarantee 30% of each vCPU on the size priced and throttle above that once credits run out. boat's limits: plans cost $20, $100, $500 or $2,000 a month, and the plan price comes back as VM time for that month only. A stopped sandbox has no compute charge, but saved snapshots above the included count and the AI credentials proxy still charge. For the same burst, boat's $2,000 plan charges for starts above 90 a minute and refuses them above 270.

ScenarioAWS EC2Azure Virtual Machinesboat
One coding agent, workdaysNone for this scenarioNone for this scenarioNone for this scenario
One agent that never stops
  • 3-year commitment
  • 3-year commitment
None for this scenario
50 agents in parallelNone for this scenarioNone for this scenarioNone for this scenario
Sandboxes for your usersNone for this scenarioNone for this scenarioNone for this scenario
1,000 short jobs at onceNone for this scenario
  • burstable CPU: 30% of each vCPU guaranteed, throttled above that
  • 2,400 starts/day included, paid above that (needs ~6,667)
  • 600 starts/hour included, paid above that (needs ~1,000)
  • starts above 90/min are paid, and starts above 270/min fail with 429

Which one should you use?

Use AWS EC2 when

you need macOS, a wide range of GPU instances, per-second billing for short jobs, or your company already runs on AWS.

  • macOS on Mac hosts. Useful if agents build for Apple platforms: EC2 rents Mac instances on Dedicated Hosts (24-hour minimum), and Azure has no macOS.
  • Per-second billing. Useful for many short jobs: EC2 bills Linux and Windows per second after a 60 second minimum, while Azure bills per full minute.
  • GPU eval jobs. Useful if you run evals on GPUs: EC2 is the one of the two that fits that use case in our table.

Use Azure Virtual Machines when

you need replicated disks, hibernation, a region in a country EC2 does not cover, Spot capacity for large batches, or your company already runs on Azure.

  • Replicated disks and hibernation. Useful if disks must survive host failure: managed disks keep three replicas, and hibernation saves memory on supported sizes.
  • More regions. Useful if data must stay in a given country: Azure lists 77 regions available or coming soon, against 39 for EC2.
  • Spot VMs for large batches. Useful for big batches that can survive eviction: Azure Spot VMs sell spare capacity at a discount, with 30 seconds of notice.

Where boat fits

boat is not a hyperscaler. It has no GPUs, no Windows or macOS guests, and runs only in Germany, Finland and France. If you run agents, both clouds leave you to build the agent layer on a raw VM. boat gives each agent a full VM that already has that layer.

Agents driven from outside

On EC2 and Azure you install every agent over SSH, Systems Manager or Run Command, and secrets you fetch land inside the VM. boat installs seven harnesses, has a prompt and events API, and offers an optional paid credentials proxy for model provider keys.

Fork a running machine

Copying a machine on either cloud means capturing an image or snapshotting disks, then booting a new VM cold. Stopped machines keep billing their disks. boat forks a running sandbox from its last 1-minute snapshot; writes from the last minute can be missing from the fork.

Desktop, HTTPS URLs and /dev/kvm on every sandbox

On both clouds you install a desktop yourself, HTTPS needs your own certificate and load balancer, and nested virtualization works on chosen sizes. boat has a 60fps desktop, HTTPS on 50 ports and /dev/kvm on every sandbox.

Use boat when what you run is agents and you want each one on a ready full VM: coding agents with an API, a built-in desktop, HTTPS URLs, /dev/kvm, a disk saved every minute and forks, with no infrastructure to build. Compare it one to one: boat vs AWS EC2 and boat vs Azure Virtual Machines.

boat's own limits
  • Plans start at $20 a month. The plan price comes back as VM time for that month. Unused time does not carry over. Source
  • Starts (create, fork, resume): the $20 plan includes 12 a minute, 60 an hour and 200 a day. The $2,000 plan includes 90 a minute, 600 an hour and 2,400 a day. Extra starts cost $0.03 to $0.07. A start fails with 429 above 3 times the included starts per minute, or 6 times per hour or per day. Source
  • A stopped sandbox has no compute charge. boat keeps its disk for at least 14 days. A saved snapshot keeps it longer; extra saved snapshots and the AI credentials proxy are paid. Source
  • Auto-stop defaults to 1 hour. You can turn it off on a paid plan. The trial allows 2 hours at most. Source
  • boat saves the disk every minute and at each stop. Memory, running programs and /tmp are not saved: a resume is like a reboot. A machine failure loses writes after the last good snapshot. Source
  • Machines run in Germany, Finland and France only. Snapshot copies can be stored outside the EU. Source
  • Public IPv6 and outbound IPv4. No dedicated IPv4. The IP changes at each resume. Source
  • Hosts are AMD Ryzen 7 9700X and Ryzen 9 9950X. vCPUs are shared. No GPU. You cannot boot your own Docker image. Source

Questions people ask

Is AWS EC2 cheaper than Azure Virtual Machines?

It depends on the job. In our scenarios, one coding agent on workdays is $21 a month on EC2 and $26 on Azure, and 50 agents in parallel come to $944 against $1,168. Azure is lower for sandboxes for your users, $225 against $269, and for one agent that never stops, $48 against $51 with a 3-year commitment on both. On boat these four are $20, $317, $200 and $26.

Which is faster, EC2 or Azure?

We cannot say: neither is in the public benchmarks we use, and speed depends on the instance family you pick. boat did 28.06 runs/s on the V8 Web Tooling Benchmark at 4 vCPU / 8 GB in StarSling's run of 3 October 2026, on an AMD Ryzen 9 9950X host.

Can EC2 and Azure VMs run Docker and nested virtualization?

Both give you root, so Docker and systemd run on any instance. Nested virtualization depends on the size. On EC2 it works on Intel 7th/8th-gen families (C7i, M7i, R7i, C8i, M8i, R8i, X8i, I7i and variants) and metal, not on Graviton or AMD. On Azure it works on many Intel and AMD sizes such as D, E and F series, not on Arm or B-series. boat has /dev/kvm on every sandbox.

Do EC2 and Azure VMs bill while stopped?

A stopped EC2 instance stops compute billing but still bills its EBS disk and any Elastic IP you keep. On Azure, only a deallocate from the portal, CLI or API ends compute billing; a shutdown from inside the OS does not, and disks and static IPs keep billing. A stopped boat sandbox has no compute charge, but saved snapshots above the included count and the AI credentials proxy still charge.

Which has more regions?

Azure lists 77 regions as available or coming soon, and EC2 runs in 39 regions with 124 availability zones. Both have several regions in the EU. boat runs on machines in Germany, Finland and France, and you cannot pick a region.

Can I run coding agents on EC2 or Azure?

Yes. On either, you launch a VM, install the agent, give it a key and drive it over SSH, Systems Manager or Run Command. boat does that setup for you: seven harnesses are installed, and you drive them by API. With boat's optional paid credentials proxy on, real keys of supported model providers stay outside the machine.

Try boat

Install the CLI, then run boat new.

7-day free trial

More comparisons