diff --git a/tests/cli-test-xml/compare/virt-install-many-devices.xml b/tests/cli-test-xml/compare/virt-install-many-devices.xml
index 2873a65bd..20752ee73 100644
--- a/tests/cli-test-xml/compare/virt-install-many-devices.xml
+++ b/tests/cli-test-xml/compare/virt-install-many-devices.xml
@@ -235,12 +235,12 @@
-
+
-
+
diff --git a/tests/cli-test-xml/compare/virt-install-spice-gl.xml b/tests/cli-test-xml/compare/virt-install-spice-gl.xml
index 0aef6aa70..095c43e5d 100644
--- a/tests/cli-test-xml/compare/virt-install-spice-gl.xml
+++ b/tests/cli-test-xml/compare/virt-install-spice-gl.xml
@@ -44,7 +44,7 @@
-
+
diff --git a/virtinst/guest.py b/virtinst/guest.py
index eaf83ffc2..44554d437 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -1174,9 +1174,21 @@ class Guest(XMLBuilder):
if dev.image_compression is None:
dev.image_compression = "off"
- if (dev.type == "spice" and dev.gl and
- not self.conn.check_support(self.conn.SUPPORT_CONN_SPICE_GL)):
- raise ValueError(_("Host does not support spice GL"))
+ if dev.type == "spice" and dev.gl:
+ if not self.conn.check_support(
+ self.conn.SUPPORT_CONN_SPICE_GL):
+ raise ValueError(_("Host does not support spice GL"))
+
+ # If spice GL but rendernode wasn't specified, hardcode
+ # the first one
+ if not dev.rendernode and self.conn.check_support(
+ self.conn.SUPPORT_CONN_SPICE_RENDERNODE):
+ for nodedev in self.conn.fetch_all_nodedevs():
+ if (nodedev.device_type != 'drm' or
+ nodedev.drm_type != 'render'):
+ continue
+ dev.rendernode = nodedev.get_devnode().path
+ break
def _add_spice_channels(self):
if self.skip_default_channel: