Thomrl's Blog

Setting Up Virtualisation on Linux

This is a page about »Setting Up Virtualisation on Linux«.

Life is busy, and it’s been a while since I set this up. If I remember correctly the libvirtd part is what worked for me getting QEMU/KVM and Virtual Machine Manager up and running. Although https://wiki.cachyos.org/virtualization/qemu_and_vmm_setup/ is what I will start out with when I set this up on CachyOS again.


Tables of content:

Libvirtd, Qemu and Virtual Machines Manager
CachyOS Qemu and vmm setup
vmware


Libvirtd, Qemu and Virtual Machine Manager

Check if either the libvirt or libvirtd group exist:
sudo getent group | grep libvirt

sudo getent group | grep libvirtd

If not, create one of them: sudo groupadd --system libvirt

Add the user you are currently logged into to the libvirt group

sudo usermod -a -G libvirt $(whoami)
newgrp libvirt`

If you need to add another user, replace $(whoami) with that username.

Confirm that the user has been added to the group

id $(whoami) or groups make sure libvirt or libvirtd is seen in the output

Edit libvirtd configuration file

First open libvirtd.conf with a text editor
sudo nvim /etc/libvirt/libvirtd.conf
Replace nvim with your tetxteditor of choice

Find the unix_sock_group line and uncomment it to define domain socket group ownership for libvirtd, (around line 85)

unix_sock_group = "libvirt"

Also assign UNIX socket permissions for the socket – we are setting R/W (around line 102)

unix_sock_rw_perms = "0770"

When done with the changes restart libvirtd service.

sudo systemctl restart libvirtd

Confirm service status:

systemctl status libvirtd

sudo systemctl enable libvirtd


CachyOS Qemu and vmm setup

sudo pacman -S qemu-full virt-manager swtpm
echo 'firewall_backend = "iptables"' | sudo tee -a /etc/libvirt/network.conf
systemctl enable --now libvirtd.service
systemctl enable --now libvirtd.socket
sudo virsh net-autostart default

Source for the commands in this codeblock: https://wiki.cachyos.org/virtualization/qemu_and_vmm_setup/


vmware

paru -S linux-cachyos-headers
paru -S gcc14
paru -S vmware-keymaps --overwrite '*'
paru -S vmware-workstation --overwrite '*'
sudo systemctl start vmware-networks.service
sudo chmod a+rw /dev/vmnet0

References I used while setting up virtualisation on my freshly installed machine with CachyOS:

https://computingforgeeks.com/use-virt-manager-as-non-root-user/
https://wiki.cachyos.org/virtualization/qemu_and_vmm_setup/
https://knowledge.broadcom.com/external/article?legacyId=287
https://www.youtube.com/watch?v=OT-QNHL7KOw
https://knowledge.broadcom.com/external/article/324542/troubleshooting-virtual-machine-network.html

#CachyOS #Linux #Reinstall #Software #Terminal #Tips