From f5352bd9edaf932ecaed1dc870aaeedc038c410e Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Mon, 5 Jul 2021 11:16:01 +0200 Subject: [qemu] Enable output of finalized Libvirt config in debug mode --- .../qemu/data/opt/openslx/vmchooser/plugins/qemu/run-virt.include | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemu/run-virt.include b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemu/run-virt.include index c3dfd21d..04dca832 100644 --- a/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemu/run-virt.include +++ b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemu/run-virt.include @@ -35,8 +35,10 @@ run_plugin() { vm_diskfile="${VM_DISKFILE_RW}" fi - # write finalized config to temporary folder for debugging purposes - local vm_final_run_file="/tmp/qemu-last-config.xml" + # write finalized config in debug mode to temporary folder for debugging purposes + if [ "${DEBUG}" = "true" ]; then + local vm_final_config="/tmp/qemu-last-config.xml" + fi # call the Libvirt Java tool to finalize configuration and start VM declare -rg VIRTCMD="java" @@ -47,7 +49,7 @@ run_plugin() { notempty VM_DISPLAYNAME && VIRTCMDOPTS+=( "-vmdsplname" "${VM_DISPLAYNAME}" ) notempty VM_OS_TYPE && VIRTCMDOPTS+=( "-vmos" "${VM_OS_TYPE}" ) notempty TMPCONFIG && VIRTCMDOPTS+=( "-vmcfginp" "${TMPCONFIG}" ) - notempty vm_final_run_file && VIRTCMDOPTS+=( "-vmcfgout" "${vm_final_run_file}" ) + notempty vm_final_config && VIRTCMDOPTS+=( "-vmcfgout" "${vm_final_config}" ) notempty IMGUUID && VIRTCMDOPTS+=( "-vmuuid" "${IMGUUID}" ) notempty HW_CORES && VIRTCMDOPTS+=( "-vmncpus" "${HW_CORES}" ) notempty VM_MEM && VIRTCMDOPTS+=( "-vmmem" "${VM_MEM}" ) -- cgit v1.2.3-55-g7522 From c166b3ae4009c442c015da8b871550f15ebefff6 Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Mon, 5 Jul 2021 12:34:06 +0200 Subject: [qemu] Terminate virt-viewer if VM is powered off --- .../src/main/java/org/openslx/runvirt/viewer/ViewerVirtViewer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/viewer/ViewerVirtViewer.java b/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/viewer/ViewerVirtViewer.java index 8f6e9481..d696e109 100644 --- a/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/viewer/ViewerVirtViewer.java +++ b/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/viewer/ViewerVirtViewer.java @@ -90,8 +90,8 @@ public class ViewerVirtViewer extends Viewer } // execute viewer process with arguments: - // "virt-viewer --full-screen --reconnect --wait --attach --connect= --domain-name -- " - ViewerUtils.executeViewer( ViewerVirtViewer.NAME, new String[] { "--full-screen", "--reconnect", "--wait", + // "virt-viewer --full-screen --wait --attach --connect= --domain-name -- " + ViewerUtils.executeViewer( ViewerVirtViewer.NAME, new String[] { "--full-screen", "--wait", "--attach", "--connect=" + connectionUri, "--uuid", "--", machineUuid } ); } } -- cgit v1.2.3-55-g7522 From 839a4514406abbfb58408f6449f8aa98f9b045f8 Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Mon, 5 Jul 2021 13:04:23 +0200 Subject: [qemu] Add user to 'dialout' group for serial/parport access --- .../opt/openslx/pam/hooks/auth-final-exec.d/40-add-to-dialout.sh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 core/modules/qemu/data/opt/openslx/pam/hooks/auth-final-exec.d/40-add-to-dialout.sh diff --git a/core/modules/qemu/data/opt/openslx/pam/hooks/auth-final-exec.d/40-add-to-dialout.sh b/core/modules/qemu/data/opt/openslx/pam/hooks/auth-final-exec.d/40-add-to-dialout.sh new file mode 100644 index 00000000..752344a2 --- /dev/null +++ b/core/modules/qemu/data/opt/openslx/pam/hooks/auth-final-exec.d/40-add-to-dialout.sh @@ -0,0 +1,5 @@ +#!/bin/ash + +adduser "${PAM_USER}" "dialout" + +exit 0 -- cgit v1.2.3-55-g7522