KVM is a virtualization technology that allows for the creation of virtual machines on a Linux-based host. This tutorial will guide you through installing KVM on Fedora Server.
To install KVM on Fedora Server, use the following command:
sudo dnf install @virtualization
This will install the KVM hypervisor and other related packages.
After the installation is complete, verify that KVM is installed on your system by running the following command:
sudo virsh list --all
If KVM is installed correctly, the output of the command will show that there are no running virtual machines.
If you plan on using virtual machines with the network, you'll need to configure networking on the host system.
To configure your network, edit the network configuration file located at /etc/sysconfig/network-scripts/ifcfg-<interface_name>
. Replace <interface_name>
with the name of your network interface.
Here's a sample configuration:
TYPE="Ethernet"
BOOTPROTO="dhcp"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="enp0s3"
UUID="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
DEVICE="enp0s3"
ONBOOT="yes"
Save the changes and restart the network service:
sudo systemctl restart network
To create a virtual machine, you can use virt-install. Here's an example command to create a Fedora virtual machine:
sudo virt-install --virt-type=kvm --name=fedora --ram=2048 --vcpus=2 --disk path=/var/lib/libvirt/images/fedora.qcow2,size=20 --cdrom /path/to/fedora.iso --network bridge=br0 --graphics=spice --noautoconsole
--virt-type=kvm
specifies that the virtual machine will use KVM as the hypervisor.--name=fedora
sets the name of the virtual machine.--ram=2048
sets the amount of RAM for the virtual machine.--vcpus=2
sets the number of virtual CPUs for the virtual machine.--disk path=/var/lib/libvirt/images/fedora.qcow2,size=20
sets the disk path and size for the virtual machine.--cdrom /path/to/fedora.iso
specifies the path to the ISO file for the virtual machine.--network bridge=br0
sets the network bridge for the virtual machine.--graphics=spice
sets the graphics type for the virtual machine to SPICE.--noautoconsole
disables automatic console access for the virtual machine.You have successfully installed KVM on your Fedora Server and have created a virtual machine. You can now use KVM to create and manage virtual machines on your Fedora Server.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!