vagrant-hypervnet
vagrant-hypervnet is a Vagrant plugin which extends Hyper-V provider implementing networks creation and
configuration.

Features
- Create Hyper-V switches.
- Add an host IP address for each private network
- Add a and configure a guest network adapter for each configured public or private network
- Optionally install and configure SSH server in windows guests.
- Optionally install and configure rsync (MSYS2) in windows guests.
Installation
$ vagrant plugin install vagrant-hypervnet
Configuration
Vagrant.configure("2") do |config|
config.hypervnet.install_ssh_server = true
config.hypervnet.install_rsync = true
config.hypervnet.folder_sync_on_provision = true
config.hypervnet.default_switch = "Default Switch"
config.vm.network :private_network, ip: "192.168.100.101", netmask: "255.255.255.0"
config.vm.network :private_network, ip: "192.168.102.101", netmask: "255.255.255.0" hyperv__bridge: "my-internal-network"
config.vm.network :private_network, ip: "192.168.101.101", netmask: "255.255.255.0" hyperv__private: "my-private-network"
config.vm.network :public_network, ip: "192.168.102.101", netmask: "255.255.255.0" hyperv__bridge: "my-external-network"
config.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: ".git"
end
Config options
install_ssh_server
(Boolean, default: true
): installs OpenSSH Server (Windows Capability) and inserts vagrant ssh key on windows guests.install_rsync
(Boolean, default: true
): installs MSYS2 and rsync on windows guests if an rsync synced folder is defined .folder_sync_on_provision
(Boolean, default: true
): if enabled invokes synced folders synchronization before provision.default_switch
(String, default: Default Switch
): Hyper-V switch connected to interface used by vagrant to communicate with the vm.
Usage
$ vagrant init
$ vagrant up --provider=hyperv
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request