This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.
Step 1 - Enable NBD on the Host
modprobe nbd max_part=8
#!groovy | |
import groovy.json.JsonOutput | |
import groovy.json.JsonSlurper | |
def label = "mypod-${UUID.randomUUID().toString()}" | |
podTemplate(label: label, yaml: """ | |
spec: | |
containers: | |
- name: mvn | |
image: maven:3.3.9-jdk-8 |
import org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval | |
ScriptApproval scriptApproval = ScriptApproval.get() | |
scriptApproval.pendingScripts.each { | |
scriptApproval.approveScript(it.hash) | |
} | |
/* Script to clear script approval | |
$JENKINS_HOME/init.groovy.d/disable-script-security.groovy: | |
*/ |