I want to find the operating system (OS) or version number of my Amazon Elastic Compute Cloud (Amazon EC2) instance. However, I didn't allocate OS-specific tags at launch.
Short description
A public Amazon Machine Image (AMI) lists the distribution that it's based on in the Description or Name parameters. When you generate a new AMI that's based on a public AMI, the distribution changes to Custom Linux. In this scenario, you might not be able to view the platform-related information.
Resolution
Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.
To check your OS platform and instance version number, use the Amazon EC2 console or AWS CLI.
Use the Amazon EC2 console
Use one of the following methods to check your OS or version number:
- View the Platform details or AMI ID information.
View the instance's console logs or screenshot.
- View platform information for AWS Systems Manager managed instances.
Check the Platform details or AMI ID information
Note: This method shows limited OS information because AWS has limited visibility into the software or OS that runs on an instance. AWS can't provide specific OS-related information. For more information about your OS or version number, use one of the other methods.
To check your OS information, complete the following steps:
- Open the Amazon EC2 console.
- In the navigation pane, choose Instances, and then select your instance.
- Choose the Details tab, and then check the Platform details field. Or, choose AMI ID.
View the instance's console logs or screenshot
Get the instance console output, and then check the log entries for the Linux or kernel keywords. Or, get an instance screenshot.
View platform information for Systems Manager managed instances
Complete the following steps:
- Open the Systems Manager console.
- Choose the Managed instances tab.
- Select the instance to view the instance's Platform type, Platform name, and Platform version.
Note: A managed instance is any machine or instance that you configured with Systems Manager. To appear on the Managed instances tab, instances must be running and have the amazon-ssm-agent installed. They must also have the required AWS Identity and Access Management (IAM) permissions assigned to them.
For information about prerequisites, see Supported operating systems and machine types.
Use the AWS CLI
Note: You can only use the AWS CLI to view the Linux OS platform and version information for instances where you configured AWS Systems Manager Agent (SSM Agent).
To view information about your instance, run the following describe-instance-information command:
aws ssm describe-instance-information --query 'InstanceInformationList[*].[InstanceId,PlatformType,PlatformName]' --output table --region us-east-1
Note: Replace us-east-1 with your AWS Region.
Example output:
# aws ssm describe-instance-information --query 'InstanceInformationList[*].[InstanceId,PlatformType,PlatformName]' --output table --region us-east-1
------------------------------------------------------
| DescribeInstanceInformation |
+----------------------+--------+--------------------+
| i-0e446328e4070b25c | Linux | SLES |
| i-09ab5fd0cf37a45da | Linux | Amazon Linux AMI |
| i-0dd6cd6c3210f605e | Linux | SLES |
| i-05dd60329fb29cd74 | Linux | Ubuntu |
+----------------------+--------+--------------------+