Skip to content

Instantly share code, notes, and snippets.

@igorsgm
Created November 15, 2022 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igorsgm/0fadb09bb5d89166acc5cd22598ed32d to your computer and use it in GitHub Desktop.
Save igorsgm/0fadb09bb5d89166acc5cd22598ed32d to your computer and use it in GitHub Desktop.
diff --git a/homestead.rb b/homestead.rb
index 8d77a34..3fff00d 100644
--- a/homestead.rb
+++ b/homestead.rb
@@ -19,7 +19,8 @@ class Homestead
config.vm.hostname = settings["hostname"] ||= "homestead"
# Configure A Private Network IP
- config.vm.network :private_network, ip: settings["ip"] ||= "192.168.10.10"
+ # config.vm.network :private_network, ip: settings["ip"] ||= "192.168.10.10"
+ config.vm.network :private_network, ip: settings['ip'] ||= '192.168.10.10', name: "HostOnly", virtualbox__intnet: true
# Configure Additional Networks
if settings.has_key?("networks")
@@ -36,6 +37,7 @@ class Homestead
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
vb.customize ["modifyvm", :id, "--natdnshostresolver1", settings["natdnshostresolver"] ||= "on"]
vb.customize ["modifyvm", :id, "--ostype", "Ubuntu_64"]
+ vb.customize ["modifyvm", :id, "--nic2", "hostonlynet", "--host-only-net2=HostOnly"]
if settings.has_key?("gui") && settings["gui"]
vb.gui = true
end
@igorsgm
Copy link
Author

igorsgm commented Nov 15, 2022

If you are already using the new Vagrant IP, replace 192.168.10.10 by 192.168.56.56

@igorsgm
Copy link
Author

igorsgm commented Nov 15, 2022

After that, create the Host-only Network in our VirtualBox. So run this in our Terminal:

  • If you are using the old IP 192.168.10.10:
VBoxManage hostonlynet add --name=HostOnly --netmask=255.255.255.0 --lower-ip=192.168.10.1 --upper-ip=192.168.10.100 --enable
  • If you are using the new IP 192.168.56.56:
VBoxManage hostonlynet add --name=HostOnly --netmask=255.255.255.0 --lower-ip=192.168.56.1 --upper-ip=192.168.56.100 --enable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment