From 0ba8a91e7fb30aeacab6b0f53cabb5e8773ea697 Mon Sep 17 00:00:00 2001 From: Rui Lopes Date: Sat, 28 Oct 2017 14:01:10 +0100 Subject: [PATCH] add support for the libvirt vagrant provider --- README.md | 3 ++- Vagrantfile | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f4b3bb0..90f1038 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,8 @@ Add the following entry to your `/etc/hosts` file: 192.168.56.3 nexus.example.com ``` -Run `vagrant up` to launch the environment. See its output to known how to login at the +Run `vagrant up --provider=virtualbox # or --provider=libvirt` to launch the environment. +See its output to known how to login at the [local Nexus home page](https://nexus.example.com) as `admin` (you can also login with one of the example accounts, e.g. `alice.doe` and password `password`). diff --git a/Vagrantfile b/Vagrantfile index 080f0f5..7642f3b 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,8 +1,19 @@ +# to make sure the nexus node is created before the other nodes, we +# have to force a --no-parallel execution. +ENV['VAGRANT_NO_PARALLEL'] = 'yes' + nexus_domain = 'nexus.example.com' nexus_ip = '192.168.56.3' Vagrant.configure(2) do |config| - config.vm.provider 'virtualbox' do |vb| + config.vm.provider :libvirt do |lv, config| + lv.memory = 2048 + lv.cpus = 2 + lv.cpu_mode = 'host-passthrough' + lv.keymap = 'pt' + end + + config.vm.provider :virtualbox do |vb| vb.linked_clone = true vb.cpus = 2 vb.memory = 2048 @@ -21,6 +32,15 @@ Vagrant.configure(2) do |config| config.vm.define :windows do |config| config.vm.box = 'windows-2016-amd64' config.vm.network 'private_network', ip: '192.168.56.4' + # replace the default synced_folder with something that works in cygwin. + # NB for some reason, this does not work when placed in the base box Vagrantfile. + config.vm.provider :libvirt do |lv, config| + config.vm.synced_folder '.', '/vagrant', disabled: true + config.vm.synced_folder '.', '/cygdrive/c/vagrant', type: 'rsync', rsync__exclude: [ + '.vagrant/', + '.git/', + '*.box'] + end config.vm.provider :virtualbox do |v, override| v.customize ['modifyvm', :id, '--vram', 64] v.customize ['modifyvm', :id, '--clipboard', 'bidirectional']