Permalink
Browse files

First draft attempt in getting support for VirtualBox

  • Loading branch information...
1 parent 5787ad6 commit 2595f1206c6d5214c80c6ee255185a91371370de @flavio-fernandes flavio-fernandes committed with Mar 30, 2015
Showing with 25 additions and 1 deletion.
  1. +2 −0 README.md
  2. +23 −1 vagrant/Vagrantfile
View
@@ -32,6 +32,8 @@ Please look in the [examples/](examples/) folder for usage. If none exist, pleas
* my [puppet-yum](https://github.com/purpleidea/puppet-yum) module (optional, built-in)
* pandoc (for building a pdf of the documentation)
+Note: If you are using Virtual-box as hypervisor, there is no need dependency on vagrant-libvirt.
+
## Patches:
This code may be a work in progress. The interfaces may change without notice.
Patches are welcome, but please be patient. They are best received by email.
View
@@ -674,7 +674,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
vm.vm.network :private_network,
:ip => ip,
:libvirt__dhcp_enabled => false,
- :libvirt__network_name => "#{namespace}"
+ :libvirt__network_name => "#{namespace}",
+ :virtualbox__intnet => "#{namespace}"
#
# box (pre-built base image)
@@ -961,6 +962,13 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
libvirt.memory = 1024
end
end
+ vm.vm.provider :virtualbox do |vb|
+ # make puppet server a bit fatter by default :P
+ if puppet and vm_puppet and h == 'puppet'
+ vb.customize ["modifyvm", :id, "--cpus", "2"]
+ vb.customize ["modifyvm", :id, "--memory", "1024"]
+ end
+ end
end
end
@@ -978,5 +986,19 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
libvirt.default_prefix = "#{namespace}" # set a prefix for your vm's...
end
+ #
+ # virtualbox
+ #
+ config.vm.provider :virtualbox do |vb|
+ # ref params: http://www.virtualbox.org/manual/ch08.html#vboxmanage-modifyvm
+ vb.customize ["modifyvm", :id, "--hwvirtex", "on"] # needed for kvm performance benefits !
+ # TODO: Find corresponding params in Virtual Box
+ # libvirt.connect_via_ssh = false
+ # libvirt.username = 'root'
+ # libvirt.storage_pool_name = 'default'
+ # #libvirt.default_network = 'default' # XXX: this does nothing
+ # libvirt.default_prefix = "#{namespace}" # set a prefix for your vm's...
+ end
+
end

0 comments on commit 2595f12

Please sign in to comment.