{"id":11911,"date":"2021-11-15T09:07:39","date_gmt":"2021-11-15T09:07:39","guid":{"rendered":"https:\/\/linuxways.net\/?p=11911"},"modified":"2021-11-16T13:14:51","modified_gmt":"2021-11-16T13:14:51","slug":"how-to-install-kvm-on-rocky-linux-almalinux","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/red-hat\/how-to-install-kvm-on-rocky-linux-almalinux\/","title":{"rendered":"How to install KVM on Rocky Linux \/ AlmaLinux"},"content":{"rendered":"<p>Virtualization is a popular technology used in cloud-based services and even in modern day datacenters to host applications. So what exactly is virtulization? This is a process of creating a virtual machine(s) from the hardware components of a PC using a hypervisor. Virtual machines, also known as guests, are isolated environments that run their own operating system independently of the host system which is th ephysical hardware. The hypervisor provides an additional layer on top of the physical system that enables the abstraction of hardware components such as CPU, RAM, disk space, USB controllers, keyboard, mouse, NICs and so much more.<\/p>\n<p>You can create multiple virtual machines from a single PC hardware provided it has the right amount of resources required to run the virtual machines. Benefits of virtulization include reduced operational costs, increased efficiency and productivity, and faster provisioning of services and applications.<\/p>\n<p><a href=\"https:\/\/www.redhat.com\/en\/topics\/virtualization\/what-is-KVM\">KVM<\/a> ( Kernel Virtualization Manager ) is an opensource virtualization technology built specifically for Linux operating system. It converts your system into a type 1 hypervisor and allows users to create virtual machine instances using either the GUI or on command-line.<\/p>\n<p>In this guide, we will seek to install KVM on Rocky Linux \/ AlmaLinux<\/p>\n<h2><a id=\"post-11911-_7d5ubneriu26\"><\/a><strong>Step 1: Check if virtualization is supported<\/strong><\/h2>\n<p>The first step is to check if Virtualization is enabled on your system. Modern systems typically come with the virtualization feature enabled in the BIOS. To confirm that the virtualization feature is enabled, run the command:<\/p>\n<pre>\r\n<strong>$ cat \/proc\/cpuinfo | egrep \"vmx|svm\"<\/strong>\r\n<\/pre>\n<p>If you are running an Intel CPU, you should get the <strong>&#8220;vmx\u201d <\/strong>keyword in the output. This is proof that Virtualization is enabled.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"859\" height=\"265\" class=\"wp-image-11912\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-140.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-140.png 859w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-140-300x93.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-140-768x237.png 768w\" sizes=\"auto, (max-width: 859px) 100vw, 859px\" \/><\/p>\n<p>If the output does not contain the <strong>&#8220;vmx\u201d <\/strong>keyword , then you need to go back to the BIOS settings and turn on virtualization.<\/p>\n<p>Additionally, you can check if KVM modules are enabled using the command:<\/p>\n<pre>\r\n<strong>$ lsmod | grep kvm<\/strong>\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"867\" height=\"199\" class=\"wp-image-11914\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-141.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-141.png 867w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-141-300x69.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-141-768x176.png 768w\" sizes=\"auto, (max-width: 867px) 100vw, 867px\" \/><\/p>\n<p>Perfect! At this point, we are ready to proceed with the installation of KVM.<\/p>\n<h2><a id=\"post-11911-_psljhusmkalo\"><\/a><strong>Step 2: Install KVM on Rocky Linux \/ AlmaLinux<\/strong><\/h2>\n<p>First, upgrade the existing software packages as follows.<\/p>\n<pre>\r\n<strong>$ sudo dnf update <\/strong>\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"861\" height=\"406\" class=\"wp-image-11915\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-143.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-143.png 861w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-143-300x141.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-143-768x362.png 768w\" sizes=\"auto, (max-width: 861px) 100vw, 861px\" \/><\/p>\n<p>When the upgrade is complete, install KVM along with other KVM management tools for managing the virtual machines.<\/p>\n<pre>\r\n<strong>$ sudo dnf install qemu-kvm qemu-img libvirt virt-manager virt-install virt-viewer libvirt-client<\/strong>\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"843\" height=\"358\" class=\"wp-image-11917\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-144.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-144.png 843w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-144-300x127.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-144-768x326.png 768w\" sizes=\"auto, (max-width: 843px) 100vw, 843px\" \/><\/p>\n<p>Once installed, start and enable the <strong>libvirtd<\/strong> service which is a virtualization daemon and a toolkit for managing virtualization platforms such as KVM, Xen, and ESXi.<\/p>\n<pre>\r\n<strong>$ sudo systemctl start libvirtd<\/strong>\r\n\r\n<strong>$ sudo systemctl enable libvirtd<\/strong>\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"850\" height=\"250\" class=\"wp-image-11919\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-146.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-146.png 850w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-146-300x88.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-146-768x226.png 768w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p>Then confirm the running status of the daemon.<\/p>\n<pre>\r\n<strong>$ sudo systemctl status libvirtd<\/strong>\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"844\" height=\"269\" class=\"wp-image-11921\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-148.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-148.png 844w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-148-300x96.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-148-768x245.png 768w\" sizes=\"auto, (max-width: 844px) 100vw, 844px\" \/><\/p>\n<h2><a id=\"post-11911-_1zjr9neagojw\"><\/a><strong>Step 3: Launch a Virtual machine with Virt-manager<\/strong><\/h2>\n<p>At this point, KVM and all of its associated packages required fot the installation and management of virtual machines is installed. The <strong>virt-manager <\/strong>utility is a graphical tool that is used for graphically creating and launching virtual machines using the <strong>libvirt <\/strong>service.<\/p>\n<p>There are two ways you can use to launch <strong>virt-manager. <\/strong>You can use the application manager to search for it as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"632\" height=\"393\" class=\"wp-image-11922\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-149.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-149.png 632w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-149-300x187.png 300w\" sizes=\"auto, (max-width: 632px) 100vw, 632px\" \/><\/p>\n<p>On command-line, simply run the command:<\/p>\n<pre>\r\n<strong>$ sudo virt-manager<\/strong>\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"833\" height=\"169\" class=\"wp-image-11924\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-151.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-151.png 833w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-151-300x61.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-151-768x156.png 768w\" sizes=\"auto, (max-width: 833px) 100vw, 833px\" \/><\/p>\n<p>This will pop open the Virt manager desktop interface as shown.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"647\" height=\"669\" class=\"wp-image-11926\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-153.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-153.png 647w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-153-290x300.png 290w\" sizes=\"auto, (max-width: 647px) 100vw, 647px\" \/><\/p>\n<p>Click on the top-left icon as shown to start creating a virtual machine.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"676\" height=\"384\" class=\"wp-image-11928\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-155.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-155.png 676w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-155-300x170.png 300w\" sizes=\"auto, (max-width: 676px) 100vw, 676px\" \/><\/p>\n<p>The next step presents you with a list of options on how you would like to install your virtual machine. In my case, I\u2019m installing Debian 10 from an ISO image. So I selected the first option \u2018<strong>Local Install Media<\/strong>\u2019. Your scenario may be different from mine. Other options include<\/p>\n<ul>\n<li>Network Install ( HTTP, HTTPS, FTP )<\/li>\n<li>Network Boot ( PXE )<\/li>\n<li>Importing existing boot image<\/li>\n<\/ul>\n<p>Once you have selected your preferred installation method, click on \u2018<strong>Forward<\/strong>\u2019.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"556\" height=\"591\" class=\"wp-image-11931\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-158.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-158.png 556w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-158-282x300.png 282w\" sizes=\"auto, (max-width: 556px) 100vw, 556px\" \/><\/p>\n<p>If you selected the first option, click on \u2018<strong>Browse<\/strong>\u2019.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"556\" height=\"595\" class=\"wp-image-11932\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-159.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-159.png 556w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-159-280x300.png 280w\" sizes=\"auto, (max-width: 556px) 100vw, 556px\" \/><\/p>\n<p>This takes you to this window where you need to click on \u2018<strong>Browse local<\/strong>\u2019 to browse your Linux system for the location of the ISO image or DVD ROM.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"749\" height=\"538\" class=\"wp-image-11933\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-160.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-160.png 749w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-160-300x215.png 300w\" sizes=\"auto, (max-width: 749px) 100vw, 749px\" \/><\/p>\n<p>Navigate to the directory that contains your ISO image.In my case, the ISO image is contained in the \u2018Downloads\u2019 directory.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1205\" height=\"410\" class=\"wp-image-11934\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-161.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-161.png 1205w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-161-300x102.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-161-1024x348.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-161-768x261.png 768w\" sizes=\"auto, (max-width: 1205px) 100vw, 1205px\" \/><\/p>\n<p>Back to the Virtual machine manager. The path of the installation media is already selected. Down below, Specify the Operating system and click \u2018<strong>Forward<\/strong>\u2019.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"707\" height=\"658\" class=\"wp-image-11935\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-162.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-162.png 707w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-162-300x279.png 300w\" sizes=\"auto, (max-width: 707px) 100vw, 707px\" \/><\/p>\n<p>Specify the memory or RAM in Megabytes and the number of CPU cores and click \u2018<strong>Forward<\/strong>\u2019.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"568\" height=\"599\" class=\"wp-image-11936\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-163.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-163.png 568w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-163-284x300.png 284w\" sizes=\"auto, (max-width: 568px) 100vw, 568px\" \/><\/p>\n<p>Next, specify the disk space and enable storage for the virtual machine and click \u2018<strong>Forward<\/strong>\u2019.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"544\" height=\"587\" class=\"wp-image-11937\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-164.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-164.png 544w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-164-278x300.png 278w\" sizes=\"auto, (max-width: 544px) 100vw, 544px\" \/><\/p>\n<p>Finally, review your settings and click \u2018Finish\u2019 to wind up creating the virtual machine.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"560\" height=\"602\" class=\"wp-image-11938\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-165.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-165.png 560w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-165-279x300.png 279w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/p>\n<p>The virtual machine manager will start allocating the resources you selected to your virtual machine.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"545\" height=\"518\" class=\"wp-image-11939\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-166.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-166.png 545w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-166-300x285.png 300w\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" \/><\/p>\n<p>Once done , the virt-viewer GUI will pop up prompting you to begin the installation of the operating system. What you see below is the Debian 10 installer prompting you to select your preferred option to commence the installation.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"916\" height=\"670\" class=\"wp-image-11940\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-167.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-167.png 916w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-167-300x219.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-167-768x562.png 768w\" sizes=\"auto, (max-width: 916px) 100vw, 916px\" \/><\/p>\n<p>When you head back to the Virtual machine manager, you will find that your virtual machine is up and running. From here, you can manage your virtual machine including starting, pausing, stopping, and cloning the virtual machine.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"554\" height=\"591\" class=\"wp-image-11941\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-168.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-168.png 554w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-168-281x300.png 281w\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" \/><\/p>\n<h2><a id=\"post-11911-_g8hrf8c91axt\"><\/a><strong>Conclusion<\/strong><\/h2>\n<p>This wraps up our topic today on the installation of KVM on Rocky Linux \/ AlmaLinux. As you have seen it\u2019s quite simple and no code is required to create the virtual machine. Everything is done by the virtual machine manager.<\/p>","protected":false},"excerpt":{"rendered":"<p>Virtualization is a popular technology used in cloud-based services and even in modern day datacenters to host applications. So what exactly is virtulization? This is a process of&hellip;<\/p>","protected":false},"author":1,"featured_media":11943,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[165],"tags":[],"class_list":["post-11911","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-red-hat"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/11911","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=11911"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/11911\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/11943"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=11911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=11911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=11911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}