Linux install KVM virtual machine

路易港
中文

Install in Archlinux

sudo pacman -Sy qemu libvirt ebtables dnsmasq bridge-utils virt-manager
  • kvm is responsible for the virtualization of CPU and memory
  • qemu simulates hardware to Guest OS (for example, CPU, network card, disk, etc.)
  • ovmf enables UEFI support for virtual machines
  • libvirt provides tools and APIs for managing virtual machines and other virtualization functions
  • virt-manager is a GUI for managing virtual machines

Open libvirt service

sudo systemctl enable libvirtd
sudo systemctl start libvirtd

Add the current user to the KVM user group

sudo usermod -a -G kvm $USER

Reference:

Install in Ubuntu

Check if the CPU supports virtualization

egrep -c '(vmx|svm)' /proc/cpuinfo

Check if the system supports kvm acceleration

sudo kvm-ok

Install CPU Checker

sudo apt install cpu-checker

Start installing KVM after restarting the computer

sudo apt update
sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils

Add the currently logged in user to the group named libvirt and KVM.

sudo adduser `id -un` libvirt

View which groups the currently logged in user is a member of

sudo grep `id -un` /etc/group

Verify installation

sudo virsh list --all

Check running status

sudo systemctl status libvirtd

Install KVM GUI management tool (Server does not need)

sudo apt install virt-manager

problem

The default network card is not started:

sudo virsh net-start default
sudo virsh net-autostart default

The article was first published on my blog: https://b.catch-e.space/2021/10/21/linux-install-kvm/

阅读 1.2k

技术分享
温故而知新,可以为师矣。

温故而知新。

643 声望
13 粉丝
0 条评论

温故而知新。

643 声望
13 粉丝
文章目录
宣传栏