Jump to content

KDE Linux/installing on a virtual machine

From KDE Community Wiki

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:

Virtualbox

https://stackoverflow.com/a/11755376

TODO: step-by-step instructions

virt-manager

  1. Download the latest .raw image
  2. File > New Virtual Machine > Import existing disk image
  3. [Forward]
  4. In "Provide the existing storage path:" > Browse, select from disk the raw file that you have downloaded. Press the "Choose Volume" button.
  5. In "Choose the operating system you are installing:" write "Arch Linux".
  6. [Forward]
  7. In "Choose Memory and CPU settings:" set resources.
  8. [Forward]
  9. Enable the check box "Customize configuration before install".
  10. [Finish]
  11. The configuration window for the new VM is opened. In "Overview" > "Details" tab > "Firmware:" select "UEFI".
  12. On the bottom left, click the button "Add Hardware".
  13. Add a storage of some reasonable size. E.g. Storage > Details tab > select the radio button "Create a disk image for the virtual machine" and set it to at least 6 GB, and ideally more than 20. Press the "Finish" button.
  14. In the top left of the window, press the "Begin Installation" button. The VM will start.

If virt-manager shows "Unable to connect to libvirt qemu:///system" error, run:

sudo systemctl enable --now libvirt.service

Note

in the Debian family of Linux operating systems, the name of the service is libvirtd.

If the VM fails to boot and shows the error "No bootable option or device found.". Press 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 check box by pressing the Space keyboard key. Press Enter to close the message box "Configuration changed". F10 to save, 'y' keyboard key. Press the "Escape" keyboard key twice, 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, set CPUs and RAM to reasonable levels based on expected usage (e.g. 4 cores and 8 GB RAM, or more if needed).
  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 40 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

https://invent.kde.org/kde-linux/kde-linux/-/issues/295#note_1302368

todo: rewrite that here in a simpler form