Problem
Red Star OS 3.0 Server (32-bit i686, Linux Kernel 2.6.38) expects legacy hardware (e1000 NIC, IDE bus) and installs from two separate discs: boot.iso (38MB) for the Anaconda boot kernel and install.iso (856MB) for RPM packages. Because it cannot boot directly as a standard cloud AMI, running it on AWS normally meant renting bare-metal (*.metal) instances at over $4/hour and installing it by hand.
This project provisions an AWS EC2 c8i.xlarge host with hardware Nested Virtualization (KVM), Terraform, and libvirt scripts so Red Star OS 3.0 Server can be installed and run without bare metal.
What I Built
-
AWS EC2 nested virtualization host in Terraform
- Enabled
cpu_options { nested_virtualization = "enabled" }onc8i.xlargeto expose/dev/kvmhardware acceleration inside Ubuntu 24.04 LTS. - Automated VPC, Security Group, SSH keypair creation, and host setup (
KVM,QEMU,libvirt,Nginx) via Terraform anduser_data.sh.
- Enabled
-
Live CD-ROM swap scripts for the two-disc installer
- Wrote
switch-to-install-iso.shandeject-redstar-iso.sharoundvirsh change-mediato swap the IDE CD-ROM (hdc) fromredstar-boot.isotoredstar-install.isomid-install without rebooting the VM. - Configured the guest profile (
i686, 2 vCPU, 2GB RAM, 40GB sparseqcow2,e1000NIC, USB tablet pointer sync) for Kernel 2.6.38 compatibility.
- Wrote
-
SSH-tunneled VNC console and host Nginx proxy
- Bound QEMU VNC strictly to
127.0.0.1:5900(closed in the AWS Security Group) so GUI access only goes throughssh -L 5900:127.0.0.1:5900. - Configured host Nginx (
:80) to reverse-proxy HTTP traffic to the guest web server at192.168.122.100:80.
- Bound QEMU VNC strictly to
Results
- Cut compute cost by over 95%: moved from $4+/hr bare-metal instances to
c8i.xlarge(~$0.19/hr) with native KVM acceleration. - Published the repo with setup docs and a GitHub Actions check (
validate.yml) coveringterraform fmt/validateand shell script syntax.
Stack
- AWS EC2
- Terraform
- KVM / QEMU
- libvirt
- Nginx
- Shell
