<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ Shamsuddoha Ranju - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ Shamsuddoha Ranju - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Sun, 24 May 2026 22:24:00 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/author/sdranju/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How to Turn Ubuntu 24.04 into a KVM Hypervisor – Quick Setup with Web Management ]]>
                </title>
                <description>
                    <![CDATA[ Virtualization lets you run multiple operating systems on one machine. It’s perfect for testing apps, hosting servers, or learning DevOps. A hypervisor is the software that lets you run multiple virtual machines on a single physical machine, and the ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/turn-ubuntu-2404-into-a-kvm-hypervisor/</link>
                <guid isPermaLink="false">680fa285102a9fb019d4fa34</guid>
                
                    <category>
                        <![CDATA[ KVM ]]>
                    </category>
                
                    <category>
                        <![CDATA[ hypervisor ]]>
                    </category>
                
                    <category>
                        <![CDATA[ virtualization ]]>
                    </category>
                
                    <category>
                        <![CDATA[ virtual machine ]]>
                    </category>
                
                    <category>
                        <![CDATA[ vm ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Shamsuddoha Ranju ]]>
                </dc:creator>
                <pubDate>Mon, 28 Apr 2025 15:45:09 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1745591647377/613d9a44-cc2b-45b7-b1d1-5fc3154b9623.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Virtualization lets you run multiple operating systems on one machine. It’s perfect for testing apps, hosting servers, or learning DevOps.</p>
<p>A hypervisor is the software that lets you run multiple virtual machines on a single physical machine, and the Kernel-based Virtual Machine (KVM) is one of the best. Built into Linux, KVM is fast (near-native performance), open-source (free!), and flexible (supports Windows, Linux, and more). It’s trusted by both cloud providers and homelabbers for its stability and low overhead.</p>
<p>If you want to turn your Ubuntu 24.04 or Kubuntu 24.04 (Kubuntu is a Ubuntu variant with KDE Plasma desktop) system into a powerful hypervisor without <strong>Proxmox</strong>’s complexity, this guide is for you. With KVM, you’ll spin up virtual machines (VMs) in minutes, and with Cockpit’s web-based manager, you’ll control them from your browser.</p>
<p>In this tutorial, you’ll transform an Ubuntu 24.04 or Kubuntu 24.04 Desktop or Server – fresh or existing – into a KVM hypervisor. You’ll set up the backend (KVM, QEMU, libvirt), add Cockpit for web-based VM management, and create a guest VM to test it all. Whether you’re a coder, homelabber, or IT enthusiast, this guide is beginner-friendly.</p>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<ul>
<li><p><a class="post-section-overview" href="#heading-before-you-start-what-you-should-know">Before You Start: What You Should Know</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-what-youll-need">What You’ll Need</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-why-kvm-on-ubuntukubuntu-2404">Why KVM on Ubuntu/Kubuntu 24.04?</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-1-check-virtualization-support">Step 1: Check Virtualization Support</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-2-install-kvm-and-backend-tools">Step 2: Install KVM and Backend Tools</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-3-set-up-a-network-bridge">Step 3: Set Up a Network Bridge</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-4-install-cockpit-for-web-management">Step 4: Install Cockpit for Web Management</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-5-create-a-guest-vm">Step 5: Create a Guest VM</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-6-run-and-test-your-guest-vm">Step 6: Run and Test Your Guest VM</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-keep-exploring-your-hypervisor">Keep Exploring Your Hypervisor</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-wrapping-up">Wrapping Up</a></p>
</li>
</ul>
<h2 id="heading-before-you-start-what-you-should-know">Before You Start: What You Should Know</h2>
<p>This guide is designed for virtualization newcomers, but you’ll need a few basic skills:</p>
<ul>
<li><p>Running terminal commands like <code>sudo apt install</code> or <code>nano</code> and so on.</p>
</li>
<li><p>Basic Linux navigation (for example, editing files in <code>/etc</code>).</p>
</li>
<li><p>Basic networking knowledge, such as understanding network interfaces (for example, <code>enp4s0</code> or <code>wlp3s0</code>), IP addresses, and concepts like bridging or NAT. You’ll use tools like <code>ip link</code> or <code>nmcli</code> to set up a network bridge in Step 3.</p>
</li>
<li><p>Optional: Experience with VMs helps but isn’t required – I’ll explain everything.</p>
</li>
</ul>
<p>No worries if terms like “libvirt” sound new. I’ll break them down as we go.</p>
<h2 id="heading-what-youll-need">What You’ll Need</h2>
<ul>
<li><p><strong>A computer</strong>: Running Ubuntu 24.04 or Kubuntu 24.04 Desktop or Server (fresh or existing). Minimum: 4GB RAM, 20GB storage, CPU with virtualization support (Intel VT-x or AMD-V). More RAM/storage for multiple VMs.</p>
</li>
<li><p><strong>Internet access</strong>: To download packages and VM ISOs.</p>
</li>
<li><p><strong>A web browser</strong>: Firefox (default on Ubuntu) or Chrome to access Cockpit.</p>
</li>
<li><p><strong>An ISO image</strong>: An ISO image for your guest VM (for example, Ubuntu 24.04 Desktop ISO from ubuntu.com or Windows ISO if you have it already).</p>
</li>
<li><p><strong>30–45 minutes</strong>: Depending on your setup speed.</p>
</li>
</ul>
<h2 id="heading-why-kvm-on-ubuntukubuntu-2404">Why KVM on Ubuntu/Kubuntu 24.04?</h2>
<p>KVM turns your Linux kernel into a hypervisor, letting you run VMs with near-native speed. Paired with QEMU (for hardware emulation) and libvirt (for management), it’s a lightweight alternative to <strong>Proxmox</strong> or <strong>VMware</strong>. Its strengths include:</p>
<ul>
<li><p><strong>Performance</strong>: Runs VMs efficiently, ideal for homelabs or dev environments.</p>
</li>
<li><p><strong>Free and Open-Source</strong>: No licenses, just like Ubuntu/Kubuntu, and so on.</p>
</li>
<li><p><strong>Flexibility</strong>: Supports diverse guest OSs (Linux, Windows, BSD).</p>
</li>
<li><p><strong>Integration</strong>: Cockpit’s web UI makes VM management a breeze, no CLI required.</p>
</li>
</ul>
<p>Here’s what each tool does:</p>
<ul>
<li><p><strong>KVM</strong>: A Linux kernel module that turns your system into a hypervisor, enabling VMs to run with near-native performance by leveraging CPU virtualization features (for example, Intel VT-x).</p>
</li>
<li><p><strong>QEMU</strong>: A powerful emulator that provides the virtual hardware (for example, CPU, disk, network) for your VMs, working with KVM for fast execution.</p>
</li>
<li><p><strong>libvirt</strong>: A management layer that simplifies VM creation, networking, and storage, offering tools like <code>virsh</code> and APIs for automation.</p>
</li>
<li><p><strong>Cockpit</strong>: A web-based interface for managing VMs, system resources, and networks, perfect for beginners who want a visual dashboard.</p>
</li>
</ul>
<p>Ubuntu 24.04 (“Noble Numbat”) brings the latest kernel and tools, ensuring top-notch KVM compatibility. Let’s build your hypervisor!</p>
<h2 id="heading-step-1-check-virtualization-support">Step 1: Check Virtualization Support</h2>
<p>First, you’ll want to confirm that your CPU supports virtualization (most modern ones do). To do that, open a terminal (like Konsole on Kubuntu) and run:</p>
<pre><code class="lang-bash">lscpu | grep Virtualization
</code></pre>
<p>Look for "VT-x" (Intel) or "AMD-V" (AMD). If present, you’re good!</p>
<p>If nothing shows, check your BIOS/UEFI:</p>
<ul>
<li><p>Reboot, enter BIOS (usually <code>F2</code>, <code>Del</code>, or <code>Esc</code>).</p>
</li>
<li><p>Enable "Intel VT-x" or "AMD-V" under CPU settings.</p>
</li>
<li><p>Save and reboot.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1745226012162/337e2324-50b3-4bd9-b040-01c2ac919e7c.png" alt="Konsole terminal on Kubuntu displaying ‘lscpu | grep Virtualization’ output confirming VT-x support for KVM." class="image--center mx-auto" width="911" height="508" loading="lazy"></p>
<h2 id="heading-step-2-install-kvm-and-backend-tools">Step 2: Install KVM and Backend Tools</h2>
<p>Let’s install KVM, QEMU, and libvirt. These will form the backbone of your hypervisor:</p>
<p>Start by updating your system (you may need to restart your computer after the update):</p>
<pre><code class="lang-bash">sudo apt update &amp;&amp; sudo apt upgrade -y
</code></pre>
<p>Then install the virtualization packages:</p>
<pre><code class="lang-bash">sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils -y
</code></pre>
<ul>
<li><p><code>qemu-kvm</code>: Emulates hardware for VMs.</p>
</li>
<li><p><code>libvirt-daemon-system</code>: Manages VMs.</p>
</li>
<li><p><code>libvirt-clients</code>: CLI tools like <code>virsh</code> for hypervisor management.</p>
</li>
<li><p><code>bridge-utils</code>: For network bridging.</p>
</li>
</ul>
<p>Next, verify that KVM is loaded:</p>
<pre><code class="lang-bash">lsmod | grep kvm
</code></pre>
<p>You’ll see “kvm_intel” or “kvm_amd” if successful.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1745226199517/a146d89d-2894-4bbc-b241-11a8ed385758.png" alt="Konsole terminal on Kubuntu displaying ‘lsmod | grep kvm’ output showing kvm_intel module loaded for KVM." class="image--center mx-auto" width="911" height="508" loading="lazy"></p>
<p>Finally, add your (current) user to the <code>libvirt</code> group for permission:</p>
<pre><code class="lang-bash">sudo usermod -aG libvirt <span class="hljs-variable">$USER</span>
</code></pre>
<p>Log out and back in to apply these changes.</p>
<h2 id="heading-step-3-set-up-a-network-bridge">Step 3: Set Up a Network Bridge</h2>
<p>VMs need network access, so you’ll create a bridge (<code>br0</code>) to connect them to your physical network. This allows VMs to act like devices on your network (bridged networking).</p>
<p>Ubuntu 24.04 and Kubuntu 24.04 Desktop typically use NetworkManager, while Ubuntu Server may use Netplan. We’ll prioritize the NetworkManager approach, with Netplan as an alternative.</p>
<p><strong>Note</strong>: Installing libvirt (Step 2) creates a default bridge called <code>virbr0</code> for NAT-based networking, which isolates VMs from the physical network (IPs like <code>192.168.122.x</code>). For direct network access (IPs like <code>192.168.0.x</code>), use <code>br0</code> as described below, and select it in Step 5’s VM setup.</p>
<p>You can verify whether your system is using NetworkManager or Netplan. Open a console and run <code>systemctl status NetworkManager</code>. If you see the status active and running, go with NetworkManager.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1745305149513/0926f09c-1748-484f-af4c-37dcb82d06a5.png" alt="Konsole terminal on Kubuntu displaying ‘systemctl status NetworkManager’ output confirming NetworkManager status." class="image--center mx-auto" width="911" height="508" loading="lazy"></p>
<h3 id="heading-option-1-networkmanager-recommended-for-kubuntuubuntu-desktop">Option 1: NetworkManager (Recommended for Kubuntu/Ubuntu desktop)</h3>
<p>Check your network interface:</p>
<pre><code class="lang-bash">ip link
</code></pre>
<p>Example: <code>enp4s0</code>. Replace <code>enp4s0</code> below if yours differs.</p>
<p>First, find your Ethernet connection name:</p>
<pre><code class="lang-bash">nmcli connection show
</code></pre>
<p>Look for the <strong>NAME</strong> column where <strong>DEVICE</strong> is <code>enp4s0</code> (for example, “Wired connection 1” or “Ethernet connection”). Note this name. Ignore <code>virbr0</code>, which is libvirt’s default NAT bridge.</p>
<p>Then create a bridge named <code>br0</code>:</p>
<pre><code class="lang-bash">sudo nmcli connection add <span class="hljs-built_in">type</span> bridge ifname br0 con-name bridge-br0
</code></pre>
<p>Enslave your interface to the bridge:</p>
<pre><code class="lang-bash">sudo nmcli connection add <span class="hljs-built_in">type</span> ethernet ifname enp4s0 master br0 con-name bridge-slave-enp4s0
</code></pre>
<p>Disable the old connection (replace with your connection name identified earlier):</p>
<pre><code class="lang-bash">sudo nmcli connection down <span class="hljs-string">"Wired connection 1"</span>
sudo nmcli connection delete <span class="hljs-string">"Wired connection 1"</span>
</code></pre>
<p>Enable DHCP on the bridge:</p>
<pre><code class="lang-bash">sudo nmcli connection modify bridge-br0 ipv4.method auto
</code></pre>
<p>Activate the bridge:</p>
<pre><code class="lang-bash">sudo nmcli connection up bridge-br0
</code></pre>
<p>Verify:</p>
<pre><code class="lang-bash">ip addr show br0
nmcli connection show
</code></pre>
<p>Now you’ll want to ensure <code>br0</code> is active, <code>enp4s0</code> is enslaved, and <code>virbr0</code> is separate. First, test the internet with <code>ping 8.8.8.8</code>.</p>
<p>Then you need to define <code>br0</code> in libvirt (to appear in Cockpit’s VM network dropdown). To do this, create <code>br0.xml</code> in your home directory:</p>
<pre><code class="lang-bash">nano ~/br0.xml
</code></pre>
<p>Then add the following:</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">network</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">name</span>&gt;</span>br0<span class="hljs-tag">&lt;/<span class="hljs-name">name</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">forward</span> <span class="hljs-attr">mode</span>=<span class="hljs-string">'bridge'</span>/&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">bridge</span> <span class="hljs-attr">name</span>=<span class="hljs-string">'br0'</span>/&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">network</span>&gt;</span>
</code></pre>
<p>Save and exit (<code>Ctrl+O</code>, <code>Enter</code>, <code>Ctrl+X</code>).</p>
<p>Now define and start the following:</p>
<pre><code class="lang-bash">sudo virsh net-define ~/br0.xml
sudo virsh net-start br0
sudo virsh net-autostart br0
</code></pre>
<p>Verify like this:</p>
<pre><code class="lang-bash">virsh net-list --all
</code></pre>
<p>You can now delete <code>~/br0.xml</code> after defining, as libvirt stores it in <code>/etc/libvirt/qemu/networks/</code>.</p>
<pre><code class="lang-bash">rm ~/br0.xml
</code></pre>
<h3 id="heading-option-2-netplan-for-ubuntu-server-or-if-preferred">Option 2: Netplan (For Ubuntu Server or If Preferred)</h3>
<p>If you see <code>renderer: networkd</code> in <code>/etc/netplan/???.yaml</code> or prefer Netplan, follow these steps.</p>
<p>First, check your interface:</p>
<pre><code class="lang-bash">ip link
</code></pre>
<p>Example: <code>enp4s0</code>.</p>
<p>Next, edit the Netplan config like so:</p>
<pre><code class="lang-bash">sudo nano /etc/netplan/01-netcfg.yaml
</code></pre>
<p>Use the following:</p>
<pre><code class="lang-yaml"><span class="hljs-attr">network:</span>
  <span class="hljs-attr">version:</span> <span class="hljs-number">2</span>
  <span class="hljs-attr">renderer:</span> <span class="hljs-string">networkd</span>
  <span class="hljs-attr">ethernets:</span>
    <span class="hljs-attr">enp4s0:</span>
      <span class="hljs-attr">dhcp4:</span> <span class="hljs-literal">no</span>
  <span class="hljs-attr">bridges:</span>
    <span class="hljs-attr">br0:</span>
      <span class="hljs-attr">interfaces:</span> [<span class="hljs-string">enp4s0</span>]
      <span class="hljs-attr">dhcp4:</span> <span class="hljs-literal">yes</span>
</code></pre>
<p>Save and exit (<code>Ctrl+O</code>, <code>Enter</code>, <code>Ctrl+X</code>).</p>
<p>Now, set strict permissions to avoid errors:</p>
<pre><code class="lang-bash">sudo chmod 600 /etc/netplan/01-netcfg.yaml
</code></pre>
<p>And apply:</p>
<pre><code class="lang-bash">sudo netplan apply
</code></pre>
<p>Now verify:</p>
<pre><code class="lang-bash">ip addr show br0
</code></pre>
<p>Test the internet with <code>ping 8.8.8.8</code> (from console).</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1745227201229/35988335-5ff1-49bc-9809-e9c08d6798c4.png" alt="Konsole terminal on Kubuntu displaying ‘nmcli connection show’ output with bridge-br0 active, enp4s0 enslaved, and virbr0 present for KVM networking." class="image--center mx-auto" width="911" height="508" loading="lazy"></p>
<p><strong>Troubleshooting</strong>:</p>
<ul>
<li><p><strong>Permissions error</strong>: If Netplan complains about “too open” permissions, recheck <code>sudo chmod 600 /etc/netplan/01-netcfg.yaml</code>.</p>
</li>
<li><p><strong>NetworkManager conflict</strong>: If using Netplan, ensure <code>/etc/netplan/01-network-manager-all.yaml</code> is backed up or deleted (<code>sudo mv /etc/netplan/01-network-manager-all.yaml /etc/netplan/01-network-manager-all.yaml.bak</code>).</p>
</li>
<li><p><strong>No onternet</strong>: Restart NetworkManager (<code>sudo systemctl restart NetworkManager</code>) or reboot.</p>
</li>
<li><p><strong>Wrong bridge</strong>: If a VM uses <code>virbr0</code> (NAT, <code>192.168.122.x</code>), recheck Step 5’s network setting and select <code>br0</code>.</p>
</li>
<li><p><strong>br0 missing in Cockpit</strong>: Define <code>br0</code> in libvirt (step 9 above) or ensure <code>br0</code> is active (<code>ip addr show br0</code>).</p>
</li>
</ul>
<h2 id="heading-step-4-install-cockpit-for-web-management">Step 4: Install Cockpit for Web Management</h2>
<p>Cockpit provides a slick web UI to manage VMs. Let’s go ahead and set it up.</p>
<p>First, you’ll need to install Cockpit and its VM plugin:</p>
<pre><code class="lang-bash">sudo apt install cockpit cockpit-machines -y
</code></pre>
<p>Then you can start and enable Cockpit:</p>
<pre><code class="lang-bash">sudo systemctl <span class="hljs-built_in">enable</span> --now cockpit.socket
systemctl status cockpit.socket
</code></pre>
<p>Now open your browser (for example, Firefox on Ubuntu) and visit:</p>
<pre><code class="lang-plaintext">https://localhost:9090
</code></pre>
<p>Or use your KVM server’s IP (for example, <code>https://192.168.0.100:9090</code>) if remote. Log in with your username and password. Ignore the self-signed certificate warning.</p>
<p>Allow Cockpit’s port if you’re using a firewall:</p>
<pre><code class="lang-bash">sudo ufw allow 9090
</code></pre>
<p>You’ll see Cockpit’s dashboard. Turn on administrative access by clicking on “<strong>Turn on administrative access</strong>”. Then, click “<strong>Virtual Machines</strong>” to manage VMs.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1745227293385/96291774-d4cf-4de2-9392-3947ade4bb8b.png" alt="Firefox on Kubuntu displaying Cockpit login page at https://localhost:9090 for web-based VM management." class="image--center mx-auto" width="1920" height="1036" loading="lazy"></p>
<h2 id="heading-step-5-create-a-guest-vm">Step 5: Create a Guest VM</h2>
<p>Let’s create a guest VM using Cockpit. We’ll use an Ubuntu 24.04 Desktop ISO as an example:</p>
<p>To start, download the Ubuntu 24.04 Desktop ISO from ubuntu.com and save it (for example, <code>/home/ranju/Downloads/ubuntu-24.04.1-desktop-amd64.iso</code>).</p>
<p>In Cockpit, go to “Virtual Machines” and click “Create VM”. Here are the specs:</p>
<ul>
<li><p><strong>Name</strong>: TestVM</p>
</li>
<li><p><strong>Installation Type</strong>: Local install media (or your desired installation type)</p>
</li>
<li><p><strong>Installation Source</strong>: Browse to your ISO (for example, <code>/home/ranju/Downloads/ubuntu-24.04.1-desktop-amd64.iso</code>).</p>
</li>
<li><p><strong>OS</strong>: Select “Ubuntu 24.04” (usually Cockpit auto-detects).</p>
</li>
<li><p><strong>Storage</strong>: Create new qcow2 volume (preferred). <em>Note: disk is created in</em> <code>/var/lib/libvirt/images/</code><em>.</em></p>
</li>
<li><p><strong>Storage limit</strong>: 20GB (adjust as needed).</p>
</li>
<li><p><strong>Memory</strong>: 4GB (adjust as needed).</p>
</li>
</ul>
<p>Click “Create and Edit”. Cockpit opens an advanced dialog where there are options for customization (for example, CPU, Network Interfaces and Boot order, and so on). Make sure that <code>br0</code> has been selected as interface source. Finally, click “<strong>Install</strong>”.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1745228999671/4d80faf7-d8f8-4395-985e-298b4add426c.png" alt="Cockpit web interface in Firefox on Kubuntu showing the Create VM dialog with TestVM settings." class="image--center mx-auto" width="1920" height="1036" loading="lazy"></p>
<p>In Cockpit’s VM console, follow the installer to set up the guest OS (username, password, and so on).</p>
<p><strong>Troubleshooting</strong>:</p>
<ul>
<li><p><strong>Permissions error</strong>: If you have permission error for the ISO, then copy the ISO to the default temp folder (<code>/tmp/</code>) and locate the ISO from there.</p>
<pre><code class="lang-bash">  cp /home/ranju/Downloads/ubuntu-24.04.1.iso /tmp/
</code></pre>
</li>
</ul>
<h2 id="heading-step-6-run-and-test-your-guest-vm">Step 6: Run and Test Your Guest VM</h2>
<p>Your VM is running! Let’s test it:</p>
<ol>
<li><p>In Cockpit, under “Virtual Machines,” click TestVM. You’ll see its console (a live view of the VM’s screen).</p>
</li>
<li><p>Log into the guest Ubuntu using the credentials you set.</p>
</li>
<li><p>Test networking:</p>
<ul>
<li><p>Open a terminal in the VM (via Cockpit’s console).</p>
</li>
<li><p>Run <code>ip addr</code> in the console to confirm a physical network IP (for example, <code>192.168.0.x</code> with <code>br0</code>, not <code>192.168.122.x</code> with <code>virbr0</code>).</p>
</li>
<li><p>Run <code>ping 8.8.8.8</code> to confirm internet access.</p>
</li>
</ul>
</li>
<li><p>Experiment: Open a browser in the VM, visit a website, or install apps to simulate real use.</p>
</li>
</ol>
<p>If the VM boots and connects to your network, your KVM hypervisor is rocking! You can stop, restart, or delete it from Cockpit.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1745307664700/ed54d452-4979-4468-a7fe-1dd538844e25.png" alt="Cockpit web interface in Firefox on Kubuntu displaying the TestVM console with Ubuntu 24.04 desktop." class="image--center mx-auto" width="1920" height="1036" loading="lazy"></p>
<h2 id="heading-keep-exploring-your-hypervisor">Keep Exploring Your Hypervisor</h2>
<p>You’ve turned your Ubuntu 24.04 into a KVM hypervisor – congrats! Try these next steps:</p>
<ul>
<li><p><strong>Add more VMs</strong>: Create Windows or other Linux VMs using different ISOs.</p>
</li>
<li><p><strong>Use virt-manager</strong>: Install virt-manager for a desktop-based alternative to Cockpit (<code>sudo apt install virt-manager</code>).</p>
</li>
<li><p><strong>Back up VMs</strong>: Export VM disks with <code>virsh</code> for safety.</p>
</li>
<li><p><strong>Scale up</strong>: Add storage or RAM for heavier workloads, like my Proxmox cluster guide.</p>
</li>
</ul>
<p>Check your VMs anytime via CLI:</p>
<pre><code class="lang-bash">virsh list --all
</code></pre>
<h2 id="heading-wrapping-up">Wrapping Up</h2>
<p>You’ve built a fast, free KVM hypervisor on Ubuntu 24.04, complete with Cockpit’s web UI and a running guest VM. It’s a perfect playground for coding, testing, or homelab fun.</p>
<p>Share your ideas or comments with me – I’d love to hear them!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Set Up a Proxmox Cluster for Free – Virtualization Basics ]]>
                </title>
                <description>
                    <![CDATA[ Virtualization is a game-changer for developers, hobbyists, and IT enthusiasts. It lets you run multiple operating systems on one machine, which is perfect for testing apps, hosting servers, or learning new tech. If you want to take it further, clust... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/set-up-a-proxmox-cluster-virtualization-basics/</link>
                <guid isPermaLink="false">67fd1282e4687cd6aa7dcd1e</guid>
                
                    <category>
                        <![CDATA[ proxmox ]]>
                    </category>
                
                    <category>
                        <![CDATA[ clustering ]]>
                    </category>
                
                    <category>
                        <![CDATA[ virtualization ]]>
                    </category>
                
                    <category>
                        <![CDATA[ KVM ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Shamsuddoha Ranju ]]>
                </dc:creator>
                <pubDate>Mon, 14 Apr 2025 13:49:54 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1744488492225/62339e66-50ae-4546-8845-f5c86c415511.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Virtualization is a game-changer for developers, hobbyists, and IT enthusiasts. It lets you run multiple operating systems on one machine, which is perfect for testing apps, hosting servers, or learning new tech. If you want to take it further, clustering ties multiple machines together for more power and flexibility. And you can use Proxmox Virtual Environment (VE) to build a cluster for free – no expensive licenses required.</p>
<p>In this tutorial, you’ll set up a 3-node Proxmox cluster using three computers (or virtual machines for practice). By the end, you’ll have a working cluster ready to host virtual machines (VMs) and experiment with cool features like guest migration and VM replication etc.</p>
<p>Let’s dive in!</p>
<h2 id="heading-prerequisites-what-youll-need-to-know">Prerequisites: What You’ll Need to Know</h2>
<p>This guide is beginner-friendly for clustering, but you’ll need some basic skills to follow along. You should be comfortable with:</p>
<ul>
<li><p>Installing an OS from a USB drive (don’t worry, I’ll walk you through the steps).</p>
</li>
<li><p>Using a terminal for simple commands like <code>ping</code> or <code>nano</code>.</p>
</li>
<li><p>Setting up a home network with static IPs (for example, knowing your router’s IP range). No advanced virtualization or clustering experience is required—I’ll explain the key concepts as we go.</p>
</li>
</ul>
<h2 id="heading-what-youll-need">What You’ll Need</h2>
<ul>
<li><p><strong>Three computers (or VMs):</strong> Start with at least 8GB RAM and 100GB storage per machine, plus a virtualization-capable CPU (most modern ones work). These specs are a baseline—actual RAM and storage depend on how many VMs you want to host (e.g., more VMs need more resources).</p>
</li>
<li><p><strong>Proxmox VE:</strong> Free and open-source. Grab the ISO from <a target="_blank" href="http://proxmox.com">proxmox.com</a>.</p>
</li>
<li><p><strong>Network connection:</strong> All three must be on the same network and be able to ping each other.</p>
</li>
<li><p><strong>A web browser:</strong> For Proxmox’s web interface.</p>
</li>
<li><p><strong>30–60 minutes</strong>: Depending on your setup pace.</p>
</li>
</ul>
<h2 id="heading-why-proxmox-and-clustering">Why Proxmox and Clustering?</h2>
<p>Proxmox VE is a free, open-source virtualization platform built on Debian Linux. It uses KVM for VMs (fully virtualized systems) and LXC for containers (lightweight app environments), all managed via a slick web interface.</p>
<p>Clustering means linking multiple Proxmox machines—called nodes—so they act as one system. Think of it like a team: each node shares the workload, and you control them from a single dashboard. This setup lets you move (migrate) VMs between nodes, boost reliability, and experiment with high availability (HA)—where VMs auto-restart (on healthy node) if a node fails.</p>
<p>Plus, Proxmox offers a handy replication feature: it can sync VM data between nodes automatically, keeping backups ready if something goes wrong.</p>
<p>It’s a must-have skill for DevOps, app testing, or IT tinkering.</p>
<h2 id="heading-2-nodes-vs-3-nodes-which-should-you-choose">2 Nodes vs. 3 Nodes: Which Should You Choose?</h2>
<p>Before we build your 3-node cluster, let’s explore your options. Clustering can start with 2 nodes or go to 3 (or more). Here’s why you might pick one over the other:</p>
<ul>
<li><p><strong>2-Node Cluster</strong>:</p>
<ul>
<li><p><strong>Pros</strong>: Easier setup with just two machines. Great for learning basics or small projects. Uses less hardware.</p>
</li>
<li><p><strong>Cons</strong>: No quorum—a voting majority to keep the cluster running if a node fails—so HA isn’t reliable. You’d need an extra trick (like a quorum device) to avoid stalling.</p>
</li>
<li><p><strong>Best For</strong>: Learning, Testing clustering, or limited resources.</p>
</li>
</ul>
</li>
<li><p><strong>3-Node Cluster</strong>:</p>
<ul>
<li><p><strong>Pros</strong>: Built-in quorum—two out of three nodes keep things going if one crashes. Ideal for HA practice. More stable and scalable.</p>
</li>
<li><p><strong>Cons</strong>: Needs an extra machine and a bit more setup time.</p>
</li>
<li><p><strong>Best For</strong>: Serious learners or small production setups.</p>
</li>
</ul>
</li>
</ul>
<p>We’ll go with 3 nodes—it’s the sweet spot for stability and real-world skills.</p>
<h2 id="heading-step-1-install-proxmox-ve-on-all-three-machines">Step 1: Install Proxmox VE on All Three Machines</h2>
<p>First, download the Proxmox VE ISO from <a target="_blank" href="http://proxmox.com">proxmox.com</a>. Make a bootable USB with Rufus (Windows), <code>dd</code> (Linux/macOS), or Raspberry Pi Imager (available for all platforms).</p>
<p>For <code>dd</code>, use this command (replace placeholders with your ISO and USB device):</p>
<pre><code class="lang-plaintext">sudo dd if=proxmox-ve.iso of=/dev/sdX bs=1M status=progress oflag=sync
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1744492694669/777f8642-67dd-4f5f-8e78-b98c0d77ccca.png" alt="Proxmox VE installer screen showing target disk for storage configuration." class="image--center mx-auto" width="1336" height="832" loading="lazy"></p>
<p>Boot each machine from the USB and follow the installer. Stick with the default partitioning scheme (it uses EXT4 filesystem) and set static IPs and hostnames as follows (or you can use your own IPs knowing your router’s IP range):</p>
<ul>
<li><p>Node 1: <code>172.20.1.101</code> [hostname: <code>node01.local</code>]</p>
</li>
<li><p>Node 2: <code>172.20.1.102</code> [hostname: <code>node02.local</code>]</p>
</li>
<li><p>Node 3: <code>172.20.1.103</code> [hostname: <code>node03.local</code>]</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1744491592723/4b793ada-e21a-4da1-92f1-dd05ad130980.png" alt="Proxmox VE installer screen showing network configuration with hostname and IP entered for Node 1." class="image--center mx-auto" width="1336" height="835" loading="lazy"></p>
<p>After installation, each node displays its IP on the console (for example, <a target="_blank" href="https://192.168.10.101:8006">https://172.20.1.101:8006</a>). Test it by opening a browser, visiting each IP, and logging in with root and your password. You’ll see the Proxmox dashboard.</p>
<h2 id="heading-step-2-prepare-your-nodes">Step 2: Prepare Your Nodes</h2>
<p>Now, let’s get your nodes ready to talk to each other—a crucial step for clustering. Without this, they won’t recognize each other properly.</p>
<p>Update <code>/etc/hosts</code> on all three nodes to map IPs to hostnames (since we’re not using a DNS server). Open the file with:</p>
<p><code>nano /etc/hosts</code></p>
<p>Add these lines (IPs and hostnames) on each node:</p>
<pre><code class="lang-plaintext">172.20.1.101 node01.local node01
172.20.1.102 node02.local node02
172.20.1.103 node03.local node03
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1744492087833/bb9cb873-f107-4fcd-b53f-25408531975e.png" alt="Terminal window displaying /etc/hosts file in nano editor with IP and hostname entries for three Proxmox nodes." class="image--center mx-auto" width="1319" height="704" loading="lazy"></p>
<p>Save and exit (<code>Ctrl+O</code>, <code>Enter</code>, <code>Ctrl+X</code>). This ensures nodes can resolve each other’s names (for example, node01 pings node02.local).</p>
<p>Next, check connectivity. From Node 1’s console (or SSH), ping the others:</p>
<p><code>ping 172.20.1.102</code></p>
<p><code>ping 172.20.1.103</code></p>
<p>Repeat from Node 2 and Node 3. If pings fail, check your network or firewall.</p>
<p>Finally, sync their clocks—clusters need precise time to coordinate. On each node, run:</p>
<p><code>ntpdate pool.ntp.org</code></p>
<p>All three nodes are now primed for clustering.</p>
<h2 id="heading-step-3-create-the-cluster-on-node-1">Step 3: Create the Cluster on Node 1</h2>
<p>Let’s set up the cluster starting with Node 1. Log into its web interface at <a target="_blank" href="https://192.168.10.101:8006">https://172.20.1.101:8006</a>. On the left sidebar, click Datacenter, then Cluster. Hit the Create Cluster button, and a dialog pops up. Name your cluster—let’s call it <strong>MyCluster</strong> and click Create. A task window will appear, showing the process. Wait a few seconds until you see “TASK OK”—that means your cluster is live and Node 1 is its first member. Now we can add the other nodes!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1744493528337/b5fb8aa1-e9b6-4028-b129-10d2c665f1b5.png" alt="Proxmox web interface showing the Create Cluster dialog with ‘MyCluster’ entered." class="image--center mx-auto" width="1321" height="705" loading="lazy"></p>
<h2 id="heading-step-4-join-node-2-and-node-3-to-the-cluster">Step 4: Join Node 2 and Node 3 to the Cluster</h2>
<p>With the cluster created, let’s bring in Node 2 and Node 3. On Node 1’s cluster page, click Join Information, then Copy Information—this copies a key you’ll need.</p>
<p>Open Node 2’s web interface (<a target="_blank" href="https://192.168.10.102:8006">https://172.20.1.102:8006</a>), go to Datacenter &gt; Cluster &gt; Join Cluster, paste the key into the Information field, enter Node 1’s root password, and click Join <strong>MyCluster</strong>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1744494140010/d1f60b51-480c-44f1-84a1-bb37f79b6bc7.png" alt="Proxmox web interface showing the Join Cluster dialog with ‘join information’ entered." class="image--center mx-auto" width="1315" height="702" loading="lazy"></p>
<p>Repeat this process on Node 3’s interface (<a target="_blank" href="https://192.168.10.103:8006">https://172.20.1.103:8006</a>). Refresh Node 1’s dashboard—under Datacenter, you’ll see all three nodes with green checkmarks.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1744495739410/4ce5c263-318d-4a21-94f4-324d30b0fc94.png" alt="Proxmox web interface displaying the Datacenter view with three nodes (node01, node02, node03) showing green status icons." class="image--center mx-auto" width="1317" height="707" loading="lazy"></p>
<p>Your 3-node cluster is up!</p>
<h2 id="heading-step-5-test-your-cluster">Step 5: Test Your Cluster</h2>
<p>Let’s verify it works by creating and moving a test VM. On Node 1, click Create VM, name it TestVM, skip the ISO, and finish with defaults (no disk content needed). Hit the Start button to boot it up.</p>
<p>Now, let’s migrate it around—migration means moving the VM from one node to another to test your cluster’s flexibility. Right-click TestVM, select Migrate, choose Node 2, and click Migrate. The VM stops briefly, copies to Node 2, and restarts (normal without shared storage).</p>
<p>Repeat this, migrating it from Node 2 to Node 3. If it hops between nodes successfully, your cluster’s rocking! With three nodes, you’ve got quorum—try shutting down Node 3 to see the others stay active.</p>
<h2 id="heading-whats-next">What’s Next?</h2>
<p>You’ve built a 3-node Proxmox cluster for free—congrats! Take it further with:</p>
<ul>
<li><p><strong>Shared storage</strong>: Add NFS or a spare drive for live VM migration (no stopping/shutdown needed).</p>
</li>
<li><p><strong>High Availability</strong>: Enable HA—VMs auto-restart on a healthy node if one fails.</p>
</li>
<li><p><strong>VM Replication:</strong> Configure Replication—Sync VM data between nodes automatically, keeping backups ready if something goes wrong.</p>
</li>
<li><p><strong>Scale up</strong>: Add more nodes or try LXC containers.</p>
</li>
</ul>
<p>Check your cluster’s health anytime (from console) with:</p>
<p><code>pvecm status</code></p>
<h2 id="heading-wrapping-up">Wrapping Up</h2>
<p>You’ve just set up a 3-node Proxmox cluster at no cost. It’s a playground for virtualization, DevOps practice, or even hosting small projects. Share your thoughts with me – I’d love to hear how you liked it.</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
