Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to use vagrant with Windows as guest.
When I use to configure a host only network with static ip, the setting won't work.
Here is my Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config| = "win08r2"
  config.vm.guest = :windows
  config.ssh.max_tries = 1
  config.ssh.timeout = 10
  config.vm.provider :virtualbox do |vb|
    vb.gui = true
  end :private_network, ip :"" :public_network

The ip of vm is something like 196.254.xx.xx or other, just not same with

Is there any problems with my vagrantfile?


share|improve this question

migrated from May 28 '13 at 12:14

This question came from our site for professional and enthusiast programmers.

According to the vagrant doc everything seems write - may be a problem with windows guests in general... may be you should open an issue at vagrant and ask there. – cmur2 May 28 '13 at 6:24

I could not get my CentOS vm to take an ip using vagrant's private network. It made a new interface with that ip, but wasn't using it. I ended up doing

config.vm.provider :virtualbox do |vb|
  vb.customize ["modifyvm", :id, "--memory", "3072", "--cpus", "2", "--natnet1", "10.252/16"]

Along with allocating some resources, this line will force virtualbox to use nat with 10.252.xx.yy. The default ip for the first interface is Each interface after increases xx by two. yy stays at 15. That is the behavior of virtualbox, not vagrant. Hopefully that helps somewhat.

share|improve this answer

This setup works for me: "hostonly", ""

If you want to access your host machine, you host machine ip address would be

share|improve this answer
Thanks, but this syntax works with previous version of Vagrantfile. – Toste Jun 13 '13 at 2:10
I second that, this does not work with Vagrant version 1.5.1. – blong Apr 8 '14 at 2:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .