Unlike their Type-2 counterparts, Type-1 hypervisors aren’t held back by the host OS, making them perfect when you want to run some virtual machines at their full potential. Besides providing high performance in your virtualization tasks, bare metal hypervisors also allow you to interface PCIe devices to your VMs.
If you’re familiar with ESXi and want an enterprise-grade alternative to Broadcom’s overpriced hypervisor, the Xen-based XCP-ng might be up your alley – and here’s everything you need to know before you get started with the open-source virtualization platform.
VirtualBox vs VMware Workstation Pro: Which Type-2 hypervisor should you use?
Can Workstation Pro dethrone VirtualBox and become the king of free hypervisors?
What you’ll need
Rather than installing it as an app on an existing OS, XCP-ng requires you to dedicate an entire machine to it. While you can technically run it inside another virtual machine as part of a nested virtualization setup, a clean installation of XCP-ng directly on your PC hardware will net the best results, and that’s precisely what we’re aiming for in this article.
To keep things easy, we’ll use Xen Orchestra to access the XCP-ng host from the web UI running on another PC over the same LAN connection. As such, you’ll need Ethernet connectivity on both the host machine and the secondary PC. Lastly, you’ll need a USB drive with at least 2GB storage capacity to create a bootable XCP-ng disk.
Kingston DataTraveler Kyson USB Drive
Creating a bootable USB drive
Once you’ve gathered all the necessary items, it’s time to write the XCP-ng ISO file onto a USB drive. We’ll go with the ol’ reliable Rufus app, but you’re welcome to use Balena Etcher, Ventoy, or another flashing tool.
- Download the latest ISO file of XCP-ng from the official website.
- Head to the Rufus website and download the portable version of the tool.
- Run the rufus.exe file with admin privileges.
- Inside Rufus, select your USB drive as the Device.
- Press the Select button under Boot selection and choose the XCP-ng ISO.
- Hit the Start button, agree to overwrite the contents of the USB drive, and wait for Rufus to finish writing the files to the USB drive.
Switching the Boot options in the BIOS
And enabling certain virtualization settings
Since you’re going to install XCP-ng as a bare-metal platform, you’ll have to modify the BIOS settings to force the PC to boot from the external USB drive. Now’s also a good time to enable SVM, IOMMU, and a handful of other settings in the BIOS. While the overall process varies depending on the motherboard manufacturer, here’s a general outline of the entire process:
- Plug the bootable USB drive into the PC where you plan to install XCP-ng before powering it on and mashing the Del key as it boots up.
- Inside the BIOS settings, head to the Boot settings menu.
- Set the USB drive containing the flashed files as Boot Option #1.
- Next, navigate to the Advanced CPU Settings/Tweaker tab.
- Switch the Virtualization setting to Enabled. Depending on your mobo, this setting may be called SVM mode, VT-x, or AMD-V.
- Likewise, look for the IOMMU setting inside the Miscellanous settings tab and enable it if you want to configure PCI passthrough in the future.
- Save the changes before exiting the BIOS menu
Installing XCP-ng on the host machine
When the PC boots up, you’ll find yourself on the XCP-ng installation screen. The overall procedure is fairly straightforward, but here’s a breakdown of all the steps:
- Choose your preferred keyboard layout under the Keymap settings page. Be sure to hit the OK button after each step.
- Tap OK on the Welcome screen.
- Accept the EULA when prompted by the installer.
- Pick the Primary Disk for your XCP-ng server.
- Select the drive where you plan to store the Virtual Machine data.
- Since you’re using a USB drive for the setup process, choose Local media as the Installation source.
- Press OK when the setup wizard asks you to verify the installation source.
- Set a Password for your XCP-ng host machine.
- If you have multiple network interfaces on the host system, pick the one you wish to relegate to XCP-ng.
- Select Automatic configuration (DHCP) under Networking if you want XCP-ng to auto-set up the network settings for the system. Alternatively, you can configure a static IP address by manually entering the IPv4 address, Subnet mask, and Gateway options.
- Enter the hostname and DNS settings for the XCP-ng PC.
- Select the Time zone and pick the Manual time entry option when XCP-ng asks you to select a method for calculating the local time.
- Finally, tap the Install XCP-ng button.
- Pick No when XCP-ng asks you to install supplimental packs and reboot the system to finish setting up the virtualization platform on your PC.
Accessing the XCP-ng web UI
With XCP-ng freshly installed on your PC, you’re free to provision VMs for your projects. However, the UI can be a handful with its unintuitive menus. Thankfully, you can access the XCP-ng host using a web UI from another device. To do so,
- Switch to your other system and download the PuTTY client.
- Install PuTTY and run its .exe file as an administrator.
- Type the IP address of your XCP-ng host machine and press the Open button.
- Click on Accept when PuTTY displays the Security alert pop-up window.
- Enter root as the Username followed by whatever Password you set in the previous section.
-
Execute the following command in the terminal:
bash -c "$(wget -qO- https://xoa.io/deploy)"
- Tap Enter twice and open the IP address for the XOA virtual machine using your favorite web browser.
- Type admin@admin.net as the Username and admin as the Password to log into the Xen Orchestra web UI.
Setting up a virtual machine on XCP-ng
Of course, this tutorial would be incomplete if we didn’t go over the procedure to set up VMs on XCP-ng. But first, you’ll need to add the host to the web UI and configure the Storage drive for your ISO files.
- Click on the Add Server option on the XCP-ng dashboard.
- Type a Name for your XCP-ng node and enter the IP address, Username, and Password before tapping the Connect button.
- Press the exclamation mark next to the node and choose OK to accept the self-signed certificate for the XCP-ng server.
- Next, click on the Storage option inside the New tab.
- Pick your newly added XCP-ng server under the host option, and choose the Name, Description, and Type for the storage. For now, you can keep things simple by going with Local type under the ISO SR section.
- Enter /media as the path and click on the Create button.
At last, it’s time to deploy your first VM on XCP-ng.
- Navigate to the Disk page inside the Import tab and select the storage pool you configured in the previous section.
- Drop the ISO files of your favorite operating systems and distros into UI, and tap Import.
- Head to the VM section inside New and pick the primary Storage pool of your XCP-ng server.
- Select Other install media inside the Template option, and grant a Name and Description to your VM.
- Modify the vCPU and RAM options per your needs and leave the Network settings be.
- Toggle the radio button next to ISO/DVD and pick the ISO file you uploaded earlier.
- Press Add disk and allocate some GBs to the VM from the main storage pool.
- Hit the Create button.
Building a highly-scalable VM server using XCP-ng
If you've followed all the steps properly, XCP-ng will create your virtual machine. You can access the newly deployed VM from the Console tab. And with that, you’re free to embark on your virtualization journey with XCP-ng.
For those still on the fence about this virtualization platform, there are a couple of pros (and cons) to building your home lab with XCP-ng. While the installation process is somewhat cumbersome, XCP-ng is perfect for deploying Windows virtual machines. Plus, PCI passthrough is extremely simple on this open-source platform.
How to enable PCI passthrough in Proxmox?
If you're willing to go the extra mile, you can even configure your Proxmox VMs to harness the superior computing prowess of your GPU!
That said, XCP-ng is still designed for enterprise-grade virtualization tasks, so it might not fit your home lab projects. Since it doesn’t support containerization natively, you’ll have to deploy a virtual machine just to run a container or two. So, if you’re into hobbyist projects and aren’t interested in a business-tier production environment, Proxmox might be the better alternative.
