aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xkvmx56
1 files changed, 29 insertions, 27 deletions
diff --git a/kvmx b/kvmx
index 9fe1288..dc74365 100755
--- a/kvmx
+++ b/kvmx
@@ -297,37 +297,39 @@ function kvmx_up {
kvmx_spice
fi
- let ssh_attempts="0"
- echo -n "Waiting for machine to boot..."
- while true; do
- echo true | $SSH_COMMAND -o ConnectTimeout=2 -o NumberOfPasswordPrompts=0 -p $SSH $SSH_LOGIN@127.0.0.1 &> /dev/null && break
- echo -n "."
- let ssh_attempts++
-
- if [ "$ssh_attempts" == "20" ]; then
- echo "$BASENAME: timeout or access denied when trying to SSH into $VM."
- echo "$BASENAME: please check if the image is in a good state and if it accepts passwordless ssh connections"
- kvmx_stop
- exit 1
- fi
+ if [ "$ssh_support" == "y" ]; then
+ let ssh_attempts="0"
+ echo -n "Waiting for machine to boot..."
+ while true; do
+ echo true | $SSH_COMMAND -o ConnectTimeout=2 -o NumberOfPasswordPrompts=0 -p $SSH $SSH_LOGIN@127.0.0.1 &> /dev/null && break
+ echo -n "."
+ let ssh_attempts++
+
+ if [ "$ssh_attempts" == "20" ]; then
+ echo "$BASENAME: timeout or access denied when trying to SSH into $VM."
+ echo "$BASENAME: please check if the image is in a good state and if it accepts passwordless ssh connections"
+ kvmx_stop
+ exit 1
+ fi
- sleep 2
- done
- echo " done."
- #sleep 5
- #echo ""
+ sleep 2
+ done
+ echo " done."
+ #sleep 5
+ #echo ""
- # 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
+ # 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
- kvmx_hostname
+ kvmx_hostname
- 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
- #echo "sudo mount //10.0.2.4/qemu $shared_folder_mountpint" | 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
+ #echo "sudo mount //10.0.2.4/qemu $shared_folder_mountpint" | kvmx_ssh
+ fi
fi
kvmx_status