Creating Amazon AMI 2023 Hyper-V Instances

April 22, 2025
A woman is sitting at a desk in a warehouse using a cell phone.

Creating Amazon AMI 2023 Hyper-V Instances

Step-by-Step Guide

Introduction

Creating a Hyper-V instance running Amazon Machine Image (AMI) 2023 involves several detailed steps. This guide provides a detailed walkthrough for creating a Hyper-V instance running Amazon Machine Image (AMI) 2023. It outlines the necessary prerequisites, steps for downloading the AMI image, configuring the instance, and additional security measures.

  • Prerequisites for Setup: Users need access to an AWS account, a configured Hyper-V on their Windows machine, and the PowerISO tool to create an ISO file. 
  • Downloading AMI 2023 Image: The Amazon Linux 2023 disk images can be downloaded from cdn.amazonlinux.com. 
  • Creating Cloud-Init Configuration: Users must create a NoCloud (seed.iso) cloud-init configuration to set up the instance and add users. This involves creating USER-DATA and META-DATA. 
  • Setting Up the Virtual Machine: The guide specifies steps to create a new virtual machine in Hyper-V, including naming, memory allocation, and networking configuration. 
  • Starting the Virtual Machine: Users are instructed on how to start the virtual machine and log in using the credentials set up in the seed.iso file. 
  • Post-Setup Security Configuration: The document advises on enabling password authentication for SSH, detaching the seed.iso, and setting the hostname. 

Prerequisites

Before beginning, ensure you have the following:

Steps to Create Hyper-V Instance Running AMI 2023

1. Download AMI 2023 Image

Amazon Linux 2023 disk images for use with KVM, VMware, and Hyper-V can be downloaded from cdn.amazonlinux.com



Follow these steps:

  1. Goto cdn.amazonlinux.com.
  2. Navigate to the “hyperv” folder
  3. Download the Amazon Linux 2023 LTS [Version Number] x86_64 Hyper-V image that is zipped
  4. Unzip the image that was downloaded

2. Create NoCloud (seed.iso) cloud-init configuration for Amazon Linux 2023

During this step, we will create the ISO that will be used on the initial startup to configure the AMI 2023 instance and add users to the Instance. If you want to geek out on the Cloud-init settings, see https://www.cloudynotes.io/blog/2024/11/02/the-grizzled.html#amazon-linux; https://docs.aws.amazon.com/linux/al2023/ug/seed-iso.html; or https://cloudinit.readthedocs.io/en/22.2/topics/format.html.


  • Open PowerISO (Evaluation mode is fine)
  • Click New Data CD/DVD
  • Using Notepad ++ or Notepad create a file named USER-DATA with the following text (Note the file does not have an extension and there is not a black space / line at the end of the text in the file)
  • Name sure to replace the UserName1, UserName2, and SecurePasswordGoesHere! with your own values:
  • #cloud-config
  • #vim:syntax=yaml
  • users:
  •  - name: UserName1
  •   groups: sudo
  •   sudo: ['ALL=(ALL) NOPASSWD:ALL']
  •   plain_text_passwd: SecurePasswordGoesHere!
  •   lock_passwd: false
  •  - name: UserName1
  •   groups: sudo
  •   sudo: ['ALL=(ALL) NOPASSWD:ALL']
  •   plain_text_passwd: SecurePasswordGoesHere!
  •   lock_passwd: false
  • For example, mine looks like:
  • Using Notepad ++ or Notepad create a file named META-DATA with the following text (Note the file does not have an extension)

Make sure to replace InstanceName with the name you want the Instance to have. If you want to setup static IPs, uncomment the IP Sections


local-hostname: InstanceName


# eth0 is the default network interface enabled in the image. You can configure

# static network settings with an entry like below.

#network-interfaces: |

# iface eth0 inet static

# address 192.168.0.10

# network 192.168.0.0

# netmask 255.255.255.0

# broadcast 192.168.0.255

# gateway 192.168.0.1

  • For example, mine looks like, because I will be using DHCP to assign IP:
  • Copy those two files META-DATA and USER-DATA into the CD by dragging and dropping them in the root of the CD or using the add files. It should look like this:
  • Open File > Image properties
  • Set Label to cidata
  • Click on More Labels … and set the Volume Set ID to cidata
  • Set the following settings:
  • CD/DVD File System to ISO 9660, RockRidge, and Joliet
  • ISO9660 File name to DOS(8.3)
  • Joliet File Name to Standard(64)
  • Hit Save and save it as seed.iso

3. Create a Virtual Machine in Hyper-V

Requirements: https://docs.aws.amazon.com/linux/al2023/ug/hyperv-supported-configurations.html


Follow these steps:

Here are the steps:

  • Open Hyper-V Manager.
  • In the Actions pane, click New and then Virtual Machine.
  • Follow the New Virtual Machine Wizard:
  • Name the virtual machine and specify its location
  • The Name will become a subfolder in the location you select
  • Select Generation 2
  • Assign the memory to the virtual machine.
  • Min recommended is 2GB, but in my case I am doing 1.5Gb as it will only be running apache
  • Configure networking by connecting to the appropriate virtual switch.
  • Select Attach Virtual Hard Disk Later
  • Click Finish to complete the wizard.

4. Move the VHDX file

In this step, we are going to make a copy of the VHDX file we downloaded and extracted in Step 1 into the Virtual Hard Disks folder

  • Navigate to the folder you specified in the Specify name and Location step
  • Create a folder called Virtual Hard Disks
  • Copy the VHDX into this folder

5. Configure the Virtual Machine

Now that the shell Hyper-V instance is created, we have to fully configure it

Once the virtual machine is created:

  • Right-click on the virtual machine and select Settings.
  • Adjust the processor count.
  • Add a Hard Drive
  • Select SCSI Controller
  • Hard Drive
  • Add
  • Browse to the VHDX file you copied into the Virtual Hard Disks in Step 4
  • Add a DVD Drive
  • Select SCSI Controller
  • DVD Drive
  • Add
  • Change the location to 2 (or any unused one)
  • Select the seed.iso you created above
  • Set boot order where DVD is first and Hard Drive is second
  • Disable Secure Boot
  • Click Apply and then OK to save the changes.

6. Start the Virtual Machine

To start your instance:

  • Right-click on the virtual machine and select Start.
  • Once the machine is running, connect to it by selecting Connect in the Actions pane.
  • Log in to the instance using the credentials provided in the seed.iso file

7. Optional – Configure AMI 2023 instance to all for connection with username and password only

By default, Amazon Linux 2023 (AMI 2023) disables password authentication over SSH for security reasons. It only allows key-based authentication. But you can enable password authentication if needed.

⚠️ Before you begin:

Make sure you understand the security implications—password auth is less secure than SSH keys, especially if you’re using weak passwords or exposing the instance to the internet.

🔥 Security note: Enabling password authentication is not recommended in production without strong passwords and a firewall in place.

Steps to enable password authentication in SSH:

  • From the Hyper-V Connect window, log into the instance using the credentials provided in the seed.iso file
  • Edit the SSH config file:
  • sudo nano /etc/ssh/sshd_config
  • Find and update (or add) these lines:
  • PasswordAuthentication yes
  • PermitRootLogin yes   # optional: only if you want root login
  • Remember to remove the leading # if you want it to be active
  • To save changes hit CTRL+O and then enter to commit the changes to the file
  • To Exit nano, CTRL+X, but make sure to save before you exit if you want to commit the changes
  • Restart SSH
  • sudo systemctl restart sshd

8. Detach CD/DVD from Hyper-V instance

In this step you will eject the DVD Drive as the seed.iso is not longer needed in future boots

  • Under Media, DVD Drive, eject the seed.iso

9. Set hostname

This script will set the hostname so that you do not have to change the seed.iso file each time (just update the NEWNAME with the name you want to set the host to):

  • sudo hostnamectl set-hostname NEWNAME && sudo sed -i "s/$(hostname)/NEWNAME/g" /etc/hosts && echo "preserve_hostname: true" | sudo tee -a /etc/cloud/cloud.cfg > /dev/null && echo "Hostname set to NEWNAME and made persistent"

10. Hardening Steps (please sure each is right for your environment)

To disable IPv6 on Linux, you can follow these steps:

  • Edit the /etc/sysctl.conf file using a text editor with root privileges.
  • Add the following line at the end of the file: net.ipv6.conf.all.disable_ipv6 = 1.
  • Save the changes and apply them using sudo sysctl -p

Linux Baseline

1. Install AV and Baseline monitoring tools


2. Run these two commands:

a. To disable ICMP (ping):

echo -e "\n# sysctl -w net.ipv4.conf.all.accept_redirects=0

sysctl -w net.ipv4.conf.default.accept_redirects=0

sysctl -w net.ipv4.conf.all.secure_redirects=0

sysctl -w net.ipv4.conf.default.secure_redirects=0" | sudo tee -a /etc/sysctl.conf


b. This script updates /etc/securetty to define which terminal devices the root user is allowed to log in from, enabling access on certain virtual consoles and TTYs while commenting out others:

sudo echo -e 'console\nvc/1\nvc/2\nvc/3\nvc/4\nvc/5\nvc/6\nvc/7\nvc/8\nvc/9\n# vc/10\n# vc/11\ntty1\ntty2\ntty3\ntty4\ntty5\ntty6\ntty7\ntty8\ntty9\n# tty10\n# tty11\n# ttyS0\n# ttysclp0\n# sclp_line0\n# 3270/tty1\n# hvc0\n# hvc1\n# hvc2\n# hvc3\n# hvc4\n# hvc5\n# hvc6\n# hvc7\n# hvsi0\n# hvsi1\n# hvsi2\n# xvc0' | sudo tee /etc/securetty


3. Remove weak ciphers

a. To remove weak ciphers from AMI 2023, you'll need to modify the sshd_config file on your AMI 2023 instance to disable specific ciphers. This involves editing the ciphers section within the sshd_config file and removing any weak or outdated ciphers.

11. Verify the Setup

  • After logging in, verify the setup:
  • Ensure all services are running as expected.
  • Check network connectivity and other configurations.
  • Update the system to ensure it is 100% current
  • sudo yum update -y
  • reboot if necessary for updates

Conclusion

By following the steps outlined in this guide, you should be able to successfully create and run a Hyper-V instance using Amazon AMI 2023. This setup will allow you to take advantage of Hyper-V’s powerful virtualization capabilities while utilizing the robust features provided by AMI 2023.

A woman is sitting at a desk in a warehouse using a cell phone.
February 28, 2025
Cyberattacks are a growing concern, and small to mid-sized businesses – especially dental, medical, accounting, and construction offices – are increasingly targeted. To help organizations respond effectively to security incidents, a free Security Incident Response Toolkit is now available.
A man in a suit and tie is holding a globe with the words cyber security written on it.
February 26, 2025
As cyber threats continue to grow, the FBI is warning businesses—particularly small and mid-sized dental, medical, accounting, and construction offices—to back up their data immediately. This alert comes in response to a surge in attacks specifically targeting these industries.
February 7, 2025
As of October 14, 2025, Microsoft will officially end support for Windows 10. After this date, the operating system will no longer receive security updates, technical assistance, or software updates from Microsoft. While your Windows 10 PC will continue to function, using an unsupported operating system poses significant risks.
A man is using a laptop computer with a loading bar on the screen.
February 5, 2025
Microsoft’s ESU program provides critical security updates for Windows 10 devices beyond the official end-of-support date. This is a paid service designed for individuals and businesses that need extra time to transition to a supported operating system.
A judge 's gavel is sitting on top of a black table.
January 8, 2025
In December 2024, Westend Dental, an Indianapolis-based dental practice, agreed to pay a $350,000 penalty to the Indiana Attorney General's Office to resolve multiple alleged violations of federal and state laws, including the Health Insurance Portability and Accountability Act (HIPAA)
A woman is sitting in a dental chair and giving a thumbs up.
November 4, 2024
The cloud has the ability to change the game for your dental practice, especially if you're have or are interested in branching out to multiple locations.
A man is smiling while sitting in a dental chair.
October 28, 2024
Let’s put you in the perspective of a patient stepping into a dental office: what’s the first thing you notice? Maybe it’s how modern and clean the space looks or how quickly you can get connected to their Wi-Fi. Or perhaps it's the opposite, and you find yourself in a place that seems to have taken a time machine back to the '90s, complete with outdated computers and a spotty internet connection.
By Anastasia Ippolito October 18, 2024
Let's talk about something that may not get a ton of attention during your workday but is extremely important and always looming in the background - HIPAA compliance.
A dentist is talking to a patient in a dental chair.
October 15, 2024
Want to integrate or upgrade any of the technology we’ve covered in this blog but don’t know where to start? That’s where we come in! We’re experts who specialize in the dental industry and know how to upgrade your practice without disrupting it.
September 19, 2024
In 2014, 4GB to 8GB of RAM was generally considered sufficient for most business operations. Standard tasks like document management, light multitasking, and simple software applications could easily run on 4GB, with 8GB being recommended for more intensive use. This was especially true in professions such as legal, dental, and healthcare, where electronic record systems and case management software were just beginning to integrate more advanced features. However, as software became more sophisticated and cloud computing started playing a central role, the demand for memory grew. Legal professionals now rely on cloud-based management systems, AI-powered document analysis, and e-discovery tools, which all require more RAM for efficient functioning. Similarly, the medical profession witnessed the proliferation of complex EHR systems, AI diagnostics, and telemedicine solutions, pushing the baseline RAM requirement to 16GB in most offices.
More Posts