
In this article, we will review the process for creating snapshots in KVM. As part of this process, we will learn how to script this
Learn how to install KVM on Fedora 41 step-by-step—covering prerequisites, CLI & GUI configuration, networking, performance tuning, and best practices for virtualized environments.
As enterprise-grade virtualization becomes essential for both personal labs and production environments, installing KVM on Fedora 41 offers a powerful combination of stability, performance, and open-source flexibility. In this guide, you’ll learn step-by-step how to set up Kernel-based Virtual Machine (KVM) on Fedora 41, configure networking, manage VMs via command-line and GUI tools, and optimize performance.
Why Fedora 41 + KVM? |
|
|
|
|
Before proceeding, ensure your system meets these requirements:
Requirement | Fedora 41 Host |
---|---|
64‑bit CPU w/ virtualization | Intel VT‑x or AMD‑V |
Minimum RAM | 4 GB (8 GB+ recommended) |
Disk space | 20 GB free |
Fedora version | Fedora 41 (Workstation or Server) |
Network | Wired or bridged network preferred |
Run this to confirm virtualization support:
egrep -c '(vmx|svm)' /proc/cpuinfo
If output ≥ 1, you’re good. Otherwise enable virtualization in BIOS/UEFI.
Install the core virtualization tools with DNF:
sudo dnf install -y qemu-kvm libvirt virt-install bridge-utils
Explanation:
|
|
|
|
Enable and start the libvirt daemon:
sudo systemctl enable --now libvirtd
sudo systemctl status libvirtd
On Fedora 41, libvirtd
includes the QEMU driver by default.
By default, only root or libvirt
group members can manage VMs. Add your user:
sudo usermod -aG libvirt $(whoami)
newgrp libvirt
Confirm group membership:
groups | grep libvirt
libvirt wheel admin
You should see libvirt
in the output.
Default NAT Network |
Fedora auto-creates a NAT network called default
. You can verify:
virsh net-list --all
Name State Autostart Persistent
----------------------------------------
Network | Status | Autostart | Persistent |
---|---|---|---|
default | active | yes | yes |
If a default network is not defined, the network XML exists on Fedora 41:
cat /usr/share/libvirt/networks/default.xml
default
Run the following command to define it:
virsh net-define /usr/share/libvirt/networks/default.xml
Network default defined from /usr/share/libvirt/networks/default.xml
nmcli
Create the Bridge Network Interface |
First, create the bridge interface, br0
, using nmcli
:
sudo nmcli connection add type bridge con-name br0 ifname br0
This command creates a new bridge connection named br0
.
Configure the Primary Network Interface |
Next, modify your existing network interface (e.g., eno1
) to use the bridge (br0
) instead of a direct Ethernet connection.
sudo nmcli connection add type ethernet con-name eno1 ifname eno1 master br0
This command will attach the primary network interface to the bridge br0
.
Configure the Bridge IP (Static or DHCP) |
For DHCP: If you want br0
to obtain an IP address via DHCP, run:
sudo nmcli connection modify br0 ipv4.method auto
For Static IP: If you want to assign a static IP to the bridge interface, use the following:
sudo nmcli connection modify br0 ipv4.method manual ipv4.addresses 192.168.1.100/24 ipv4.gateway 192.168.1.1
sudo nmcli connection modify br0 ipv4.dns "8.8.8.8 8.8.4.4"
Activate the Bridge Network |
Now, activate both the bridge and the primary network interface:
sudo nmcli connection up br0
sudo nmcli connection up eno1
Verify the Network Configuration |
Check that the bridge interface br0
is properly configured and active:
nmcli connection show
You should see something like this:
NAME UUID TYPE DEVICE
br0 12345678-1234-1234-1234-123456789abc bridge br0
eno1 98765432-9876-9876-9876-9876543210ab ethernet eno1
Also, confirm the IP configuration of br0
:
ip a show br0
7: br0: mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 30:24:a9:a3:4f:30 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.100/24 brd 192.168.1.255 scope global noprefixroute br0
valid_lft forever preferred_lft forever
Use virt-install
to create a new VM:
sudo virt-install \
--name fedora41-vm \
--ram 2048 \
--vcpus 2 \
--os-variant fedora41 \
--cdrom /path/to/Fedora-41-x86_64-Server.iso \
--network network=default \
--disk size=20 \
--graphics none \
--console pty,target_type=serial
|
|
|
virsh console fedora41-vm
If you prefer a GUI:
sudo dnf install -y virt-manager
Launch with:
virt-manager
Photo by admingeek from Infotechys
From here:
|
|
|
|
|
Use VirtIO Drivers |
In your VM config:
|
|
These guest drivers boost I/O and network performance.
CPU Pinning |
To reduce latency and improve performance:
virsh vcpupin fedora41-vm 0 0 # pin vCPU0 to physical CPU0
virsh vcpupin fedora41-vm 1 1 # pin vCPU1 to physical CPU1
Hugepages |
For workloads requiring large memory pages:
Enable hugepages:
sudo grubby --update-kernel=ALL --args="default_hugepagesz=1G hugepagesz=1G hugepages=4"
reboot
In libvirt XML guest config, add:
reboot
|
|
sudo firewall-cmd --add-service=libvirt --permanent
sudo firewall-cmd --reload
|
qcow2 (copy-on-write, snapshot-friendly)
raw (faster, no snapshots)
|
Q1: Can I install KVM on Fedora Workstation 41? |
Yes – Fedora Workstation includes all necessary packages; installation commands are identical.
Q2: How to create bridged networking? |
Use bridge-utils
with configuration in /etc/sysconfig/network-scripts
, then restart NetworkManager
.
Q3: How do I uninstall KVM? |
Use:
sudo dnf remove qemu-kvm libvirt virt-install bridge-utils virt-manager
In this guide, we’ve covered everything you need to install and configure KVM on Fedora 41. From setting up the necessary virtualization packages to creating and managing virtual networks, we’ve walked through the essential steps for building a stable and efficient virtualized environment.
Here’s a quick recap of what we’ve accomplished:
|
|
|
|
|
Whether you’re deploying a virtual lab, experimenting with open-source virtualization, or setting up a production environment, KVM on Fedora 41 is an excellent choice due to its powerful features, flexibility, and security.
By following this guide, you now have the knowledge to set up your KVM environment and start creating virtual machines. With additional performance optimizations and troubleshooting techniques, your setup is ready for even the most demanding use cases.
Did you find this article useful? Your feedback is invaluable to us! Please feel free to share your thoughts in the comments section below.
In this article, we will review the process for creating snapshots in KVM. As part of this process, we will learn how to script this
In this tutorial, we will review the installation procedure for standing up an Ubuntu 20.04 server on KVM. We will focus specifically, on version 20.04
In today’s tutorial, we will install CentOS8 on KVM. The install process is fairly straightforward and we will cover it here step-by-step. We will follow