2 minutes will be more than enough
[build.git] / lbuild-initvm.sh
index cea0838..a867f60 100755 (executable)
@@ -41,6 +41,7 @@ for line in file("/proc/net/dev"):
     if ifname.find("lo")==0: continue
     if ifname.find("br")==0: continue
     if ifname.find("virbr")==0: continue
+    if ifname.find("veth")==0: continue
     if ifname.find("tap")==0: continue
     print ifname
 EOF
@@ -504,11 +505,10 @@ EOF
 
 function write_guest_interfaces_test () {
     cat <<EOF
-auto $VIF_GUEST
 iface $VIF_GUEST
-    address $GUEST_IP
-    netmask $NETMASK
-    gateway $GATEWAY
+address $GUEST_IP
+netmask $NETMASK
+gateway $GATEWAY
 EOF
 }
 ##############################
@@ -815,10 +815,10 @@ function wait_for_ssh () {
   
     echo network in guest is up, waiting for ssh...
 
-    #wait max 5 min for sshd to start 
+    #wait max 2 min for sshd to start 
     ssh_up=""
-    stop_time=$(($(date +%s) + 300))
     current_time=$(date +%s)
+    stop_time=$(($current_time + 120))
     
     counter=1
     while [ "$current_time" -lt "$stop_time" ] ; do
@@ -955,7 +955,7 @@ function main () {
        # use same NETMASK as bridge interface br0
        MASKLEN=$(ip addr show $PUBLIC_BRIDGE | grep -v inet6 | grep inet | awk '{print $2;}' | cut -d/ -f2)
         NETMASK=$(masklen_to_netmask $MASKLEN)
-        GATEWAY=$(ip route show | grep default | awk '{print $3}')
+        GATEWAY=$(ip route show | grep default | awk '{print $3}' | head -1)
         VIF_HOST="i$(echo $GUEST_HOSTNAME | cut -d. -f1)"
     fi