]> gitweb.fluxo.info Git - vbox.git/commitdiff
Run natresolver config when bringing up
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 1 Dec 2016 17:24:21 +0000 (15:24 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 1 Dec 2016 17:24:21 +0000 (15:24 -0200)
vbox

diff --git a/vbox b/vbox
index a76baab295fa1afcb95e30e9279b4000909f723f..84f37ef519aaf6e525041c2db575b5caa7f2566b 100755 (executable)
--- a/vbox
+++ b/vbox
@@ -49,9 +49,16 @@ function vbox_clip {
   exit
 }
 
+function vbox_natresolver {
+  # See host's resolver as a DNS proxy in NAT mode
+  # https://www.virtualbox.org/manual/ch09.html#nat_host_resolver_proxy
+  VBoxManage modifyvm $VM --natdnshostresolver1 on
+}
+
 # Build options
 if [ ! -z "$VM" ]; then
   if [ "$COMMAND" == "up" ]; then
+    vbox_natresolver
     vbox_run startvm
   elif [ "$COMMAND" == "down" ]; then
     vbox_run controlvm savestate
@@ -81,9 +88,7 @@ elif [ "$COMMAND" == "list" ]; then
 elif [ "$COMMAND" == "clip" ]; then
   vbox_clip
 elif [ "$COMMAND" == "natresolver" ]; then
-  # See host's resolver as a DNS proxy in NAT mode
-  # https://www.virtualbox.org/manual/ch09.html#nat_host_resolver_proxy
-  VBoxManage modifyvm $VM --natdnshostresolver1 on
+  vbox_natresolver
 else
   usage
 fi