From 5fe7a015a0dc5f4cc0645e808a9522af289480f9 Mon Sep 17 00:00:00 2001 From: Nathan Steel Date: Fri, 14 Apr 2023 17:18:50 -0400 Subject: [PATCH] Update and correct KVM setup guide --- guides/setup-qemu-kvm.html | 54 +++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/guides/setup-qemu-kvm.html b/guides/setup-qemu-kvm.html index 32df243..1aa97fb 100644 --- a/guides/setup-qemu-kvm.html +++ b/guides/setup-qemu-kvm.html @@ -10,13 +10,13 @@ - Setup KVM/QEMU virtualisation + Setup QEMU/KVM virtualisation
Jump directly to main content -

Setup KVM/QEMU virtualisation

+

Setup QEMU/KVM virtualisation


@@ -33,8 +33,54 @@
-

This is an intro, you gotta believe me

-

Heading

+

Virtualisation is the act of creating a virtualised computer (guest), inside another computer (the host) by sharing the hardware. This allows a single host the ability to run all your services, whilst keeping a level of SoC.

+ +

Enable in the BIOS

+

To run virtual machines, certain flags in the bios need to be set. If you don't want to bring down an existing server to check, then check the next section first.

+
    +
  • Reboot your PC
  • +
  • At the BIOS splashscreen, press your motherboard's prefered key (typically ESC, F3, or F12).
  • +
  • Find and enable the virtualisation setting(s). +
      +
    • One of VT-x, AMD-V, SVM, or Vanderpool.
    • +
    • One of Intel VT-d, or AMD IOMMU (if available)
    • +
    +
  • +
+ +

Check Virtualisation is enabled

+

Double check to make sure your server can be used for virtualisation, if you've enabled it in the BIOS it should be good. Just run one of the following command

+
lscpu | grep 'Virtualization'
+
grep -E --color '(vmx|svm)' /proc/cpuinfo
+ +

Install the packages

+

The easiest part, just copy and paste the below to install the required packages.

+
sudo apt install qemu-kvm libvirt-clients libvirt-daemon libvirt-daemon-system virtinst
+ +

Sessions

+

There are two different session types for VMs, user, and system sessions. If you are using a desktop, and intend to virtualise other desktop OSs I recommend user sessions. If you're setting up a server hypervisor, then use System sessions.

+ +

User Session

+

A user session VM is what I recommend for personal PCs, laptops, etc. as it's the best option for desktop virtualisation (e.g. a Kali install for l33t hackers).

+ +

Add user to group

+
sudo adduser $USER libvirt
+ +

Enable default network

+

Check the name of your default network (typically just 'default').

+
sudo virsh net-list --all
+

Enable the network.

+
sudo virsh net-start default
+

(Optionally) Set it to turn on with system boot.

+
sudo virsh net-autostart default
+ +

System Session

+

For now all that's needed to know is that you run sudo before any virsh commands, and that the VMs will launch with root permissions.

+ +

Extra

+

Setup bridge adapter for KVM

+

Optimisations for KVM Virtual Machines

+