Hello
without having all the knowledge on what you want to do and why you want to
avoid nat, yes it does work and yes i have used it.
proof:
kikitux@alvaro MINGW64 ~/Downloads/precise64
$ vagrant destroy -f
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
kikitux@alvaro MINGW64 ~/Downloads/precise64
$ vagrant up --provider virtualbox
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'hashicorp/precise64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'hashicorp/precise64' is up to date...
==> default: Setting the name of the VM:
precise64_default_1511254703644_84079
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: bridged
==> default: Forwarding ports...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 10.0.113.246:22
default: SSH username: vagrant
default: SSH auth method: private key
default:
default: Vagrant insecure key detected. Vagrant will automatically
replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH
key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed
version of
default: VirtualBox! In most cases this is fine, but in rare cases it
can
default: prevent things such as shared folders from working properly.
If you see
default: shared folder errors, please make sure the guest additions
within the
default: virtual machine match the version of VirtualBox you have
installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 4.2.0
default: VirtualBox Version: 5.1
==> default: Mounting shared folders...
default: /vagrant => C:/Users/kikitux/Downloads/precise64
kikitux@alvaro MINGW64 ~/Downloads/precise64
$
there is 1 chicken egg here, that is, you can boot a VM add public_network
and grab the IP and macaddress
then you can use that mac/ip to solve the chicken egg.
the first network will take DHCP, Vagrant doesn't know the IP, so you can
bootstrap that part with a known mac/ip
after that it works.
$ cat Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise64"
config.vm.network "public_network", adapter: 1, auto_config: false, :mac
=> "080027880ca6"
config.vm.network :forwarded_port, guest: 22, host: 2222, id: "ssh",
disabled: true, auto_correct: true
config.vm.provider :vmware_workstation do |v|
v.gui = true
end
config.ssh.host = "10.0.113.246"
end
Enjoy,
Alvaro.
On Tue, Nov 21, 2017 at 1:47 AM, <[email protected]> wrote:
> Thank you for this.
> Apologies, I tried many different things before posting and none of them
> worked. Regarding you link with vagrant file like this:
>
> # -*- mode: ruby -*-
> # vi: set ft=ruby :
>
> Vagrant.configure("2") do |config|
> config.vm.box = "StefanScherer/windows_2016_docker"
>
> config.vm.network "public_network", adapter: "0"
> config.vm.provider :vmware_workstation do |v|
> v.gui = true
> end
> end
>
> The error I'm getting is this:
>
> Bringing machine 'default' up with 'vmware_workstation' provider...
> ==> default: Cloning VMware VM: 'StefanScherer/windows_2016_docker'. This
> can take some time...
> ==> default: Checking if box 'StefanScherer/windows_2016_docker' is up to
> date...
> ==> default: Verifying vmnet devices are healthy...
> ==> default: Preparing network adapters...
> WARNING: The VMX file for this box contains a setting that is
> automatically overwritten by Vagrant
> WARNING: when started. Vagrant will stop overwriting this setting in an
> upcoming release which may
> WARNING: prevent proper networking setup. Below is the detected VMX
> setting:
> WARNING:
> WARNING: ethernet0.pcislotnumber = "33"
> WARNING:
> WARNING: If networking fails to properly configure, it may require this
> VMX setting. It can be manually
> WARNING: applied via the Vagrantfile:
> WARNING:
> WARNING: Vagrant.configure(2) do |config|
> WARNING: config.vm.provider :vmare_workstation do |vmware|
> WARNING: vmware.vmx["ethernet0.pcislotnumber"] = "33"
> WARNING: end
> WARNING: end
> WARNING:
> WARNING: For more information: https://www.vagrantup.com/
> docs/vmware/boxes.html#vmx-whitelisting
> ==> default: Starting the VMware VM...
> ==> default: Waiting for the VM to receive an address...
> ==> default: Forwarding ports...
> default: -- 3389 => 3389
> default: -- 22 => 2222
> default: -- 5985 => 55985
> default: -- 5986 => 55986
> ==> default: Waiting for machine to boot. This may take a few minutes...
> ==> default: Stopping the VMware VM...
> ==> default: Deleting the VM...
> C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.1/
> plugins/communicators/winrm/helper.rb:41:in `winrm_info_invalid?':
> undefined method `start_with?' for 0:Integer (NoMethodError)
> from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.1/
> plugins/communicators/winrm/helper.rb:36:in `winrm_address'
> from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.1/
> plugins/communicators/winrm/helper.rb:21:in `winrm_info'
> from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.1/
> plugins/communicators/winrm/communicator.rb:37:in `block in
> wait_for_ready'
> from
> C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/timeout.rb:93:in
> `block in timeout'
> from
> C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/timeout.rb:33:in
> `block in catch'
> from
> C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/timeout.rb:33:in
> `catch'
> from
> C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/timeout.rb:33:in
> `catch'
> from
> C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/timeout.rb:108:in
> `timeout'
> from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.1/
> plugins/communicators/winrm/communicator.rb:31:in `wait_for_ready'
> from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.1/lib/
> vagrant/action/builtin/wait_for_communicator.rb:16:in `block in call'
> from C:/HashiCorp/Vagrant/embedded/gems/gems/logging-2.2.2/lib/
> logging/diagnostic_context.rb:474:in `block in
> create_with_logging_context'
>
> Did you ever actually got this working in practice, or is that a case of
> "should work in principle"?
>
> Cheers,
> Andrew
>
> On Monday, 20 November 2017 22:47:42 UTC+13, Alvaro Miranda Aguilera wrote:
>>
>> the first nic is by default.
>>
>> So you don't want to add a new nic, you can override the first one.
>>
>> have a look at this:
>> https://superuser.com/questions/957631/how-to-force-vagrant-
>> to-have-a-single-bridged-network-interface
>>
>> Alvaro
>>
>>
>> On Mon, Nov 20, 2017 at 1:55 AM, <[email protected]> wrote:
>>
>>> When I add this line to my vagrantfile:
>>>
>>> config.vm.network "public_network", bridge: "vmnet0"
>>>
>>> vagrant creates *second* adapter which is bridged.
>>> Both primary and secondary adaters seems to work fine in this
>>> configuration.
>>> I do not want second adapter I want the primary one to be bridged.
>>>
>>> How do I configure this?
>>>
>>> Vagrantfile to test:
>>>
>>> # -*- mode: ruby -*-
>>> # vi: set ft=ruby :
>>>
>>> Vagrant.configure("2") do |config|
>>> config.vm.box = "StefanScherer/windows_2016_docker"
>>>
>>> config.vm.network "public_network"
>>> config.vm.provider :vmware_workstation do |v|
>>> v.gui = true
>>> end
>>> end
>>>
>>>
>>>
>>> Cheers,
>>> Andrew
>>>
>>> --
>>> This mailing list is governed under the HashiCorp Community Guidelines -
>>> https://www.hashicorp.com/community-guidelines.html. Behavior in
>>> violation of those guidelines may result in your removal from this mailing
>>> list.
>>>
>>> GitHub Issues: https://github.com/mitchellh/vagrant/issues
>>> IRC: #vagrant on Freenode
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Vagrant" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/vagrant-up/f564595c-48f5-4dc3-ae48-067f09b2da0f%40googlegroups.com
>>> <https://groups.google.com/d/msgid/vagrant-up/f564595c-48f5-4dc3-ae48-067f09b2da0f%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Alvaro
>>
>> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/vagrant-up/30e5c933-2bd5-46c4-87dd-67fdfaf5e71d%40googlegroups.com
> <https://groups.google.com/d/msgid/vagrant-up/30e5c933-2bd5-46c4-87dd-67fdfaf5e71d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
Alvaro
--
This mailing list is governed under the HashiCorp Community Guidelines -
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of
those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vagrant-up/CAHqq0eyxqhn7vdANNHv%3DkoBctmiJgxrv5%2BwGthsA79W2PcBMdA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.