AWS Nested Virtualization: Run VMs Inside EC2 Instances

Running virtual machines inside cloud instances has been a long-requested feature. Until now, AWS users needing nested virtualization had to provision expensive bare-metal instances. With the February 2026 release, AWS now enables nested virtualization on standard virtual EC2 instances.
What Is Nested Virtualization?
Nested virtualization allows a hypervisor to run inside a virtual machine. In practice, this means you can launch KVM, VMware, or Hyper-V guests within your EC2 instances without bare-metal hardware. The underlying Nitro hypervisor exposes the necessary CPU virtualization extensions (Intel VT-x or AMD-V) to the guest OS.
Key Features
- Cost savings: Skip bare-metal instances for hypervisor workloads
- Development flexibility: Test multi-VM architectures locally before production
- KubeVirt support: Run VM-based Kubernetes workloads on standard nodes
- Security testing: Isolate malware analysis in nested VMs
- Training environments: Spin up disposable lab VMs for education
Supported Instance Types
Nested virtualization works on Nitro-based instances with Intel or AMD processors. Check the EC2 instance types documentation for the full list. Graviton (ARM) instances are not currently supported.
How to Enable It
First, verify your AMI supports KVM. On Amazon Linux 2023 or Ubuntu:
# Check for virtualization extensions
grep -E 'vmx|svm' /proc/cpuinfo
# Load KVM module
sudo modprobe kvm_intel # or kvm_amd for AMD
Then install your preferred hypervisor. For QEMU/KVM:
# Amazon Linux 2023
sudo dnf install -y qemu-kvm libvirt
# Ubuntu
sudo apt install -y qemu-kvm libvirt-daemon-system
Start libvirt and launch a nested VM:
sudo systemctl enable --now libvirtd
virt-install --name test-vm --memory 2048 --vcpus 2 \
--disk size=20 --cdrom /path/to/iso --os-variant generic
Operational Tips
Monitor nested VM performance with standard tools like virsh, virt-top, or Prometheus libvirt exporters. For production workloads, size your parent instance with enough headroom for nested guests. Consider enabling hugepages for better memory performance in nested scenarios.
Conclusion
AWS nested virtualization removes a significant barrier for teams running hypervisor workloads in the cloud. Whether you need KubeVirt for legacy VM migrations, isolated security testing, or flexible development environments, you can now skip bare-metal pricing and use standard EC2 instances.
For automated incident response and VM lifecycle management, check out Akmatori, an open-source AI agent platform built for SRE teams. Deploy it on Gcore for global edge infrastructure with low-latency access to your workloads.
