aboutsummaryrefslogtreecommitdiff
path: root/kvmx
diff options
context:
space:
mode:
Diffstat (limited to 'kvmx')
-rwxr-xr-xkvmx28
1 files changed, 26 insertions, 2 deletions
diff --git a/kvmx b/kvmx
index 6a67d09..1dd0302 100755
--- a/kvmx
+++ b/kvmx
@@ -50,7 +50,7 @@ function kvmx_spice {
#spicy -h localhost -p $PORT
#remote-viewer spice://localhost:$PORT
- # Give time to boot
+ # Give time to connect
sleep 5
# Fix window titles
@@ -114,6 +114,21 @@ function kvmx_up {
if [ "$run_spice_client" == "1" ]; then
kvmx_spice
fi
+
+ echo "Waiting for machine to boot..."
+ sleep 5
+
+ # Somehow it is starting before DBUS and then crashing, so we try to start again
+ echo "Ensure spice-vdagent is running..."
+ echo "sudo /usr/sbin/service spice-vdagent start" | kvmx_ssh
+
+ if [ ! -z "$shared_folder" ] && [ ! -z "$shared_folder_mountpoint" ]; then
+ echo "Mounting $shared_folder on $shared_folder_mountpoint on guest..."
+ echo "sudo mkdir -p $shared_folder_mountpoint" | kvmx_ssh
+ echo "sudo mount -t 9p -o trans=virtio shared $shared_folder_mountpoint -oversion=9p2000.L,posixacl,cache=loose" | kvmx_ssh
+ fi
+
+ kvmx_status
}
# Display usage
@@ -152,7 +167,16 @@ function kvmx_ssh {
exit 1
fi
- shift 2
+ # Shift params according to how the program was called:
+ # either "kvmx ssh" or "kvmx ssh guest".
+ if [ "$ACTION" == "ssh" ]; then
+ if [ ! -z "$2" ]; then
+ shift 2
+ else
+ shift 1
+ fi
+ fi
+
SSH="`cat $SSHFILE`"
$SSH_COMMAND -p $SSH $SSH_LOGIN@127.0.0.1 $*
}