re-instating the auto eth0 line - that was not the problem
[build.git] / lbuild-initvm.sh
index cea0838..d0533b3 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
@@ -505,10 +506,10 @@ EOF
 function write_guest_interfaces_test () {
     cat <<EOF
 auto $VIF_GUEST
-iface $VIF_GUEST
-    address $GUEST_IP
-    netmask $NETMASK
-    gateway $GATEWAY
+iface $VIF_GUEST inet static
+address $GUEST_IP
+netmask $NETMASK
+gateway $GATEWAY
 EOF
 }
 ##############################
@@ -815,10 +816,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 +956,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