In this step by step guide, I will walk you through the steps to install and configure KVM in OpenSUSE Tumbleweed desktop.
Before installing KVM, first make sure your system supports hardware virtualization. We have documented a few different ways to find if a Linux system supports Virtualization in the following guide.
If your system supports hardware virtualization, go ahead and setup KVM virtualization server on your openSUSE system as described in the subsequent steps.
Install and configure KVM in openSUSE Tumbleweed
For the purpose of this guide, I will be using the following system:
KVM virtualization server:
- OS – openSUSE Tumbleweed desktop
- IP Address : 192.168.29.72/24
Install KVM in openSUSE Tumbleweed
I personally tested this guide on the latest openSUSE Tumbleweed version. I believe this will work on Leap edition as well.
Setting up a virtualization environment in openSUSE is very easy and straight-forward.
If you prefer command line way, just run the following command to install KVM server and KVM tools in openSUSE:
$ sudo zypper install -t pattern kvm_server kvm_tools
You can also install KVM using YaST. YaST is the graphical installation and configuration tool for openSUSE. It simplified the installation of KVM hypervisor in openSUSE.
Open YaST and head to the "Virtualization" section on the left pane and click "Install Hypervisor and Tools" option on the right pane.
A new window will pop up. Choose both KVM server and KVM tools under the KVM Hypervisor section. The KVM server provides only the minimal system to get a running system. In order to configure, manage and monitor KVM virtual machines, you must choose KVM tools option as well. After choosing both options, Click Accept to continue:
KVM installation will begin shortly. Once the installation is about to complete, you will be notified to configure bridge networking manually. Click OK to close the notification message.
Upon successful installation, you will see the following message:
Next, enable and start
libvirtd service using commands:
$ sudo systemctl enable libvirtd
$ sudo systemctl start libvirtd
You can also combine both commands and run them as an one-liner like below:
$ sudo systemctl enable --now libvirtd
Check the status of
libvirtd service with command:
$ systemctl status libvirtd
● libvirtd.service - Virtualization daemon Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: disabled) Active: active (running) since Sat 2021-04-24 14:06:40 IST; 3s ago TriggeredBy: ● libvirtd-ro.socket ● libvirtd-admin.socket ● libvirtd.socket Docs: man:libvirtd(8) https://libvirt.org Main PID: 16885 (libvirtd) Tasks: 19 (limit: 32768) CPU: 234ms CGroup: /system.slice/libvirtd.service └─16885 /usr/sbin/libvirtd --timeout 120
As you see in the above output,
libvirtd service is up and running!
Congratulations! Our openSUSE system is now ready to deploy KVM virtual machines!
Create and manage KVM guest machines
We can create and manage KVM virtual machines either from command line using
virsh command or using any graphical KVM management tools like Cockpit and Virt-manager. Refer the following guides to know how to manage KVM guests using these tools.
- How To Manage KVM Virtual Machines With Virsh Program
- Manage KVM Virtual Machines Using Cockpit Web Console
- How To Manage KVM Virtual Machines With Virt-Manager
Enable Virsh Console Access For Virtual Machines
After creating the KVM guests, I can be able to access them via SSH, VNC client, Virt-viewer, Virt-manager and Cockpit web console etc. But I couldn't access them using "virsh console" command. In order to access KVM guests using "virsh console", we should enable it as described in the following guide:
Other KVM related guides
- Install And Configure KVM In CentOS 8 Server
- Install And Configure KVM In Ubuntu 20.04 Headless Server
- Create A KVM Virtual Machine Using Qcow2 Image In Linux
- How To Migrate Virtualbox VMs Into KVM VMs In Linux
- Enable UEFI Support For KVM Virtual Machines In Linux
- How To Enable Nested Virtualization In KVM In Linux
- Display Virtualization Systems Stats With Virt-top In Linux
- How To Find The IP Address Of A KVM Virtual Machine
- How To Rename KVM Guest Virtual Machine
- Access And Modify Virtual Machine Disk Images With Libguestfs
- Quickly Build Virtual Machine Images With Virt-builder
- How To Rescue Virtual Machines With Virt-rescue
- How To Extend KVM Virtual Machine Disk Size In Linux
- Setup A Shared Folder Between KVM Host And Guest
- How To Change KVM Libvirt Default Storage Pool Location
- [Solved] Cannot access storage file, Permission denied Error in KVM Libvirt
Hope this helps.