Installing Linux Drivers for VM Conversion to Amazon EC2

Configure the Amazon Web Services drivers for RHEL, CentOS, Oracle Linux, and Suse Linux.


  1. If the source VM is Linux and not an Amazon EC2 instance, install the following Xen drivers on the source VM:

    • xen-blkfront

    • xen-netfront


      Installing the Xen drivers on the Linux guest VMs prior to replicating the VMs, enables them to be in place when the Amazon instances are created, started, and ready for you to access.

  2. If converting to a Nitro instance type, then install the NVMe and ENA drivers on the source VMs. The following OS versions have the required NVMe and ENA drivers installed:

    • Red Hat Enterprise Linux 7.4 or later

    • CentOS 7.4.1708 or later

    • SUSE Linux Enterprise Server 12 SP2 or later

  3. Check if the OS versions have the required NVMe and ENA drivers pre installed. Run the following command:

    modinfo nvme
    modinfo ena
  4. If the drivers require an update, run the following command:

    sudo yum update -y

    For SUSE:

    sudo zypper update -y
  5. Reboot your instance to load the latest kernel version.

  6. Once the drivers are installed, log on to the Linux VM as a root user. Go to the /boot folder:

    cd /boot
  7. Perform a backup of the .img file for the kernel.

  8. Open the editor to edit the dracut.conf configuration file:

    vi /etc/dracut.conf
  9. Add the nvme-core and nvme module names to the "add_drivers" line with spaces separating each module.

    For example, when both xen and nitro drivers are installed:

    add_drivers+="xen-blkfront xen-netfront nvme-core nvme"
  10. Return to the /boot folder:

    cd /boot
  11. Recut the initramfs:

    dracut -f -v
  12. Run the following command to verify if the drivers are loading successfully:

    lsinitrd | grep -i -e nvme -e ena

    Sample output:

    [root@oracle-3 ~]# lsinitrd | grep -i -e nvme -e ena
    drwxr-xr-x  3 root  root   0 Apr 12 12:49 usr/lib/modules/5.4.17-2136.305.5.5.el7uek.x86_64/kernel/drivers/nvme
    drwxr-xr-x  2 root  root   0 Apr 12 12:49 usr/lib/modules/5.4.17-2136.305.5.5.el7uek.x86_64/kernel/drivers/nvme/host
    -rw-r--r--  1 root  root   59980 Apr  6 02:42 usr/lib/modules/5.4.17-2136.305.5.5.el7uek.x86_64/kernel/drivers/nvme/host/nvme-core.ko.xz
    -rw-r--r--  1 root  root   35968 Apr  6 02:42 usr/lib/modules/5.4.17-2136.305.5.5.el7uek.x86_64/kernel/drivers/nvme/host/nvme.ko.xz