Skip to content

Installing in a Virtual Machine

KDE Linux only ships a .raw image and requires UEFI firmware. As such, getting it to run in a VM may be a different experience than you might be accustomed to. Here are instructions for common VM software:

Oracle VirtualBox

  1. Download the latest .raw image.
  2. Convert the raw file to a VMDK image:
# On Linux & UNIX systems
VBoxManage convertfromraw kde-linux_*.raw kdelinux.vmdk --format VMDK
# On Windows systems using powershell
& 'C:\Program Files\Oracle\VirtualBox\VBoxManage.exe' convertfromraw (Get-ChildItem kde-linux_*.raw).FullName kdelinux2.vmdk --format VMDK
  1. Click the New button in the toolbar to create a new virtual machine.
  2. Select your desired VM Name and VM Folder.
  3. For OS, choose Linux.
  4. For OS Distribution, choose ArchLinux.
  5. For OS Version, choose Arch Linux (64-bit).
  6. Click Next and enter the Specify virtual hardware section.
  7. Choose CPU count (minimum 2, ideally 4+) and memory (minimum 2 GB, ideally 4+).
  8. Set the disk size to at least 15 GB, ideally more than 20.
  9. Click Next to review the summary, then Finish.
  10. With the new virtual machine selected, click Settings.
  11. Click Expert at the top to switch to Expert Mode.
  12. In the System section, enable the UEFI Feature by ticking the checkbox. Don't forget this step. Without UEFI enabled, the VMDK image will not boot!
  13. In the Storage section, select Controller: SATA and click the Add Hard Disk icon to the right.
  14. In the Hard Disk Selector window, click Add in the toolbar and select the kdelinux.vmdk file you created at the start.
  15. After you've added it to the Hard Disk Selector, click Choose to attach it.
  16. Click OK to save and close the settings. You can now start the virtual machine and install KDE Linux.

Virtual Machine Manager (virt-manager)

  1. Download the latest .raw image.
  2. File > New Virtual Machine > Import existing disk image. Click the Forward button.
  3. In Provide the existing storage path: > Browse, find raw file that you downloaded. Click the Choose Volume button.
  4. In Choose the operating system you are installing: write Arch Linux. Click the Forward button.
  5. In Choose Memory and CPU settings:, choose CPU count (minimum 2, ideally 4+) and memory (minimum 2 GB, ideally 4+). Click the Forward button.
  6. Enable the checkbox Customize configuration before install. Click the Finish button.
  7. The configuration window for the new VM is opened. In Overview > Details > Firmware: select UEFI.
  8. On the bottom left, click the button Add Hardware.
  9. Add a storage disk of some reasonable size. E.g. Storage > Details tab > select the radio button Create a disk image for the virtual machine and set the disk size to at least 15 GB, ideally more than 20.Click the Finish button.
  10. In the top left of the window, click the Begin Installation button. The VM will start.

If it shows an error message saying Unable to connect to libvirt qemu:///system error, run:

# On Debian-based operating systems
sudo systemctl enable --now libvirtd.service

# On other operating systems
sudo systemctl enable --now libvirt.service

If the VM fails to boot and shows the error No bootable option or device found.. Click Enter; this will start the UEFI user interface. Disable Secure Boot from the UEFI user interface: Device Manager > Secure Boot Configuration > Attempt Secure Boot, disable the checkbox by pressing the Space key. Click Enter to close the message box Configuration changed. Press F10 to save, then y. Press the Escape key twice and select Reset.

Install the operating system to the second virtual disk, that means, in the KDE Linux Installer wizard, page Partitions, from the Select storage device: combo box select vdb - 20 GiB. After installing the OS is done, shut down the VM.

VirtIO Disk 1 contains the raw file that you have downloaded.

Edit the VM configuration, right click on VirtIO Disk 1 > Remove Hardware (decide if you want to also delete the raw file that you have downloaded), Delete.

Now, VirtIO Disk 1 is the only virtual storage of the VM and contains the BTRFS storage where you have installed the KDE Linux operating system. Start the VM.

To connect to KDE Linux using SSH, you can enable the sshd systemd service:

sudo systemctl enable --now sshd

QEMU

You can boot the raw file in a QEMU virtual machine:

qemu-system-x86_64 -enable-kvm -m 4G -smp 4 \
  -drive if=pflash,format=raw,readonly=on,file=/usr/share/OVMF/OVMF_CODE_4M.fd \
  -drive format=raw,file=kde-linux.raw

XCP-ng

  1. Download the latest .raw image.
  2. In Xen Orchestra, select Import > Disk, choose a storage (not ISO) repository to hold the .raw file, drop the .raw file on the target, and upload it by selecting the Import button.
  3. Select New > VM and choose the desired host pool.
  4. Under Info, set Template to Generic Linux UEFI and enter a name.
  5. Under Performance, choose CPU count (minimum 2, ideally 4+) and memory (minimum 2 GB, ideally 4+).
  6. Under Install Settings, select PXE (neither PXE nor ISO boot options will be used, but the form requires selecting one of the two).
  7. If no network interface is listed, select Add Interface to ensure that the VM has a network connection.
  8. Under Disks, select the storage repository where the VM's virtual disk should be stored, and adjust the size to a reasonable amount (a minimum of 15 GiB is required).
  9. Under Advanced, select Show Advanced Settings and uncheck Boot VM after creation.
  10. Select Create to finalize creation of the VM.
  11. With the new VM's page showing in Xen Orchestra, select the Disk tab and select Attach Disk.
  12. Select the .raw image from the drop down directly beneath the New Disk and Attach Disk buttons, check Read Only, then select Attach.
  13. Select the Advanced tab, and under Boot Order, drag Hard Disk to the top and click Save.
  14. Select the Console tab and start the VM.
  15. Install KDE Linux using the Install System wizard in the live environment, then after the installation is completed, shut down the operating system to cleanly power off the VM.
  16. Return to the Disks tab and use the Remove VDI from this VM icon button on the .raw file to remove the installation media from the VM.
  17. The KDE Linux VM is now ready for use.

UTM

TODO: rewrite https://invent.kde.org/kde-linux/kde-linux/-/issues/295#note_1302368 here in a simpler form


Article contributed by under the CC-BY-4.0 license.