Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
redhat:virtualization-redhat:start [2020/04/01 10:59] – [KVM Hypervisor on Red Hat / CentOS 8.x] michael | redhat:virtualization-redhat:start [2020/04/01 12:09] – [Configure KVM Environment] michael | ||
---|---|---|---|
Line 35: | Line 35: | ||
- | ===== Installing KVM ===== | + | ===== Installing KVM and QEMU ===== |
Line 46: | Line 46: | ||
# dnf install -y @virt | # dnf install -y @virt | ||
</ | </ | ||
+ | <sxh bash; gutter: false;> | ||
+ | ... | ||
+ | ================================================================================ | ||
+ | Installed: | ||
+ | libguestfs-1: | ||
+ | libvirt-client-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 | ||
+ | libvirt-daemon-config-network-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 | ||
+ | libvirt-daemon-kvm-4.5.0-24.3.module_el8.0.0+189+f9babebb.x86_64 | ||
+ | alsa-lib-1.1.6-3.el8.x86_64 | ||
+ | autogen-libopts-5.18.12-7.el8.x86_64 | ||
+ | boost-atomic-1.66.0-6.el8.x86_64 | ||
+ | boost-chrono-1.66.0-6.el8.x86_64 | ||
+ | boost-date-time-1.66.0-6.el8.x86_64 | ||
+ | boost-iostreams-1.66.0-6.el8.x86_64 | ||
+ | boost-program-options-1.66.0-6.el8.x86_64 | ||
+ | boost-random-1.66.0-6.el8.x86_64 | ||
+ | boost-regex-1.66.0-6.el8.x86_64 | ||
+ | boost-system-1.66.0-6.el8.x86_64 | ||
+ | boost-thread-1.66.0-6.el8.x86_64 | ||
+ | cairo-1.15.12-3.el8.x86_64 | ||
+ | celt051-0.5.1.3-15.el8.x86_64 | ||
+ | dnsmasq-2.79-4.el8.x86_64 | ||
+ | edk2-ovmf-20180508gitee3198e672e2-9.el8_0.1.noarch | ||
+ | fribidi-1.0.4-6.el8.x86_64 | ||
+ | genisoimage-1.1.11-39.el8.x86_64 | ||
+ | glusterfs-api-3.12.2-40.2.el8.x86_64 | ||
+ | glusterfs-cli-3.12.2-40.2.el8.x86_64 | ||
+ | gnutls-dane-3.6.5-2.el8.x86_64 | ||
+ | gnutls-utils-3.6.5-2.el8.x86_64 | ||
+ | graphite2-1.3.10-10.el8.x86_64 | ||
+ | gstreamer1-1.14.0-3.el8.x86_64 | ||
+ | gstreamer1-plugins-base-1.14.0-4.el8.x86_64 | ||
+ | harfbuzz-1.7.5-3.el8.x86_64 | ||
+ | hivex-1.3.15-7.module_el8.0.0+189+f9babebb.x86_64 | ||
+ | ipxe-roms-qemu-20181214-1.git133f4c47.el8.noarch | ||
+ | iso-codes-3.79-2.el8.noarch | ||
+ | libX11-1.6.7-1.el8.x86_64 | ||
+ | libX11-common-1.6.7-1.el8.noarch | ||
+ | libX11-xcb-1.6.7-1.el8.x86_64 | ||
+ | libXau-1.0.8-13.el8.x86_64 | ||
+ | ... | ||
+ | </ | ||
</ | </ | ||
Line 54: | Line 96: | ||
# dnf install -y virt-install | # dnf install -y virt-install | ||
</ | </ | ||
+ | |||
+ | <sxh bash; gutter: false;> | ||
+ | ... | ||
+ | ================================================================================ | ||
+ | Installing: | ||
+ | | ||
+ | Installing dependencies: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Transaction Summary | ||
+ | ================================================================================ | ||
+ | Install | ||
+ | ... | ||
+ | </ | ||
</ | </ | ||
Line 59: | Line 123: | ||
<WRAP center box 100%> | <WRAP center box 100%> | ||
- | Validate all the components on your KVM host can support virtualization. | + | '' |
< | < | ||
Line 85: | Line 149: | ||
QEMU: Checking for device assignment IOMMU support | QEMU: Checking for device assignment IOMMU support | ||
QEMU: Checking if IOMMU is enabled by kernel | QEMU: Checking if IOMMU is enabled by kernel | ||
- | |||
</ | </ | ||
- | </ | + | It looks like '' |
+ | The solution is already suggested by the above command. Therefore, we are adding the same in the Kernel command line options. | ||
+ | < | ||
+ | <wrap em>To take effect, restart your machine!</ | ||
+ | After reboot, again run the '' | ||
+ | <sxh bash; gutter: false;> | ||
+ | QEMU: Checking for hardware virtualization | ||
+ | QEMU: Checking if device /dev/kvm exists | ||
+ | QEMU: Checking if device /dev/kvm is accessible | ||
+ | QEMU: Checking if device / | ||
+ | QEMU: Checking if device / | ||
+ | QEMU: Checking for cgroup ' | ||
+ | QEMU: Checking for cgroup ' | ||
+ | QEMU: Checking for cgroup ' | ||
+ | QEMU: Checking for cgroup ' | ||
+ | QEMU: Checking for cgroup ' | ||
+ | QEMU: Checking for cgroup ' | ||
+ | QEMU: Checking for cgroup ' | ||
+ | QEMU: Checking for cgroup ' | ||
+ | QEMU: Checking for cgroup ' | ||
+ | QEMU: Checking for cgroup ' | ||
+ | QEMU: Checking for cgroup ' | ||
+ | QEMU: Checking for cgroup ' | ||
+ | QEMU: Checking for device assignment IOMMU support | ||
+ | QEMU: Checking if IOMMU is enabled by kernel | ||
+ | </ | ||
+ | '' | ||
+ | </ | ||
+ | KVM and QEMU hypervisors has been installed on CentOS 8. | ||
- | Nach erfolgreicher Installation müssen die Services gestartet & aktiviert werden. | + | ===== Configure |
- | + | ||
- | < | + | |
- | # systemctl start libvirtd | + | |
- | # systemctl enable libvirtd | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | Nun sollte überprüft werden, ob KVM erfolgreich seine beiden Core-Module laden konnte. | + | |
<WRAP center box 100%> | <WRAP center box 100%> | ||
- | < | + | ==== Allow QEMU/KVM Commands for personal user: ==== |
- | # lsmod | grep kvm | + | |
- | </code> | + | |
- | <sxh bash; gutter: false> | + | If you want to allow your login user (non-root) to run virsh command or other KVM/QEMU commands, or use these commands without sudo, (needed by cockpit) then add your login user to the libvirt group as follows: |
- | kvm_intel | + | |
- | kvm | + | |
- | </ | + | |
- | </ | + | |
- | Stimmt die Ausgabe mit der oben aufgelisteten Ausgabe in etwa überein, so sollte nun schon alles parat sein zum Virtualisierungen. | ||
- | |||
- | <WRAP center round tip 100%> | ||
- | '' | ||
- | Falls Redhat 7 oder CentOS 7 als minimal Installation installiert wurde, so fehlt nun noch das sogenannte x-window Pakage, welches jedoch zum anzeigen des Virt-managers unumgänglich ist. Zum nachinstallieren folgenden Befehl ausführen:'' | ||
< | < | ||
- | # yum install "@X Window System" | + | # usermod |
</ | </ | ||
</ | </ | ||
- | |||
- | |||
- | ===== Vorbereitungen zu starten des Virt-Managers ===== | ||
- | Befindet man sich auf einem Server mit GUI und arbeitet auch direkt auf diesem, so kann man ganz einfach via Konsole den **virt-manager** aufrufen und das Programm wird gestartet. | ||
- | |||
- | Ist man jedoch so wie ich, per **Putty** von einem **Windows System** aus verbunden, so wird dies nicht ganz so einfach funktionieren. Es muss nämlich hierzu zuerst noch ein spezielles Programm Namens: " | ||
- | auf dem Windows System installiert werden. **Xming** erlaubt es Grafikdarstellungen welche via SSH gesendet werden in Windows als eigenes Fenster Remote darzustellen. So können wir also dann später auch ganz einfach nur den **virt-manager** per Putty aufrufen und es sollte dann die besagte Konsole öffnen. | ||
<WRAP center box 100%> | <WRAP center box 100%> | ||
- | ==== Xming Installation ==== | + | ==== Setup own VM-Storage |
- | | + | |
- | | + | |
- | - ''< | + | |
- | - '' | + | |
- | - '' | + | |
- | + | ||
- | ''< | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | ===== Starten des Virt Managers ===== | + | |
- | Virt Manager is a graphical tool through which we can install and manage virtual machines. To start the virt manager type the '**virt-manager**' command from the terminal. | + | **Create needed directories**: |
< | < | ||
- | # virt-manager | + | # mkdir -p / |
+ | # mkdir / | ||
</ | </ | ||
- | {{: | + | ---- |
+ | **Make the virsh pool configuration changes**: | ||
- | ===== Configure Bridge Interface ===== | + | - Listing current pools: < |
- | Before Start creating VMs , let’s first create the bridge interface. Bridge interface is required if you want to access virtual machines from outside of your hypervisor network. | + | |
- | < | + | Name |
- | # cd /etc/sysconfig/network-scripts/ | + | ------------------------------------------- |
- | # cp ifcfg-eno49 ifcfg-br0 | + | default |
- | </ | + | </ |
+ | - '' | ||
+ | - '' | ||
+ | - '' | ||
+ | - '' | ||
+ | | ||
+ | - '' | ||
+ | Name | ||
+ | ------------------------------------------- | ||
+ | default | ||
+ | </sxh> | ||
- | < | + | From now, when creating virtual machines, Virtual Machine Manager will inform you that the *.img file (virtual disk of your VM), will be saved at ''/ |
- | **Edit** the **Interface file** and set followings: | + | </WRAP> |
- | < | + | ===== Installing Cockpit Web Interface in CentOS 8 ===== |
- | # vim ifcfg-eno49 | + | |
- | </ | + | |
- | * '' | + | Although, KVM commandline-tools are quite sufficient for managing a Virtualization environment. But, we can also use the CentOS 8 native Web UI i.e. Cockpit to manage virtual machines via a graphical interface. |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | </ | + | We are installing Cockpit using dnf command. To add support of managing virtual machines, we have to install cockpit-machines package as well. |
- | <WRAP center round box 100%> | ||
- | **Edit** the **Bridge file (ifcfg-br0)** and set the followings: | ||
+ | <WRAP center box 100%> | ||
< | < | ||
- | # vim ifcfg-br0 | + | # dnf install |
</ | </ | ||
- | * '' | + | <sxh bash; gutter: false;> |
- | | + | ... |
- | | + | ================================================================================ |
- | | + | Installing: |
- | | + | |
- | * '' | + | |
- | * '' | + | Installing dependencies: |
- | * '' | + | |
- | + | | |
- | <wrap em> | + | |
+ | python3-cairo | ||
+ | python3-gobject | ||
+ | python3-systemd | ||
+ | | ||
+ | checkpolicy | ||
+ | | ||
+ | cockpit-system | ||
+ | | ||
+ | gdk-pixbuf2 | ||
+ | | ||
+ | gsettings-desktop-schemas | ||
+ | ... | ||
+ | </sxh> | ||
</ | </ | ||
- | |||
- | Restart the network Service to enable the bridge interface. | ||
- | |||
- | < | ||
- | # systemctl restart network | ||
- | </ | ||
- | |||
- | Check the Bridge interface configuration, | ||
- | |||
- | < | ||
- | # ip addr show br0 | ||
- | </ | ||
- | |||
- | |||
- | ===== Start Creating Virtual Machines. ===== | ||
- | Create Virtual Machine either from the command line using ' | ||
<WRAP center box 100%> | <WRAP center box 100%> | ||
- | '' | + | Enable |
- | + | ||
- | - Start the “virt-manager” | + | |
- | - Go to the File Option, click on '' | + | |
- | - We will be using ISO file as installation media. In the next step Specify the path of ISO file.{{: | + | |
- | - Click on Forward. And specify the Compute Resources : RAM and CPU as per your setup. {{: | + | |
- | - Click on Forward to proceed further. Then specify the storage Size of Virtual Machine, In my case I am using 25G.{{: | + | |
- | - In the Next step Specify the Name of Virtual Machine and select network as **Bridge br0**{{: | + | |
- | - Click on Finish to start the installation. {{: | + | |
- | + | ||
- | ''< | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | + | ||
- | ===== Creating a virtual Machine from Command Line: ===== | + | |
- | + | ||
- | Virtual Machines can be created from the console as well using the '' | + | |
< | < | ||
- | # virt-install | + | # systemctl enable |
</ | </ | ||
- | The above **virt-install** command consitst of following options | + | <sxh bash; gutter: false;> |
+ | Created symlink / | ||
+ | </ | ||
- | * '' | + | '' |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | + | ||
- | + | ||
- | Open now the Virt Viewer //(on Windows)// and follow the instruction to complete the installation. | + | |
- | + | ||
- | {{: | + | |
- | + | ||
- | Follow the instruction now and complete the installation. | + | |
- | + | ||
- | Once the Installation is completed we can access the Virtual Machine console from ‘virt-manager‘ as shown below. | + | |
- | + | ||
- | {{: | + | |
- | + | ||
- | That’s it, basic installation and configuration of KVM hypervisor is completed. | + | |
- | + | ||
- | + | ||
- | <WRAP center box 100%> | + | |
- | ===== KVM Manageing (web-Based): | + | |
- | Solutions to manage and supervise virtual machines over a WebGUI. | + | |
- | + | ||
- | <WRAP center round tip 100%> | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
</ | </ | ||
+ | Browse URL https:// | ||
- | '' | + | The Cockpit uses a self-signed SSL certificate, therefore, you may see a Security warning. |
- | * https:// | + | Ignore the Security warning and continue to the website. |
- | * https://www.proxmox.com/ | + | |
- | </ | + | |
- | ===== Redhat Dokumentation zum Thema ===== | ||
- | |||
- | <WRAP center round download 80%> | ||
- | '' | ||
- | </ | ||