From 1cbe9fd1aeaa06547e3df9719ceceedf987dd926 Mon Sep 17 00:00:00 2001 From: David Pollard Date: Mon, 31 Aug 2026 13:38:41 -0700 Subject: [PATCH] Fix vagrantfile to run on mac os --- Vagrantfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index c8a29f7..b5b6af5 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -5,7 +5,9 @@ # Used for setting the `smb_host` in config.vm.synced_folder def get_host_ip # This example uses `ifconfig` and `grep` to find inet interface and host IP address - host_ip = `ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'`.strip + # Excludes loopback and link-local (169.254.x.x) addresses, and takes only the first match + # in case multiple interfaces are active (e.g. Wi-Fi + VPN). + host_ip = `ifconfig | grep "inet " | grep -v 127.0.0.1 | grep -v 169.254 | awk '{print $2}'`.split("\n").first return host_ip end