IBM & Red Hat on AWS

Using Red Hat Lightspeed AI assistant and generative AI to achieve your goals from within Red Hat Enterprise Linux (RHEL) on AWS

A team of developers who worked their entire career on Windows have been tasked with running Microsoft SQL Server in a container on Linux. This seems like a daunting task, but wouldn’t it be easy if they had AI at your fingertips to help them through it. Customers can make use of Generative AI tools to guide them through a variety of tasks in a shorter time, in this blog post we shall explore two simple examples of using Red Hat LightSpeed. Firstly to guide a team through a containerized database build and then to implement SELinux configurations.

Red Hat Enterprise Linux (RHEL) 10 on AWS has inbuilt AI tools and assistants, which can be leveraged from its CLI for these exact tasks. Red Hat Enterprise Linux (RHEL) Lightspeed is a set of features in RHEL 10, powered by generative AI, designed to simplify Linux administration and management. It offers tools like a command-line assistant and image builder package recommendations, both aimed at helping both novice and experienced Linux users. The core idea is to provide actionable guidance and context-aware recommendations through natural language, making it easier to deploy, manage, and maintain Linux environments.

Prerequisites:

Installing Red Hat Light Speed:

Step 1: Once connected to the RHEL EC2 instance lets start by confirming the RHEL release:

[root@ip-172-31-86-215 ~]# cat /etc/redhat-release

Red Hat Enterprise Linux release 10.0 (Coughlan)

Step 2: Confirm RHEL subscription

[root@ip-172-31-86-215 ~]# subscription-manager status

+——————————————-+

System Status Details

+——————————————-+

Overall Status: Not registered

In this case we can see the Subscription is not as yet registered with a Red Hat account.

Step 3: Register the instance with Red Hat using your Red Hat account. Note, this is my private account and has no purchased subscriptions associated with it.

[root@ip-172-31-86-215 ~]# subscription-manager register

Registering to: subscription.rhsm.redhat.com:443/subscription

Username: m*****.s*****@gmail.com

Password:

The system has been registered with ID: 64dfca5f-21c8-47bc-ab07-64b096792a3c

The registered system name is: ip-172-31-86-215.ec2.internal

Step 4: Next, install the command-line-assistant package.

[root@ip-172-31-86-215 ~]# dnf info command-line-assistant

Updating Subscription Management repositories.

Last metadata expiration check: 0:15:34 ago on Mon Jul  7 16:26:08 2025.

Available Packages

Name         : command-line-assistant

Version      : 0.3.1

Release      : 3.el10_0

Architecture : noarch

Size         : 248 k

Source       : command-line-assistant-0.3.1-3.el10_0.src.rpm

Repository   : rhel-10-appstream-rhui-rpms

Summary      : A simple wrapper to interact with RAG

URL          : https://github.com/rhel-lightspeed/command-line-assistant

License      : Apache-2.0

Description  : A simple wrapper to interact with RAG

[root@ip-172-31-86-215 ~]# dnf install -y command-line-assistant

Asking Red Hat Light Speed how to deploy a containerized SQL server:

At this point we have AI at our fingertips to assist us with the task in hand. The speed of light in a vacuum is a fundamental constant of nature, represented by the symbol c. This symbol c also the command that is used to ask out questions to RHEL Lightspeed as shown below.

[ec2-user@ip-172-31-86-215 ~]$ c "how to install and configure mssql server on rhel using podman"

⁺₊+ Asking RHEL Lightspeed

This feature uses AI technology. Do not include any personal information or other sensitive information in your input. Interactions may be used to improve

Red Hat’s products or services.

────────────────────────────────────────────────────────────────────────

To install and configure Microsoft SQL Server (MSSQL) on Red Hat Enterprise Linux (RHEL) using Podman, follow these steps:

 

Step 1: Install Podman

  • ······················

First, ensure Podman is installed on your RHEL system. If it’s not installed, you can do so by running:

[bash] Snippet ────────────────

sudo dnf install podman

────────────────────────

Step 2: Log in to the Microsoft Container Registry

  • ··················································

Before pulling the MSSQL container image, log in to the Microsoft Container Registry using Podman:

[bash] Snippet ────────────────

podman login mcr.microsoft.com

────────────────────────

You will be prompted to enter your Microsoft credentials.

Step 3: Pull the MSSQL Container Image

  • ······································

Now, pull the MSSQL Server container image from the Microsoft Container Registry:

[bash] Snippet ────────────────

podman pull mcr.microsoft.com/microsoft/mssql-server:latest

──────────────────────── 

Step 4: Run MSSQL Server in a Container

  • ·······································

Create and run a container using the MSSQL Server image. Replace <container_name> and <mysql_root_password> with your desired container name and root password:

[bash] Snippet ────────────────

podman run -d --name <container_name> -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<mysql_root_password>' -p 1433:1433 mcr.microsoft.com/microsoft/mssql-server:latest

────────────────────────

Step 5: Verify the Installation

  • ·······························

To ensure that the MSSQL Server container is running, list all containers:

[bash] Snippet ────────────────

podman ps

────────────────────────

You should see your MSSQL container listed and running.

Step 6: Connect to MSSQL Server

  • ·······························

To connect to the MSSQL Server instance, you can use a SQL client like sqlcmd. First, find the IP address of your RHEL host. Then, connect using:

[bash] Snippet ────────────────

sqlcmd -S <host_ip_address>,1433 -U SA -P '<mysql_root_password>'

────────────────────────

Replace <host_ip_address> with your RHEL host’s IP address and <mysql_root_password> with the password you set during container creation.

Step 7: Firewall Configuration

  • ······························

To allow external access to the MSSQL Server, open the necessary ports in the firewall:

[bash] Snippet ────────────────

sudo firewall-cmd --permanent --add-port=1433/tcp

sudo firewall-cmd --reload

────────────────────────

Additional Configuration

  • ························

For more advanced configurations, such as setting up users, databases, or enabling specific features, you can use SQL Server Management Studio (SSMS) or other SQL client tools to connect to your MSSQL Server instance running in the Podman container.

Remember to replace placeholders like <container_name> and <mysql_root_password> with actual values suitable for your environment.

For detailed information about using the MSSQL Server container image, refer to the official Microsoft documentation (https://docs.microsoft.com/en-us/sql/linux/quick-start-install-connect-rhel?view=sql-server-ver15).

────────────────────────────────────────────────────────────────────────

Always review AI-generated content prior to use.

Asking Red Hat lightspeed how to configure SELinux policies:

RHEL Lightspeed can also help with other Red Hat Enterprise Linux-related questions in plain language. It accesses information from various resources, including thousands of pages of Red Hat product documentation. It can also be leveraged to assist with troubleshooting configuration issues, deciphering log entries, and more.

The example below show configuration of SELinux policies for a web server listening on a non-standard port, and using a different directory than the default /var/www directory.

[root@ip-172-31-86-215 ~]# c "How to configure SELinux policy when the HTTP server is configured to listen on TCP port 3131 and uses the /var/test_www/ directory instead of the default /var/www/ directory."

⁺₊+ Asking RHEL Lightspeed

This feature uses AI technology. Do not include any personal information or other sensitive information in your input. Interactions may be used to improve Red Hat’s

products or services.

────────────────────────────────────────────────────────────────────────

To configure SELinux policy for an Apache HTTP server listening on TCP port 3131 and serving content from /var/test_www/, follow these steps:

  1. Ensure the necessary packages are installed:

Make sure you have httpd, policycoreutils-python-utils, and setroubleshoot-server installed. You can install them using the following command:

   sudo dnf install httpd policycoreutils-python-utils setroubleshoot-server

`

  1. Start the Apache HTTP service:

Start the Apache HTTP server with the new configuration:

`

   sudo systemctl start httpd

`

  1. Check the status of the Apache service:

Verify that the service is running correctly:

`

   sudo systemctl status httpd

`

  1. Adjust SELinux policy for the non-standard port:

Use the semanage command to add the new port to the SELinux policy. Replace 3131 with your desired port number:

`

   sudo semanage port -a -t http_port_t -p tcp 3131

`

  1. Adjust SELinux policy for the new directory:

Change the SELinux context of the new directory to allow Apache to serve content from it. Replace /var/test_www/ with your actual directory:

`

   sudo semanage fcontext -a -t httpd_sys_content_t "/var/test_www(/.)?"

   sudo restorecon -Rv /var/test_www

`

  1. Verify the changes:

Check the SELinux policy to ensure the changes have been applied correctly. You can list all ports related to http with:

`

   sudo semanage port -l | grep http

`

And check the context of your new directory:

`

   ls -Z /var/test_www

By following these steps, you should have successfully configured SELinux to accommodate your Apache HTTP server’s non-standard configuration. Always remember to restart the Apache service after making changes to its configuration files to ensure the new settings take effect.

────────────────────────────────────────────────────────────────────────

Always review AI-generated content prior to use.

Conclusion:

The new command line assistant, powered by Red Hat Enterprise Linux Lightspeed, is an optional gen AI assistant available directly in the Red Hat Enterprise Linux command line interface (CLI). It simplifies tasks to help you more easily manage, troubleshoot, and work with your systems.

Ryan Niksch

Ryan Niksch

Ryan Niksch is a Partner Solutions Architect focusing on application platforms, hybrid application solutions, and modernization. Ryan has worn many hats in his life and has a passion for tinkering and a desire to leave everything he touches a little better than when he found it.

Mayur Shetty

Mayur Shetty

Mayur Shetty is a Senior Solution Architect within Red Hat’s Global Partners and Alliances organization. He has been with Red Hat for four years, where he was also part of the OpenStack Tiger Team. He previously worked as a Senior Solutions Architect at Seagate Technology driving solutions with OpenStack Swift, Ceph, and other Object Storage software. Mayur also led ISV Engineering at IBM creating solutions around Oracle database, and IBM Systems and Storage. He has been in the industry for almost 20 years, and has worked on Sun Cluster software, and the ISV engineering teams at Sun Microsystems.