Tuesday, May 14, 2024

Setup KVM Hypervisor on SparkyLinux 2024.05

Virt-manager still appears to be the most powerful tool in regards of deployment and managment of KVM guests. Current version in Debian SID is 1:4.1.0-4. The presence of Web Cockpit Console is a nice way to manage KVM guest's via clicking the button "Launch remote viewer"  built into Cockpit Web Console. Bridge attached to external network interface was also created utilizing network management section inside Web Console and provides an alternative for guests attachment via NAT.  

Install KVM

 $ sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system 
                bridge-utils virtinst libvirt-daemon virt-manager -y 
 $ sudo virsh net-start default
 $ sudo virsh net-autostart default                    
 $ sudo modprobe vhost_net 
 $ lsmod | grep vhost
 $ echo vhost_net | sudo tee -a /etc/modules
 $ sudo usermod -a -G libvirt  $(whoami)
 $ sudo reboot

boris@boris-spaky2405:~$ neofetch
           .            `-:-`                  --------------------- 
          .o`       .-///-`                    OS: SparkyLinux 8 (Seven-Sisters) x86_64 
         `oo`    .:/++:.                       Host: KVM/QEMU (Standard PC (Q35 + ICH9, 2009) pc-q35-8.2) 
         os+`  -/+++:` ``.........```          Kernel: 6.9.0-sparky8-amd64 
        /ys+`./+++/-.-::::::----......``       Uptime: 1 min 
       `syyo`++o+--::::-::/+++/-``             Packages: 2474 (dpkg) 
       -yyy+.+o+`:/:-:sdmmmmmmmmdy+-`          Shell: bash 5.2.21 
::-`   :yyy/-oo.-+/`ymho++++++oyhdmdy/`        Resolution: 1280x800 
`/yy+-`.syyo`+o..o--h..osyhhddhs+//osyy/`      Terminal: /dev/pts/1 
  -ydhs+-oyy/.+o.-: ` `  :/::+ydhy+```-os-     CPU: AMD Ryzen 7 3700X (8) @ 3.599GHz 
   .sdddy::syo--/:.     `.:dy+-ohhho    ./:    GPU: 00:01.0 Red Hat, Inc. Virtio 1.0 GPU 
     :yddds/:+oo+//:-`- /+ +hy+.shhy:     ``   Memory: 906MiB / 15631MiB 
        `./ossyyyyo+:-/oo:.osso- .oys                                  
       ``..-------::////.-oooo/   :so                                  
    `...----::::::::--.`/oooo:    .o:
           ```````     ++o+:`     `:`
                     ./+/-`        `

boris@boris-spaky2405:~$ dpkg -l | grep virt-manager
ii  virt-manager                                             1:4.1.0-4                                all          desktop application for managing virtual machines
boris@boris-spaky2405:~$ dpkg -l | grep virtinst
ii  virtinst                                                 1:4.1.0-4                                all          utilities to create and edit virtual machines
boris@boris-spaky2405:~$ sudo virsh --connect qemu:///system
[sudo] password for boris: 
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh # version
Compiled against library: libvirt 10.2.0
Using library: libvirt 10.2.0
Using API: QEMU 10.2.0
Running hypervisor: QEMU 8.2.3

Install Web Cockpit Console
 $  sudo apt install cockpit cockpit-machines
 $  sudo systemctl start cockpit.socket

 Update of /usr/lib/systemd/system/cockpit.service is still required  two lines below are supposed to be added to *.service file :


 $  sudo systemctl enable cockpit.socket

 Tuning firewall
 $  sudo apt install firewalld
 $  sudo firewall-cmd --add-service=cockpit --permanent
 $  sudo firewall-cmd --reload

Virt-manager 1:4.1.0-4 was submitted to SID on 05/14/2024

No comments:

Post a Comment