The virtctl client is a command-line utility for managing OpenShift Virtualization resources. It is available for Linux, macOS, and Windows distributions.

You can install the virtctl client from the OpenShift Virtualization web console or by enabling the OpenShift Virtualization repository and installing the kubevirt-virtctl package.

Installing the virtctl client from the web console

You can download the virtctl client from the Red Hat Customer Portal, which is linked to in your OpenShift Virtualization web console in the Command Line Tools page.

  • You must have an activated OpenShift Container Platform subscription to access the download page on the Customer Portal.

  1. Access the Customer Portal by clicking the question circle icon, which is in the upper-right corner of the web console, and selecting Command Line Tools.

  2. Ensure you have the appropriate version for your cluster selected from the Version: list.

  3. Download the virtctl client for your distribution. All downloads are in tar.gz format.

  4. Extract the tarball. The following CLI command extracts it into the same directory as the tarball and is applicable for all distributions:

    $ tar -xvf <virtctl-version-distribution.arch>.tar.gz
  5. For Linux and macOS:

    1. Navigate the extracted folder hierachy and make the virtctl binary executable:

      $ chmod +x <virtctl-file-name>
    2. Move the virtctl binary to a directory on your PATH.

      1. To check your path, run:

        $ echo $PATH
  6. For Windows users:

    1. Navigate the extracted folder hierarchy and double-click the virtctl executable file to install the client.

Enabling OpenShift Virtualization repositories

Red Hat offers OpenShift Virtualization repositories for both Red Hat Enterprise Linux 8 and Red Hat Enterprise Linux 7:

  • Red Hat Enterprise Linux 8 repository: cnv-2.5-for-rhel-8-x86_64-rpms

  • Red Hat Enterprise Linux 7 repository: rhel-7-server-cnv-2.5-rpms

The process for enabling the repository in subscription-manager is the same in both platforms.

  • Enable the appropriate OpenShift Virtualization repository for your system by running the following command:

    # subscription-manager repos --enable <repository>

Installing the virtctl client

Install the virtctl client from the kubevirt-virtctl package.

  • Install the kubevirt-virtctl package:

    # yum install kubevirt-virtctl

Additional resources