## 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).
# 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
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
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
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
# Debian mirror
mirror="http://http.debian.net/debian/"
+
+ssh_support="y"
+ssh_custom="y"