Update and correct KVM setup guide

master^2
Nathan Steel 3 years ago
parent b1ee9c8abc
commit 5fe7a015a0

@ -10,13 +10,13 @@
<meta name="theme-color" content="black">
<link rel="stylesheet" type="text/css" href="/main.css">
<link rel="icon" type="image/png" href="/images/favicon.svg">
<title>Setup KVM/QEMU virtualisation</title>
<title>Setup QEMU/KVM virtualisation</title>
</head>
<body>
<header>
<a href="#main" class="vh">Jump directly to main content</a>
<h1>Setup KVM/QEMU virtualisation</h1>
<h1>Setup QEMU/KVM virtualisation</h1>
<input id="burger-toggle" type="checkbox"/>
<label class="burger-container" for="burger-toggle"><div class="burger"></div><span class="sr">Burger menu</span></label>
<hr/>
@ -33,8 +33,54 @@
<main id="main">
<section>
<p class="intro">This is an intro, you gotta believe me</p>
<h2>Heading</h2>
<p class="intro">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 <a href="/guides/vm-seperation-of-concerns">SoC</a>.</p>
<h2>Enable in the BIOS</h2>
<p>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.</p>
<ul>
<li>Reboot your PC</li>
<li>At the BIOS splashscreen, press your motherboard's prefered key (typically <kbd>ESC</kbd>, <kbd>F3</kbd>, or <kbd>F12</kbd>).</li>
<li>Find and enable the virtualisation setting(s).
<ul>
<li>One of VT-x, AMD-V, SVM, or Vanderpool.</li>
<li>One of Intel VT-d, or AMD IOMMU (if available)</li>
</ul>
</li>
</ul>
<h2>Check Virtualisation is enabled</h2>
<p>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</p>
<pre><code>lscpu | grep 'Virtualization'</code></pre>
<pre><code>grep -E --color '(vmx|svm)' /proc/cpuinfo</code></pre>
<h2>Install the packages</h2>
<p>The easiest part, just copy and paste the below to install the required packages.</p>
<pre><code>sudo apt install qemu-kvm libvirt-clients libvirt-daemon libvirt-daemon-system virtinst</code></pre>
<h2>Sessions</h2>
<p>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.</p>
<h3>User Session</h3>
<p>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).</p>
<h4>Add user to group</h4>
<pre><code>sudo adduser $USER libvirt</code></pre>
<h4>Enable default network</h4>
<p>Check the name of your default network (typically just 'default').</p>
<pre><code>sudo virsh net-list --all</code></pre>
<p>Enable the network.</p>
<pre><code>sudo virsh net-start default</code></pre>
<p>(Optionally) Set it to turn on with system boot.</p>
<pre><code>sudo virsh net-autostart default</code></pre>
<h3>System Session</h3>
<p>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.</p>
<h2>Extra</h2>
<p><a href="/guides/setup-kvm-bridge.html">Setup bridge adapter for KVM</a></p>
<p><a href="/guides/kvm-optimisation.html">Optimisations for KVM Virtual Machines</a></p>
</section>
</main>

Loading…
Cancel
Save