diff --git a/agent/conf/uefi.properties.in b/agent/conf/uefi.properties.in
new file mode 100644
index 000000000000..3c8866f634bc
--- /dev/null
+++ b/agent/conf/uefi.properties.in
@@ -0,0 +1,24 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Configuration file for UEFI
+
+guest.nvram.template.legacy=@GUESTNVRAMTEMPLATELEGACY@
+guest.loader.legacy=@GUESTLOADERLEGACY@
+guest.nvram.template.secure=@GUESTNVRAMTEMPLATESECURE@
+guest.loader.secure=@GUESTLOADERSECURE@
+guest.nvram.path=@GUESTNVRAMPATH@
diff --git a/debian/control b/debian/control
index 1292639ef304..78842e38ed27 100644
--- a/debian/control
+++ b/debian/control
@@ -24,7 +24,7 @@ Description: CloudStack server library
Package: cloudstack-agent
Architecture: all
-Depends: ${python:Depends}, ${python3:Depends}, openjdk-17-jre-headless | java17-runtime-headless | java17-runtime | zulu-17, cloudstack-common (= ${source:Version}), lsb-base (>= 9), openssh-client, qemu-kvm (>= 2.5) | qemu-system-x86 (>= 5.2), libvirt-bin (>= 1.3) | libvirt-daemon-system (>= 3.0), iproute2, ebtables, vlan, ipset, python3-libvirt, ethtool, iptables, cryptsetup, rng-tools, rsync, lsb-release, ufw, apparmor, cpu-checker, libvirt-daemon-driver-storage-rbd, sysstat
+Depends: ${python:Depends}, ${python3:Depends}, openjdk-17-jre-headless | java17-runtime-headless | java17-runtime | zulu-17, cloudstack-common (= ${source:Version}), lsb-base (>= 9), openssh-client, qemu-kvm (>= 2.5) | qemu-system-x86 (>= 5.2), libvirt-bin (>= 1.3) | libvirt-daemon-system (>= 3.0), iproute2, ebtables, vlan, ipset, python3-libvirt, ethtool, iptables, cryptsetup, rng-tools, rsync, ovmf, swtpm, lsb-release, ufw, apparmor, cpu-checker, libvirt-daemon-driver-storage-rbd, sysstat
Recommends: init-system-helpers
Conflicts: cloud-agent, cloud-agent-libs, cloud-agent-deps, cloud-agent-scripts
Description: CloudStack agent
diff --git a/packaging/debian/replace.properties b/packaging/debian/replace.properties
index 5ea4a03b275d..bd0c14889590 100644
--- a/packaging/debian/replace.properties
+++ b/packaging/debian/replace.properties
@@ -59,3 +59,8 @@ USAGELOG=/var/log/cloudstack/usage/usage.log
USAGESYSCONFDIR=/etc/cloudstack/usage
PACKAGE=cloudstack
EXTENSIONSDEPLOYMENTMODE=production
+GUESTNVRAMTEMPLATELEGACY=/usr/share/OVMF/OVMF_VARS_4M.fd
+GUESTLOADERLEGACY=/usr/share/OVMF/OVMF_CODE_4M.fd
+GUESTNVRAMTEMPLATESECURE=/usr/share/OVMF/OVMF_VARS_4M.ms.fd
+GUESTLOADERSECURE=/usr/share/OVMF/OVMF_CODE_4M.secboot.fd
+GUESTNVRAMPATH=/var/lib/libvirt/qemu/nvram/
diff --git a/packaging/el8/cloud.spec b/packaging/el8/cloud.spec
index 7e97957473c5..0bd270aee124 100644
--- a/packaging/el8/cloud.spec
+++ b/packaging/el8/cloud.spec
@@ -115,6 +115,8 @@ Requires: ipset
Requires: perl
Requires: rsync
Requires: cifs-utils
+Requires: edk2-ovmf
+Requires: swtpm
Requires: (python3-libvirt or python3-libvirt-python)
Requires: (qemu-img or qemu-tools)
Requires: qemu-kvm
diff --git a/packaging/el8/replace.properties b/packaging/el8/replace.properties
index a6094b59c73b..a5afab94ff2b 100644
--- a/packaging/el8/replace.properties
+++ b/packaging/el8/replace.properties
@@ -58,3 +58,8 @@ USAGECLASSPATH=
USAGELOG=/var/log/cloudstack/usage/usage.log
USAGESYSCONFDIR=/etc/sysconfig
EXTENSIONSDEPLOYMENTMODE=production
+GUESTNVRAMTEMPLATELEGACY=/usr/share/edk2/ovmf/OVMF_VARS.fd
+GUESTLOADERLEGACY=/usr/share/edk2/ovmf/OVMF_CODE.cc.fd
+GUESTNVRAMTEMPLATESECURE=/usr/share/edk2/ovmf/OVMF_VARS.secboot.fd
+GUESTLOADERSECURE=/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd
+GUESTNVRAMPATH=/var/lib/libvirt/qemu/nvram/
diff --git a/pom.xml b/pom.xml
index b33d9dfe4c6b..e74922099760 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1040,15 +1040,19 @@
dist/console-proxy/js/jquery.js
engine/schema/dist/**
plugins/hypervisors/hyperv/conf/agent.properties
+ plugins/hypervisors/hyperv/conf/uefi.properties
plugins/hypervisors/hyperv/DotNet/ServerResource/**
scripts/installer/windows/acs_license.rtf
scripts/vm/systemvm/id_rsa.cloud
services/console-proxy/server/conf/agent.properties
+ services/console-proxy/server/conf/uefi.properties
services/console-proxy/server/conf/environment.properties
services/console-proxy/server/js/jquery.js
services/secondary-storage/conf/agent.properties
+ services/secondary-storage/conf/uefi.properties
services/secondary-storage/conf/environment.properties
systemvm/agent/conf/agent.properties
+ systemvm/agent/conf/uefi.properties
systemvm/agent/conf/environment.properties
systemvm/agent/js/jquery.js
systemvm/agent/js/jquery.flot.navigate.js
diff --git a/systemvm/systemvm-agent-descriptor.xml b/systemvm/systemvm-agent-descriptor.xml
index 8cf40a162766..1d6e338eb236 100644
--- a/systemvm/systemvm-agent-descriptor.xml
+++ b/systemvm/systemvm-agent-descriptor.xml
@@ -60,6 +60,7 @@
log4j-cloud.xml
consoleproxy.properties
agent.properties
+ uefi.properties