Changes between Initial Version and Version 1 of Csle2022/Agenda/virtualization


Ignore:
Timestamp:
Oct 20, 2022, 11:23:07 AM (2 years ago)
Author:
admin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Csle2022/Agenda/virtualization

    v1 v1  
     1= KVM Installation =
     2
     3KVM, (kernel-based Virtual Machine) is a free and opensource virtualization platform for the Linux kernel. When installed on a Linux system, it becomes a Type-2 hypervisor.
     4
     5Here we look at how to install KVM on Ubuntu 20.04 LTS.
     6
     7First update the Ubuntu package repository.
     8
     9Before installing KVM on Ubuntu, we are first going to verify if the hardware supports KVM. A minimum requirement for installing KVM is the availability of CPU virtualization extensions such as AMD-V and Intel-VT.
     10
     11To check whether the Ubuntu system supports virtualization, run the following command.
     12
     13{{{
     14egrep -c '(vmx|svm)' /proc/cpuinfo
     15}}}
     16
     17An outcome greater than 0 implies that virtualization is supported
     18
     19To check if your system supports KVM virtualization execute the command
     20{{{
     21sudo apt install cpu-checker
     22sudo kvm-ok
     23}}}
     24
     25With the confirmation that our system can support KVM virtualization, we are going to install KVM, To install KVM, virt-manager, bridge-utils and other dependencies, run the command
     26
     27{{{
     28apt install -y qemu qemu-kvm libvirt-daemon libvirt-clients virt-manager bridge-utils
     29}}}
     30
     31Before proceeding further, we need to confirm that the virtualization daemon – libvritd-daemon – is running. To do so, execute the command
     32
     33{{{
     34sudo systemctl status libvirtd
     35systemctl enable --now libvirtd
     36}}}
     37
     38Check if KVM modules are loaded,
     39{{{
     40lsmod | grep -i kvm
     41}}}
     42
     43[[Image(https://ws.learn.ac.lk/raw-attachment/wiki/Csle2022/Agenda/databaseandweb/web1.png)]]
     44
     45To view available Guest os variants,
     46
     47{{{
     48apt install libosinfo-bin
     49osinfo-query os
     50}}}
     51
     52= Creating a Virtual Machine =
     53
     54sudo virt-install --name perfsonar --os-variant centos7.0 --vcpus 4 --ram 16384 --cdrom /home/lg/downloads/pS-Toolkit-4.4.4-CentOS7-FullInstall-x86_64-2022Apr04.iso --network bridge=virbr0,model=virtio --graphics vnc,listen=0.0.0.0 --noautoconsole --disk size=100