diff options
-rw-r--r-- | README.md | 1 | ||||
-rwxr-xr-x | kvmx | 10 | ||||
-rwxr-xr-x | kvmx-create | 2 | ||||
-rwxr-xr-x | kvmx-vdagent | 6 | ||||
-rw-r--r-- | kvmxfile | 3 |
5 files changed, 21 insertions, 1 deletions
@@ -46,6 +46,7 @@ If no folder is specified, the current folder is assumed as the project home. ## Further development +* Support for custom SSH keypair per virtual machine. * Remount shared folders and reinitialize spice-vdagent upon resume from disk. * More params (memory, cpus, ssh, serial console, additional shared folders, etc). * Integration with [image-bootstrap](https://github.com/hartwork/image-bootstrap). @@ -74,7 +74,6 @@ function __kvmx_initialize { # Default parameters PORT="$(($RANDOM + 1024))" SSH="$(($PORT + 22))" - SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=FATAL -o ProxyCommand=none -i $APP_BASE/share/ssh/insecure_private_key" SSH_LOGIN="user" # Initalize @@ -112,6 +111,15 @@ function __kvmx_initialize { SSHFILE="$STATE_DIR/ssh" LOGFILE="$STATE_DIR/log" SPICEFILE="$STATE_DIR/spice" + + if [ -e "$STORAGE/$VM.key" ]; then + SSHKEY="$STORAGE/$VM.key" + else + SSHKEY="$APP_BASE/share/ssh/insecure_private_key" + fi + + SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=FATAL -o ProxyCommand=none -i $SSHKEY" + mkdir -p $STATE_DIR if [ ! -e "$image" ] && [ "$ACTION" != "up" ] && [ "$ACTION" != "purge" ] && [ "$ACTION" != "destroy" ]; then diff --git a/kvmx-create b/kvmx-create index d06c2b4..31646eb 100755 --- a/kvmx-create +++ b/kvmx-create @@ -103,6 +103,8 @@ function kvmx_config { kvmx_user_config arch amd64 "System arch" kvmx_user_config version stretch "Distro version" kvmx_user_config mirror http://http.debian.net/debian/ "Debian mirror" + kvmx_user_config ssh_support y "Administration using passwordless SSH (y/n)" + kvmx_user_config ssh_custom y "Setup a custom SSH keypair (y/n)" } # Load config file diff --git a/kvmx-vdagent b/kvmx-vdagent index 9437a8e..e938b74 100755 --- a/kvmx-vdagent +++ b/kvmx-vdagent @@ -30,3 +30,9 @@ done if which spice-vdagent &> /dev/null ; then spice-vdagent fi + +# Initialize the clipboard with some content: this seems necessary in order to +# the clipboard link start working between host and guest. +if which xclip &> /dev/null; then + echo $RANDOM | xclip +fi @@ -48,3 +48,6 @@ version="stretch" # Debian mirror mirror="http://http.debian.net/debian/" + +ssh_support="y" +ssh_custom="y" |