Compare commits

...

19 Commits

Author SHA1 Message Date
Lukas Greve
74d1b66c21 yo
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
2025-07-17 18:26:32 +02:00
Lukas Greve
dd3f79ac7e change title 2025-07-17 18:24:34 +02:00
Lukas Greve
2406b81b19 change title
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6m26s
2025-06-27 22:46:39 +02:00
Lukas Greve
25365afd86 test workflow file
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-06-27 22:45:33 +02:00
Lukas Greve
be2f85380d remove extra clock, host-model CPU 2025-06-21 14:50:00 +02:00
Lukas Greve
d8a09db2ce kvmclock, host-model CPU, remove vmport 2025-06-21 14:49:08 +02:00
Lukas Greve
5802cdbde8 kvmclock without catchup policy, suspend to mem and disk, delete vsock, remove dbus, delete smartcard 2025-06-21 14:48:37 +02:00
Lukas Greve
3a1d4708a4 kvmclock, host-model CPU, automatic firmware, no vmport 2025-06-21 14:46:35 +02:00
Lukas Greve
27391ed096 kvmclock, host-model CPU, automatic firmware, suspend to mem and disk 2025-06-21 14:45:47 +02:00
Lukas Greve
c75c79a7ce improve enlightments selection 2025-06-08 11:55:47 +02:00
Lukas Greve
5ee048e1dc change cpu mode, add kvmclock 2025-06-08 11:55:25 +02:00
Lukas Greve
828338cd41 Remove a duplicated line, change memory unit for memory 2025-06-01 19:54:46 +02:00
luz
3a350f2f12 add virtio sound, switch to automatic efi firmware, change virtio fs path 2025-06-01 15:46:13 +02:00
luz
518b87325f add virtio sound, switch to automatic efi firmware, change virtio fs path, add memory backing with memfd, change to mouse 2025-06-01 15:45:55 +02:00
luz
d4092f4280 add virtio sound 2025-06-01 15:43:48 +02:00
luz
1f364a1289 add virtio sound 2025-06-01 15:43:30 +02:00
Lukas Greve
a80d97d3ab add new hyperlink 2025-05-30 09:40:12 +02:00
Lukas Greve
6110cfc9e6 scripts to define and undefine vms 2025-05-30 09:39:53 +02:00
Lukas Greve
49c18900ac rename vm 2025-05-30 09:39:36 +02:00
10 changed files with 236 additions and 93 deletions

View File

@@ -0,0 +1,19 @@
name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push]
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ gitea.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."

View File

@@ -1,4 +1,4 @@
# Optimized, libvirt-compatible definitions for common OS
# Lbvirt-compatible VM definitions for common OS
## Goal
@@ -21,7 +21,7 @@ The best parameters are defined as parameters that are:
There are two kinds of definition for QEMU: **session-driven** virtual machines, and **system-driven** virtual machines.
- **System-driven virtual machines** are running with higher privileges. If one intend to share a physical device with a virtual machine using VFIO passthrough, this is the definition to use. More information [here](https://blog.wikichoon.com/2016/01/qemusystem-vs-qemusession.html).
- **System-driven virtual machines** are running with higher privileges. If one intend to share a physical device with a virtual machine using VFIO passthrough, this is the definition to use. More information [here](https://blog.wikichoon.com/2016/01/qemusystem-vs-qemusession.html) or [here](https://wiki.libvirt.org/FAQ.html#what-is-the-difference-between-qemu-system-and-qemu-session-which-one-should-i-use)
- **Session-driven virtual machines** are running with user-derived privileges.

57
define-vms.sh Executable file
View File

@@ -0,0 +1,57 @@
#!/bin/bash
# Directory containing XML definitions of virtual machines requiring root permissions
SYSTEM="./system/"
# Ensure the directory exists
if [ ! -d "$SYSTEM" ]; then
echo "The specified directory does not exist."
exit 1
fi
# Loop over each XML file in the directory
for root_vm in "$SYSTEM"/*.xml; do
if [ -f "$root_vm" ]; then
# Use virsh define to create a virtual machine from each XML file
sudo virsh define "$root_vm"
# Check if the command was successful
if [ $? -eq 0 ]; then
echo "Successfully defined virtual machine from $root_vm"
else
echo "Failed to define virtual machine from $root_vm"
fi
else
echo "No XML files found in directory: $SYSTEM"
fi
done
echo "Finished defining all root virtual machines."
# Directory containing XML definitions of virtual machines requiring user permissions
SESSION="./session/"
# Ensure the directory exists
if [ ! -d "$SESSION" ]; then
echo "The specified directory does not exist."
exit 1
fi
# Loop over each XML file in the directory
for rootless_vm in "$SESSION"/*.xml; do
if [ -f "$rootless_vm" ]; then
# Use virsh define to create a virtual machine from each XML file
virsh define "$rootless_vm"
# Check if the command was successful
if [ $? -eq 0 ]; then
echo "Successfully defined virtual machine from $rootless_vm"
else
echo "Failed to define virtual machine from $rootless_vm"
fi
else
echo "No XML files found in directory: $SESSION"
fi
done
echo "Finished defining all rootless virtual machines."

View File

@@ -1,34 +1,34 @@
<domain type='kvm'>
<name>Linux5.15</name>
<memory unit='KiB'>4194304</memory>
<name>linux515</name>
<description>Rootless QEMU virtual machine model optimized for Linux guests running at least kernel 5.15. Secure boot is disabled</description>
<memory unit="KiB">4194304</memory>
<currentMemory unit="KiB">1048576</currentMemory>
<memory unit="GiB">4</memory>
<currentMemory unit="GiB">1</currentMemory>
<memoryBacking>
<source type="memfd"/>
<access mode="shared"/>
</memoryBacking>
<vcpu placement='static'>4</vcpu>
<os>
<type arch='x86_64' machine='q35'>hvm</type>
<loader readonly='yes' secure='no' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
<boot dev='cdrom'/>
<os firmware="efi">
<type arch="x86_64" machine="q35">hvm</type>
<loader secure='no'/>
<boot dev="cdrom"/>
</os>
<features>
<acpi/>
<apic/>
<vmport state='off'/>
</features>
<cpu mode="host-passthrough" check="none" migratable="on">
<cpu mode="host-model">
<topology sockets="1" dies="1" cores="2" threads="2"/>
</cpu>
<clock offset='utc'>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='no'/>
<timer name='kvmclock'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<pm>
<suspend-to-mem enabled='no'/>
<suspend-to-disk enabled='no'/>
<suspend-to-mem enabled='yes'/>
<suspend-to-disk enabled='yes'/>
</pm>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
@@ -39,24 +39,22 @@
<readonly/>
</disk>
<controller type='virtio-serial' index='0'>
<model type='virtio-non-transitional'/>
</controller>
<interface type='user'>
<backend type='passt'/>
<model type='virtio'/>
</interface>
<console type='pty'>
<target type='virtio' port='0'/>
</console>
<channel type="spicevmc">
<target type="virtio" name="com.redhat.spice.0"/>
<address type="virtio-serial" controller="0" bus="0" port="1"/>
</channel>
<channel type='unix'>
<target type='virtio' name='org.qemu.guest_agent.0'/>
<address type='virtio-serial' controller='0' bus='0' port='2'/>
</channel>
<input type='keyboard' bus='virtio'>
</input>
<input type='tablet' bus='virtio'>
<input type='mouse' bus='virtio'>
</input>
<tpm model="tpm-crb">
<backend type="emulator" version="2.0"/>
@@ -71,10 +69,17 @@
<acceleration accel3d="yes"/>
</model>
</video>
<memballoon model="virtio"/>
<rng model='virtio'>
<sound model="virtio"/>
<memballoon model="virtio-non-transitional"/>
<rng model="virtio-non-transitional">
<backend model='random'>/dev/urandom</backend>
</rng>
<filesystem type="mount" accessmode="passthrough">
<driver type="virtiofs"/>
<source dir="/mnt"/>
<target dir="mnt"/>
<readonly/>
</filesystem>
<iommu model="virtio"/>
</devices>
</domain>

View File

@@ -1,34 +1,35 @@
<domain type='kvm'>
<name>Linux5.4</name>
<name>linux54</name>
<memory unit='KiB'>4194304</memory>
<description>Rootless QEMU virtual machine model optimized for Linux guests running at least kernel 5.4. Secure boot is disabled</description>
<memory unit="KiB">4194304</memory>
<currentMemory unit="KiB">1048576</currentMemory>
<vcpu placement='static'>4</vcpu>
<os>
<type arch='x86_64' machine='q35'>hvm</type>
<loader readonly='yes' secure='no' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
<boot dev='cdrom'/>
<memoryBacking>
<source type="memfd"/>
<access mode="shared"/>
</memoryBacking>
<os firmware="efi">
<type arch="x86_64" machine="q35">hvm</type>
<loader secure='no'/>
<boot dev="cdrom"/>
</os>
<features>
<acpi/>
<apic/>
<vmport state='off'/>
</features>
<cpu mode="host-passthrough" check="none" migratable="on">
<cpu mode="host-model">
<topology sockets="1" dies="1" cores="2" threads="2"/>
</cpu>
<clock offset='utc'>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='no'/>
<timer name='kvmclock'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<pm>
<suspend-to-mem enabled='no'/>
<suspend-to-disk enabled='no'/>
<suspend-to-mem enabled='yes'/>
<suspend-to-disk enabled='yes'/>
</pm>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
@@ -71,6 +72,7 @@
<acceleration accel3d="yes"/>
</model>
</video>
<sound model="virtio"/>
<memballoon model="virtio"/>
<rng model='virtio'>
<backend model='random'>/dev/urandom</backend>

View File

@@ -1,5 +1,5 @@
<domain type='kvm'>
<name>Linux5.15</name>
<name>linux515</name>
<memory unit='KiB'>4194304</memory>
<description>QEMU Virtual machine model optimized for Linux guests running at least kernel 5.15. Secure boot is disabled</description>
<memory unit="KiB">4194304</memory>
@@ -9,23 +9,20 @@
<access mode="shared"/>
</memoryBacking>
<vcpu placement='static'>4</vcpu>
<os>
<type arch='x86_64' machine='q35'>hvm</type>
<loader readonly='yes' secure='no' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
<boot dev='cdrom'/>
<os firmware="efi">
<type arch="x86_64" machine="q35">hvm</type>
<loader secure='no'/>
<boot dev="cdrom"/>
</os>
<features>
<acpi/>
<apic/>
<vmport state='off'/>
</features>
<cpu mode="host-passthrough" check="none" migratable="on">
<cpu mode="host-model">
<topology sockets="1" dies="1" cores="2" threads="2"/>
</cpu>
<clock offset='utc'>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='no'/>
<timer name='kvmclock'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
@@ -80,12 +77,13 @@
<rng model='virtio'>
<backend model='random'>/dev/urandom</backend>
</rng>
<sound model="virtio"/>
<filesystem type="mount" accessmode="passthrough">
<driver type="virtiofs"/>
<source dir="/mnt/"/>
<target dir="share"/>
<source dir="/var/lib/libvirt/isos/"/>
<target dir="isos"/>
<readonly/>
</filesystem>
<iommu model="virtio"/>
</devices>
</domain>

View File

@@ -1,5 +1,5 @@
<domain type='kvm'>
<name>Linux5.4</name>
<name>linux54</name>
<memory unit='KiB'>4194304</memory>
<description>QEMU Virtual machine model optimized for Linux guests running at least kernel 5.4. Secure boot is disabled</description>
<memory unit="KiB">4194304</memory>
@@ -9,23 +9,20 @@
<access mode="shared"/>
</memoryBacking>
<vcpu placement='static'>4</vcpu>
<os>
<type arch='x86_64' machine='q35'>hvm</type>
<loader readonly='yes' secure='no' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
<boot dev='cdrom'/>
<os firmware="efi">
<type arch="x86_64" machine="q35">hvm</type>
<loader secure='no'/>
<boot dev="cdrom"/>
</os>
<features>
<acpi/>
<apic/>
<vmport state='off'/>
</features>
<cpu mode="host-passthrough" check="none" migratable="on">
<cpu mode="host-model">
<topology sockets="1" dies="1" cores="2" threads="2"/>
</cpu>
<clock offset='utc'>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='no'/>
<timer name='kvmclock'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
@@ -76,6 +73,7 @@
<acceleration accel3d="yes"/>
</model>
</video>
<sound model="virtio"/>
<memballoon model="virtio"/>
<rng model='virtio'>
<backend model='random'>/dev/urandom</backend>

View File

@@ -1,5 +1,5 @@
<domain type='kvm'>
<name>WindowsNT10</name>
<name>windows10</name>
<memory unit='KiB'>4194304</memory>
<description>QEMU virtual machine model optimized for Windows NT 10 guests such as Windows 10. Secure boot is disabled</description>
<currentMemory unit='KiB'>4194304</currentMemory>
@@ -8,39 +8,40 @@
<access mode="shared"/>
</memoryBacking>
<vcpu placement='static'>4</vcpu>
<os>
<type arch='x86_64' machine='q35'>hvm</type>
<loader readonly='yes' secure='no' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
<boot dev='cdrom'/>
<os firmware="efi">
<type arch="x86_64" machine="q35">hvm</type>
<loader secure='no'/>
<boot dev="cdrom"/>
</os>
<features>
<acpi/>
<apic/>
<hyperv mode="custom">
<relaxed state="on"/>
<vapic state="on"/>
<spinlocks state="on" retries="8191"/>
<vpindex state="on"/>
<runtime state="on"/>
<synic state="on"/>
<stimer state="on"/>
<vendor_id state='on' value='Phyllome OS'/>
<frequencies state="on"/>
<tlbflush state="on"/>
<ipi state="on"/>
<relaxed state='on'/>
<vapic state='on'/>
<spinlocks state='on' retries='4096'/>
<vpindex state='on'/>
<runtime state='on'/>
<synic state='on'/>
<stimer state='on'>
<direct state='on'/>
</stimer>
<reset state='on'/>
<frequencies state='on'/>
<reenlightenment state='on'/>
<tlbflush state='on'>
<direct state='on'/>
<extended state='on'/>
</tlbflush>
</hyperv>
<kvm>
<hidden state='on'/>
</kvm>
<vmport state="off"/>
</features>
<cpu mode="host-passthrough" check="none" migratable="on">
<cpu mode="host-model">
<topology sockets="1" dies="1" cores="2" threads="2"/>
</cpu>
<clock offset="localtime">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
<timer name="hpet" present="no"/>
<timer name="hypervclock" present="yes"/>
</clock>
<on_poweroff>destroy</on_poweroff>

View File

@@ -1,5 +1,5 @@
<domain type='kvm'>
<name>WindowsNT11</name>
<name>windows11</name>
<memory unit='KiB'>4194304</memory>
<description>QEMU virtual machine model optimized for Windows NT 11 guests such as Windows 11. Secure boot is enabled</description>
<currentMemory unit='KiB'>4194304</currentMemory>
@@ -19,28 +19,29 @@
<hyperv mode="custom">
<relaxed state="on"/>
<vapic state="on"/>
<spinlocks state="on" retries="8191"/>
<spinlocks state="on" retries="4096"/>
<vpindex state="on"/>
<runtime state="on"/>
<synic state="on"/>
<stimer state="on"/>
<vendor_id state='on' value='Phyllome OS'/>
<stimer state="on">
<direct state="on"/>
</stimer>
<reset state="on"/>
<frequencies state="on"/>
<tlbflush state="on"/>
<ipi state="on"/>
<reenlightenment state="on"/>
<tlbflush state="on">
<direct state="on"/>
<extended state="on"/>
</tlbflush>
</hyperv>
<kvm>
<hidden state='on'/>
<hidden state="on"/>
</kvm>
<vmport state="off"/>
</features>
<cpu mode="host-passthrough" check="none" migratable="on">
<cpu mode="host-model">
<topology sockets="1" dies="1" cores="2" threads="2"/>
</cpu>
<clock offset="localtime">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
<timer name="hpet" present="no"/>
<timer name="hypervclock" present="yes"/>
</clock>
<on_poweroff>destroy</on_poweroff>

62
undefine-vms.sh Executable file
View File

@@ -0,0 +1,62 @@
#!/bin/bash
# Function to undefine a virtual machine. Takes just the VM name.
# This makes it more robust and aligned with how virsh expects the name.
undefine_vm() {
local vm_name="$1"
# Use virsh undefine to undefine a virtual machine
sudo virsh undefine "$vm_name"
# Check if the command was successful
if [ $? -eq 0 ]; then
echo "Successfully undefined virtual machine $vm_name"
else
echo "Failed to undefine virtual machine $vm_name"
fi
}
# Directory containing XML definitions of virtual machines requiring root permissions
SYSTEM="./system/"
# Ensure the directory exists
if [ ! -d "$SYSTEM" ]; then
echo "The specified directory does not exist."
exit 1
fi
# Loop over each XML file in the directory
for root_vm in "$SYSTEM"/*.xml; do
if [ -f "$root_vm" ]; then
# Extract the VM name from the full path
vm_name=$(basename "$root_vm" .xml) # Removes the .xml extension
# Call the undefine function
undefine_vm "$vm_name"
fi
done
echo "Finished undefining all root virtual machines."
# Directory containing XML definitions of virtual machines requiring user permissions
SESSION="./session/"
# Ensure the directory exists
if [ ! -d "$SESSION" ]; then
echo "The specified directory does not exist."
exit 1
fi
# Loop over each XML file in the directory
for rootless_vm in "$SESSION"/*.xml; do # Corrected the pattern
if [ -f "$rootless_vm" ]; then
# Extract the VM name from the full path
vm_name=$(basename "$rootless_vm" .xml) #remove .xml extension
# Call the undefine function
virsh undefine "$vm_name"
fi
done
echo "Finished undefining all rootless virtual machines."