Chapter 4. Configuring CodeReady Containers

4.1. About CodeReady Containers configuration

Use the crc config command to configure both the crc binary and the CodeReady Containers virtual machine. The crc config command requires a subcommand to act on the configuration. The available subcommands are get, set, unset, and view. The get, set, and unset subcommands operate on named configurable properties. Run the crc config --help command to list the available properties.

You can also use the crc config command to configure the behavior of the startup checks for the crc start and crc setup commands. By default, startup checks report an error and stop execution when their conditions are not met. Set the value of a property starting with skip-check or warn-check to true to skip the check or report a warning rather than an error, respectively.

4.2. Viewing CodeReady Containers configuration

The CodeReady Containers binary provides commands to view configurable properties and the current CodeReady Containers configuration.

Procedure

  • To view the available configurable properties:

    $ crc config --help
  • To view the values for a configurable property:

    $ crc config get <property>
  • To view the complete current configuration:

    $ crc config view
    Note

    The crc config view command does not return any information if the configuration consists of default values.

4.3. Configuring the virtual machine

Use the cpus and memory properties to configure the default number of vCPUs and amount of memory available to the CodeReady Containers virtual machine, respectively.

Important

You cannot change the configuration of an existing CodeReady Containers virtual machine. To enable configuration changes, you must delete the existing virtual machine and create a new one.

To create the new virtual machine, first delete the existing CodeReady Containers virtual machine, then start a new virtual machine with the configuration changes:

$ crc delete
$ crc start
Warning

The crc delete command results in the loss of data stored in the CodeReady Containers virtual machine. Save any desired information stored in the virtual machine before running this command.

Procedure

  • To increase the number of vCPUs available to the virtual machine:

    $ crc config set cpus <number>

    The default value for the cpus property is 4. The number of vCPUs to assign must be greater than or equal to the default.

  • To increase the memory available to the virtual machine:

    $ crc config set memory <number-in-mib>
    Note

    Values for available memory are set in mebibytes (MiB). One gibibyte (GiB) of memory is equal to 1024 MiB.

    The default value for the memory property is 9216. The amount of memory to assign must be greater than or equal to the default.