Skip to content

Commit 9b9a8af

Browse files
authoredApr 19, 2024
Fixing vagrantfile to bypass bug endless creating virtual networks
See hashicorp/vagrant#1544
1 parent 09bdb02 commit 9b9a8af

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed
 

‎Vagrantfile

+29-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ Vagrant.configure("2") do |config|
44
acs.vm.box = "generic/alma8"
55
acs.vm.hostname = "acs"
66
acs.vm.network "private_network", ip: "192.168.15.56"
7+
8+
# Make sure VirtualBox doesn't make new networks for no reason (fix)
9+
config.vm.provider :virtualbox do |vb|
10+
vb.customize [
11+
"modifyvm",
12+
:id,
13+
"--nic2",
14+
"hostonly",
15+
"--cableconnected2",
16+
"on",
17+
"--hostonlyadapter2",
18+
"VirtualBox Host-Only Ethernet Adapter"
19+
]
20+
end
721

822
# Make sure all sensitive info is only readable by user.
923
acs.vm.synced_folder ".", "/vagrant", mount_options: ["dmode=700,fmode=600"]
@@ -37,6 +51,19 @@ Vagrant.configure("2") do |config|
3751
node1.vm.box = "centos/7"
3852
node1.vm.hostname = "node1"
3953
node1.vm.network "private_network", ip: "192.168.15.57"
40-
end
4154

42-
end
55+
# Make sure VirtualBox doesn't make new networks for no reason (fix)
56+
config.vm.provider :virtualbox do |vb|
57+
vb.customize [
58+
"modifyvm",
59+
:id,
60+
"--nic2",
61+
"hostonly",
62+
"--cableconnected2",
63+
"on",
64+
"--hostonlyadapter2",
65+
"VirtualBox Host-Only Ethernet Adapter"
66+
]
67+
end
68+
end
69+
end

0 commit comments

Comments
 (0)