How To Install KVM on Fedora 43

Virtualization has become an essential tool for developers, system administrators, and tech enthusiasts who need to run multiple operating systems on a single machine. Whether you’re testing software, creating development environments, or managing server infrastructure, having a reliable virtualization solution is crucial. KVM (Kernel-based Virtual Machine) stands out as one of the most powerful and efficient virtualization technologies available for Linux systems, offering near-bare-metal performance without the licensing costs of proprietary alternatives.
Fedora 43, with its cutting-edge kernel and robust package management, provides an excellent foundation for running KVM virtualization. This comprehensive guide walks you through every step of installing and configuring KVM on Fedora 43, from verifying hardware compatibility to creating your first virtual machine. By the end of this tutorial, you’ll have a fully functional virtualization environment ready for production or testing workloads.
What is KVM and Why Use It on Fedora 43?
KVM transforms your Linux kernel into a Type-1 hypervisor, allowing you to run multiple virtual machines with remarkable efficiency. Unlike Type-2 hypervisors that run as applications on top of an operating system, KVM leverages kernel-level integration for superior performance. This architecture means your virtual machines can access hardware resources directly, resulting in significantly better speed and responsiveness compared to software-based virtualization solutions.
Fedora 43 users benefit from several advantages when choosing KVM as their virtualization platform. The native integration with the Linux ecosystem means you’re working with technology that’s been tested and optimized specifically for your distribution. Red Hat, the primary sponsor behind Fedora, heavily invests in KVM development, ensuring continuous improvements and enterprise-grade reliability. You’ll experience performance that rivals dedicated hardware in many scenarios, making it suitable for everything from casual testing to serious production workloads.
The open-source nature of KVM eliminates licensing fees entirely. Commercial virtualization platforms can cost hundreds or thousands of dollars per host, but KVM delivers comparable features at zero cost. This makes it perfect for home labs, small businesses, and large enterprises alike. Additionally, the vibrant community surrounding KVM and libvirt provides extensive documentation, troubleshooting resources, and regular security updates.
Prerequisites and System Requirements
Before diving into the installation process, you need to verify that your system meets the necessary requirements for running KVM virtualization effectively.
Hardware Requirements
Your processor must support hardware virtualization extensions. Intel processors require VT-x (Virtualization Technology), while AMD processors need AMD-V (AMD Virtualization). These extensions enable the CPU to handle virtualization tasks at the hardware level, dramatically improving performance and stability. Most processors manufactured after 2010 include these features, though some manufacturers disable them by default in BIOS.
For memory, plan on having at least 8GB of RAM in your host system. Remember that your virtual machines will consume memory from this pool, so 16GB or more is ideal if you intend to run multiple VMs simultaneously. Each guest operating system you create will require its own allocation—a Linux server might run comfortably with 2GB, while a Windows desktop could demand 4GB or more.
Storage space depends on your intended use. A minimal Linux installation might occupy only 10GB, but Windows VMs often require 40-60GB. Plan your disk allocation carefully, keeping in mind that virtual machine images grow over time as you install software and store data. SSDs provide significantly better performance for VM storage compared to traditional hard drives.
Software Requirements
You need a working Fedora 43 installation, whether you’re running the Workstation edition on a desktop or the Server edition on dedicated hardware. Root access or sudo privileges are essential for installing packages and configuring system services. Your system should also have an active internet connection for downloading packages and updates.
Checking Virtualization Support
Open a terminal and run this command to verify your CPU supports virtualization extensions:
cat /proc/cpuinfo | egrep "vmx|svm"
You should see multiple lines returned, with “vmx” appearing for Intel processors or “svm” for AMD processors. If this command returns no output, your CPU either doesn’t support virtualization or the feature is disabled in your system BIOS. Restart your computer and enter the BIOS/UEFI setup (usually by pressing F2, F10, Del, or Esc during boot). Look for settings labeled “Virtualization Technology,” “VT-x,” “AMD-V,” or similar terms, and enable them. Save your changes and reboot.
Step 1: Update Your Fedora 43 System
Beginning with a fully updated system prevents compatibility issues and ensures you have the latest security patches. Fedora’s DNF package manager makes this process straightforward.
Execute this command in your terminal:
sudo dnf update -y
The -y flag automatically confirms any prompts, streamlining the update process. DNF will download and install all available updates for your system packages. This might take several minutes depending on your internet connection speed and how recently you last updated. If kernel updates are included, you should reboot your system afterward to load the new kernel:
sudo reboot
Starting with a clean, updated foundation significantly reduces the likelihood of encountering version conflicts or dependency issues during the KVM installation.
Step 2: Install KVM and Essential Packages
Fedora 43 makes KVM installation remarkably simple through its comprehensive package repositories.
Core KVM Installation
Install the fundamental virtualization packages with this command:
sudo dnf install -y qemu-kvm libvirt virt-install bridge-utils
Let’s break down what each package provides:
qemu-kvm serves as the main virtualization engine, providing the emulation layer that allows virtual machines to run. It combines QEMU’s device emulation capabilities with KVM’s kernel-level acceleration.
libvirt offers a standardized API and management daemon for controlling virtualization platforms. This abstraction layer allows various tools to interact with KVM without needing to understand its low-level details directly.
virt-install gives you a command-line interface for creating new virtual machines. Power users often prefer this approach for scripting and automation.
bridge-utils provides networking utilities that enable advanced network configurations, allowing your VMs to communicate with the outside world efficiently.
Additional Management Tools
Enhance your virtualization environment with supplementary tools:
sudo dnf install -y libvirt-devel virt-top libguestfs-tools guestfs-tools
These packages add valuable functionality. The libvirt-devel package includes development libraries useful for building virtualization-related software. virt-top functions like the traditional top command but displays statistics for your running virtual machines, making performance monitoring straightforward. The libguestfs-tools and guestfs-tools packages enable you to access and modify virtual machine disk images without booting the VMs themselves—incredibly useful for troubleshooting or automated configuration tasks.
Verification
Confirm the installation succeeded by checking the installed packages:
rpm -qa | grep -E "qemu-kvm|libvirt"
You should see the package names and version numbers listed, confirming successful installation.
Step 3: Verify KVM Kernel Modules
KVM operates through loadable kernel modules that integrate virtualization capabilities directly into your Linux kernel. Verifying these modules are active confirms your system is ready for virtualization.
Check which KVM modules are currently loaded:
lsmod | grep kvm
Intel systems should display kvm_intel along with the base kvm module. AMD systems will show kvm_amd instead. If you see these modules listed, your kernel has successfully loaded the virtualization drivers.
For a more comprehensive validation, run the virtualization validation tool:
virt-host-validate
This utility performs numerous checks against your system configuration. A passing system will show “PASS” next to each test. If you encounter “FAIL” or “WARN” messages, the tool typically provides guidance on addressing the issue. Common warnings relate to security features like AppArmor or SELinux configurations, which usually don’t prevent basic virtualization functionality.
If the KVM modules aren’t loaded automatically, you might need to manually load them. For Intel processors:
sudo modprobe kvm_intel
For AMD processors:
sudo modprobe kvm_amd
To make this change permanent across reboots, add the module name to /etc/modules-load.d/kvm.conf.
Step 4: Start and Enable the Libvirt Daemon
The libvirtd daemon manages all virtualization operations on your system. Starting this service activates your KVM environment.
Starting the Service
Launch the libvirt daemon immediately:
sudo systemctl start libvirtd
This command initiates the service for your current session. The daemon begins listening for management commands and prepares the virtualization infrastructure.
Enabling Auto-Start on Boot
Configure libvirtd to start automatically whenever your system boots:
sudo systemctl enable libvirtd
Alternatively, you can combine both operations into a single command:
sudo systemctl enable --now libvirtd
The --now flag starts the service immediately while also enabling it for future boots.
Verify Service Status
Confirm the daemon is running properly:
sudo systemctl status libvirtd
Look for “active (running)” in the output, indicated by green text. If the service failed to start, the status output will display error messages pointing toward the problem. Common issues include port conflicts or configuration file syntax errors.
Step 5: Configure User Permissions
By default, only the root user can manage virtual machines. Adding your user account to the appropriate groups enables non-root access while maintaining security.
Add your current user to the libvirt group:
sudo usermod -aG libvirt $(whoami)
Some configurations also require membership in the kvm group:
sudo usermod -aG kvm $(whoami)
These group memberships grant your user account permission to interact with the libvirt socket and KVM device files. After making these changes, you must log out of your session completely and log back in for the group assignments to take effect. Alternatively, reboot your system.
Verify your group membership afterward:
groups
You should see “libvirt” and potentially “kvm” listed among your groups. This step eliminates the need to prefix virtualization commands with sudo, streamlining your workflow significantly.
Step 6: Set Up Network Bridge (Optional but Recommended)
Virtual machines need network connectivity to be truly useful. KVM offers several networking modes, with bridged networking providing the most flexibility for many use cases.
Understanding Network Modes
The default NAT (Network Address Translation) mode works well for basic scenarios where your VMs only need internet access and don’t require visibility on your local network. However, bridged networking makes your VMs appear as distinct devices on your network, each with their own IP addresses. This configuration proves essential for running server workloads that need to be accessible from other machines.
Creating a Bridge with NetworkManager
Fedora 43 uses NetworkManager by default, making bridge creation straightforward with the nmcli command-line tool.
Create a new bridge interface:
nmcli connection add type bridge autoconnect yes con-name br0 ifname br0
Configure the bridge with a static IP address:
nmcli connection modify br0 ipv4.addresses 10.0.0.30/24 ipv4.method manual
Set your gateway and DNS servers:
nmcli connection modify br0 ipv4.gateway 10.0.0.1
nmcli connection modify br0 ipv4.dns 8.8.8.8
Identify your current network connection name:
nmcli connection show
Remove or disable your existing connection (replace “ens3” with your actual interface name):
nmcli connection delete ens3
Add your physical interface as a bridge slave:
nmcli connection add type bridge-slave autoconnect yes con-name ens3 ifname ens3 master br0
Activate the bridge:
nmcli connection up br0
Verify the configuration:
ip address show br0
Alternative: Using Default NAT Network
If bridged networking seems overly complex for your needs, the default NAT configuration requires no additional setup. This mode works perfectly for development environments, testing, and scenarios where your VMs only need outbound internet connectivity.
Step 7: Install Virt-Manager (GUI Management Tool)
While command-line tools offer powerful scripting capabilities, a graphical interface often simplifies virtual machine management, especially when you’re first learning KVM.
Install the Virt-Manager application:
sudo dnf install -y virt-manager
Virt-Manager provides a user-friendly interface for creating, configuring, and managing virtual machines. Launch it from your applications menu by searching for “Virtual Machine Manager” or run virt-manager from a terminal.
Upon first launch, Virt-Manager attempts to connect to your local QEMU/KVM instance. You should see “QEMU/KVM” listed in the connection panel. Double-clicking this connection displays any existing virtual machines (none yet) and allows you to create new ones.
The graphical console viewer built into Virt-Manager lets you interact with your VMs as if you were sitting at their physical consoles. This proves invaluable during operating system installations and troubleshooting scenarios. However, many experienced administrators prefer command-line management for its automation potential and remote management capabilities.
Step 8: Create Your First Virtual Machine
With your KVM infrastructure in place, you’re ready to create a virtual machine.
Using Virt-Manager GUI Method
Launch Virt-Manager and click the “Create a new virtual machine” button (or File → New Virtual Machine). The wizard guides you through several configuration steps:
- Choose Installation Source: Select “Local install media” if you have an ISO file downloaded, or “Network Install” for a URL-based installation.
- Select Installation Media: Browse to your ISO file location. Virt-Manager attempts to detect the operating system automatically.
- Configure Memory and CPUs: Allocate RAM and CPU cores. Start conservatively—you can always increase resources later. A typical Linux server runs well with 2GB RAM and 2 CPU cores.
- Configure Storage: Create a disk image for your VM. The default QCOW2 format offers snapshots and thin provisioning. Specify size based on your intended use—20GB suffices for most Linux installations.
- Name Your VM: Choose a descriptive name and review your configuration. Check “Customize configuration before install” if you want to adjust advanced settings like network adapter type.
Click “Finish” to create the VM. The graphical console opens automatically, and your chosen operating system begins installing.
Using virt-install Command Line
For automation and scripting, the command-line approach offers more control:
virt-install \
--name fedora-vm \
--ram 2048 \
--vcpus 2 \
--disk path=/var/lib/libvirt/images/fedora-vm.qcow2,size=20 \
--os-variant fedora43 \
--network network=default \
--graphics vnc \
--location /path/to/Fedora-43-x86_64-Server.iso \
--extra-args "console=tty0 console=ttyS0,115200n8"
This command creates a VM named “fedora-vm” with 2GB RAM, 2 CPU cores, and a 20GB disk. The --os-variant parameter optimizes settings for Fedora 43. You can list all available OS variants with osinfo-query os.
The installation proceeds in your terminal if you specified console output, or you can connect with a VNC client to the graphical installer. Monitor progress until the OS installation completes.
Post-Creation Steps
Start your VM:
virsh start fedora-vm
Connect to the console:
virsh console fedora-vm
List all VMs on your system:
virsh list --all
These basic virsh commands form the foundation of command-line VM management. The tool offers extensive capabilities for advanced administration tasks.
Common Troubleshooting Issues and Solutions
Even with careful preparation, you might encounter obstacles during setup or operation.
KVM Modules Not Loading
If lsmod | grep kvm returns nothing, first verify your BIOS settings. Restart your computer and enter BIOS/UEFI setup. Navigate to CPU configuration or advanced settings and enable virtualization extensions. The exact location and wording vary by manufacturer—look for terms like “Intel Virtualization Technology,” “VT-x,” “AMD-V,” or “SVM Mode.”
If you receive “KVM: disabled by BIOS” errors despite enabling virtualization, some systems require you to disable Secure Boot temporarily. This security feature sometimes conflicts with KVM module loading on certain hardware configurations.
Permission Denied Errors
These errors typically indicate group membership issues. Double-check that your user belongs to the libvirt and kvm groups. Remember that logging out and back in is necessary for group changes to take effect—simply opening a new terminal isn’t sufficient.
If problems persist, verify the libvirt socket permissions:
ls -l /var/run/libvirt/libvirt-sock
The socket file should be owned by root with group libvirt and appropriate permissions (typically srwxrwx—).
Libvirtd Service Failures
When libvirtd fails to start, examine the service logs for specific error messages:
journalctl -u libvirtd -n 50
Configuration file syntax errors represent a common culprit. If you’ve manually edited files in /etc/libvirt/, validate the XML syntax carefully. Missing dependencies also prevent service startup—ensure all required packages installed correctly.
Network Connectivity Problems
VMs unable to reach the network often suffer from bridge configuration issues or firewall restrictions. Verify your bridge is up and properly configured:
brctl show
Check firewall rules to ensure they permit virtualization traffic. Fedora’s firewalld should automatically configure necessary rules, but custom firewall configurations might block VM network access.
For NAT networking problems, verify the default network is active:
virsh net-list --all
If the default network appears inactive, start it:
virsh net-start default
virsh net-autostart default
Performance Issues
Slow VM performance often results from missing KVM acceleration. Verify your VM is actually using KVM:
virsh dumpxml fedora-vm | grep kvm
You should see references to the KVM domain type. If your VM runs under QEMU emulation instead of KVM acceleration, it will be dramatically slower. This usually indicates the KVM modules aren’t loaded or virtualization extensions aren’t enabled.
Performance Optimization Tips
Optimizing your KVM setup can dramatically improve virtual machine performance.
CPU Optimization
CPU host-passthrough mode exposes your host CPU’s features directly to VMs, maximizing performance. Edit your VM’s configuration to use this CPU mode for workloads that don’t require migration between different CPU types.
For VMs running latency-sensitive applications, CPU pinning dedicates specific physical cores to specific virtual CPUs. This prevents the scheduler from constantly moving VM processes between cores, reducing cache misses and improving consistency.
Memory Optimization
Enabling huge pages reduces memory translation overhead, particularly beneficial for VMs with large memory allocations. Configure huge pages in your host system, then modify VM definitions to use them.
Memory ballooning allows dynamic memory reallocation between host and guests. The balloon driver in your guest operating system can return unused memory to the host, improving overall resource utilization across multiple VMs.
Storage Performance
VirtIO drivers provide paravirtualized storage access, significantly outperforming emulated IDE or SATA controllers. Always use VirtIO for disk devices when the guest operating system supports it—most modern Linux distributions and recent Windows versions include VirtIO drivers.
Choose your disk image format carefully. Raw images offer maximum performance since they lack overhead, but sacrifice features like snapshots. QCOW2 images support snapshots and compression but introduce slight performance penalties. For production workloads prioritizing speed, raw format on SSD storage delivers optimal results.
Configure your storage I/O scheduler appropriately. The deadline scheduler works well for most virtualization workloads, balancing throughput and latency. For SSD storage, the noop or none schedulers often perform better since SSDs don’t benefit from traditional disk scheduling algorithms.
Network Performance
VirtIO network drivers dramatically improve network throughput and reduce CPU overhead compared to emulated network cards. Ensure your VM uses VirtIO NICs for best performance.
For high-bandwidth scenarios, enable TCP offload features that allow network processing to occur in hardware rather than software. Jumbo frames can also improve throughput on networks that support them, though this requires configuration on both the VM and physical network infrastructure.
Congratulations! You have successfully installed KVM. Thanks for using this tutorial for installing the Kernel-based Virtual Machine (KVM) on your Fedora 43 Linux system. For additional or useful information, we recommend you check the official KVM website.