Install Cockpit Virtual Machines and Enable Virtualization

Before Cockpit administrators can access and use the Virtual Machines functionality in the web console, the following tasks must be completed:

  • Install the Cockpit Virtual Machines add-on application in the web console.
  • Install the virtualization base packages on the Cockpit host system.

    Note:

    The virtualization base packages are typically installed on the host system during the Oracle Linux installation. In the case that these packages aren't installed, they must be installed to use the Virtual Machines module in the Cockpit web console.
  • Verify the virtualization service on the host system is started.

What Do You Need?

Steps

Follow these steps to ensure that the host system is properly configured with the Cockpit Virtual Machines add-on application and the Oracle Linux virtualization packages.

  1. In the Cockpit web console, click Terminal.
    The Terminal CLI page appears.
  2. In the terminal, run the following command to install the Cockpit Virtual Machines add-on application:
    sudo dnf install cockpit-machines
  3. Install Oracle Linux virtualization packages (if not already installed on the host system).
    Run the commands corresponding to the Oracle Linux version installed on the host:
    sudo dnf group install "Virtualization Host"
    sudo dnf install qemu-kvm virt-install virt-viewer
    Install Virtualization PackagesOracle Linux 10: KVM User's Guide
    sudo dnf group install "Virtualization Host"
    sudo dnf install qemu-kvm virt-install virt-viewer
    Install Virtualization PackagesOracle Linux 9: KVM User's Guide
    sudo dnf module install virt
    sudo dnf install virt-install virt-viewer
    Install Virtualization PackagesOracle Linux 8: KVM User's Guide
  4. Verify that the host system can function as a host for virtual machines.
    sudo virt-host-validate qemu

    If all checks return a PASS value, the system can host guest VMs. If any of the tests fail, a reason is provided and information is displayed on how to resolve the issue, if such an option is available.

    Note:

    If the following message is displayed, the system isn't capable of functioning as a KVM host:
    QEMU: Checking for hardware virtualization: FAIL (Only emulated CPUs are available, performance will be significantly limited)
    If you try to create or start a VM on a host where this message is displayed, the action is likely to fail.
  5. Enable and start the libvirt service.
    Run commands corresponding to the Oracle Linux version installed on the host:
    for drv in qemu network nodedev nwfilter secret storage interface; 
    do sudo systemctl enable virt${drv}d.service; 
    sudo systemctl enable virt${drv}d{,-ro,-admin}.socket; 
    sudo systemctl start virt${drv}d{,-ro,-admin}.socket; 
    done
    Manage the Libvirtd ServiceOracle Linux 10: KVM User's Guide
    for drv in qemu network nodedev nwfilter secret storage interface; 
    do sudo systemctl enable virt${drv}d.service; 
    sudo systemctl enable virt${drv}d{,-ro,-admin}.socket; 
    sudo systemctl start virt${drv}d{,-ro,-admin}.socket; 
    done
    Manage the Libvirtd ServiceOracle Linux 9: KVM User's Guide
    sudo systemctl enable --now libvirtd
    Manage the Libvirtd ServiceOracle Linux 8: KVM User's Guide