How to Install KVM on Ubuntu 24.04 Step-by-Step

preview_player
Показать описание
In this video tutorial, we will cover how to install KVM (Kernel-based Virtual Machine) on Ubuntu 24.04 LTS system and demonstrate creating a virtual machine using the virt-manager application.

########## KVM Installation Steps on Ubuntu 24.04 ##############

1) Package Apt Repository Packages Index

sudo apt update

2) Check if Virtualization is enabled

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

Install the cpu-checker package
sudo apt install -y cpu-checker

Another way to check if KVM virtualization is enabled

kvm-ok

3) Install KVM on Ubuntu 24.04

sudo apt install -y qemu-kvm virt-manager libvirt-daemon-system virtinst libvirt-clients bridge-utils

4) Enable and start virtualization daemon

sudo systemctl enable --now libvirtd
sudo systemctl start libvirtd

Check virtualization daemon is running
sudo systemctl status libvirtd

5) Add Your Local User to the KVM and Libvirt Group

sudo usermod -aG kvm $USER
sudo usermod -aG libvirt $USER

6) Create Network Bridge using netplan

Create a file with following content

network:
version: 2
renderer: NetworkManager
ethernets:
ens33:
dhcp4: false
dhcp6: false

bridges:
br0:
interfaces: [ens33]
dhcp4: false
addresses: [192.168.2.120/24]

routes:
- to: default
via: 192.168.2.1
metric: 100
nameservers:
addresses: [8.8.8.8]

save and close the file.

sudo chmod 600 /etc/netplan/*.yaml

Now, run following command to apply above network changes

sudo netplan apply

7) Launch KVM Virt-Manager and Create Virtual Machines

#howto #kvm #virtualization #ubuntu

If you have found this tutorial informative and useful, kindly do subscribe our channel and like the video.

######################################
Thank you for Watching!!
######################################
Рекомендации по теме
Комментарии
Автор

Man you're saviour 😊😊😊 really thanka for your sharing your knowledge. I have been struggling for years 😮😮😮 for this really appreciate

AbdirashidHussein-ijiu
Автор

The tutorial was excellent but I ended up having a problem when I tried to ping the ip address of the guest machine from the host machine. Ping came as "4 packets transmitted, 0 received, 100% packet loss, time 3073ms".Have no idea how to fix problem. Your explainations were great and easy to understand.

jbcollins
Автор

Thank you for very nice tutorial. What if I want to install macOS Sonoma instead?

sparklstf
Автор

hi, thank you for sharing how to configure kvm! I am using a laptop with wireless card only, no ethernet card could you show how to configure the bridge for computers with wireless only?

leon_-vvun
Автор

the only problem i had is it doesn't show [ens33] in IP addr instead of it there is enp2s0

nabalrai
Автор

apsolutly not able to install on 24.04.1 - it always says if i want to create a new VM "Error:No active Connection for this Installation" - so whats wrong.

ManfredWagner-yv
Автор

I don't think "apt update" installs the updates @1:37, think you need to run 'apt upgrade' to actually update the binaries. now the prompt is left at "can be upgraded" .. not "have been upgraded". Lovely tone in your video, nice work. Actually i am wrong in the above... but it is good to run the upgrade command right after install.

mindwis
Автор

nice .. can you install opnsense with this method ?

abdoelqayyum
Автор

how to enable virtualization in ubuntu 24.04? like I tried the rebooting one but it didn't worked

-maseerafatima
Автор

hi~
i followed everything in this video, and at first it seems everything is working fine but after a few mins. i no longer have internet connection, can you me help me with this one .

voidd..
Автор

Hi at minute 8:27 of your video the lower part of the terminal says "Lines 1-22/22 (END) message which blocks my terminal and I am unable to remove it. Can you please tell me how you got rid of it to continue, as I am unable to proceed from there. thanks

sonofman
Автор

I just did this with the help of your guide last night. Instead of using a HDD image file i had a free SSD in my pc which i want to give to VM. I saw that it can be done by providing /dev/-devicename- in the vm device setup. And it works, and should be faster. However sometimes index name of that device changes after reboot. For example nvme1n1 become 2n1 or something stupid like that.
Is there anything i can do to prevent this, because then my VM will not boot, since it is looking for a disk under the previous name.

jaqen_hgar