AWS SDK for Go v2 now enables nested virtualization on non-bare metal EC2 instances, allowing virtual machines to run within virtual machines.

The latest update to AWS's official Go SDK (aws-sdk-go-v2@3dca5e4) introduces support for nested virtualization on standard EC2 instances. This functionality, now available through the EC2 service module (v1.288.0), allows developers to run virtual machines inside non-bare metal EC2 instances.
Nested virtualization addresses a significant limitation in cloud infrastructure design. Previously, running virtualized workloads within EC2 instances required expensive bare metal hardware with direct access to CPU virtualization extensions. This constraint forced developers into suboptimal choices:
- Using over-provisioned bare metal instances at premium pricing
- Creating complex container-based workarounds lacking hardware isolation
- Maintaining separate virtualization environments outside AWS
The new capability fundamentally changes VM-in-VM workflows. Developers can now:
- Launch standard EC2 instances with virtualization extensions enabled
- Install Type 2 hypervisors (KVM, Hyper-V, VirtualBox) within guest OS environments
- Run secondary VMs with near-native performance using Intel VT-x/AMD-V passthrough
- Create isolated development/test environments within single instances
- Migrate legacy VM-based workloads without hardware dependency
Technical implementation requires updating to the latest SDK version. The ec2 module now includes parameters to enable the virtualization extensions during instance launch configuration. AWS handles the underlying host infrastructure modifications transparently, maintaining the same instance types and pricing models.
This creates several practical opportunities:
- Development Environments: Software vendors can ship pre-configured VM images for testing network configurations or multi-node setups
- Legacy Migration: Enterprises can lift-and-shift VM-based applications without rearchitecting
- Security Research: Isolated malware analysis environments with hardware-level containment
- Education: Cloud-based labs for teaching virtualization concepts without local hardware
- CI/CD Pipelines: Ephemeral VM environments for integration testing complex distributed systems
The solution maintains AWS's standard security model while adding flexibility. Nested VMs operate within the parent instance's security context, with no additional charge beyond base instance pricing. Performance benchmarks show less than 8% overhead compared to bare metal virtualization.
Documentation updates are available in the EC2 service CHANGELOG, with code examples demonstrating launch configurations. The feature appears immediately available in all commercial regions.
This update reflects AWS's continued expansion of virtualization capabilities beyond containers, providing developers with architectural flexibility previously limited to specialized hardware. It eliminates a notable gap between on-premises virtualization and cloud environments while maintaining AWS's consumption-based pricing model.

Comments
Please log in or register to join the discussion