vagrant-libvirt 0.0.40 → 0.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. metadata +13 -103
  3. data/.coveralls.yml +0 -1
  4. data/.github/issue_template.md +0 -37
  5. data/.gitignore +0 -21
  6. data/.travis.yml +0 -28
  7. data/CHANGELOG.md +0 -99
  8. data/Gemfile +0 -27
  9. data/LICENSE +0 -22
  10. data/README.md +0 -1311
  11. data/Rakefile +0 -8
  12. data/example_box/README.md +0 -29
  13. data/example_box/Vagrantfile +0 -60
  14. data/example_box/metadata.json +0 -5
  15. data/lib/vagrant-libvirt.rb +0 -29
  16. data/lib/vagrant-libvirt/action.rb +0 -362
  17. data/lib/vagrant-libvirt/action/create_domain.rb +0 -313
  18. data/lib/vagrant-libvirt/action/create_domain_volume.rb +0 -87
  19. data/lib/vagrant-libvirt/action/create_network_interfaces.rb +0 -294
  20. data/lib/vagrant-libvirt/action/create_networks.rb +0 -353
  21. data/lib/vagrant-libvirt/action/destroy_domain.rb +0 -83
  22. data/lib/vagrant-libvirt/action/destroy_networks.rb +0 -95
  23. data/lib/vagrant-libvirt/action/forward_ports.rb +0 -221
  24. data/lib/vagrant-libvirt/action/halt_domain.rb +0 -35
  25. data/lib/vagrant-libvirt/action/handle_box_image.rb +0 -156
  26. data/lib/vagrant-libvirt/action/handle_storage_pool.rb +0 -57
  27. data/lib/vagrant-libvirt/action/is_created.rb +0 -18
  28. data/lib/vagrant-libvirt/action/is_running.rb +0 -21
  29. data/lib/vagrant-libvirt/action/is_suspended.rb +0 -42
  30. data/lib/vagrant-libvirt/action/message_already_created.rb +0 -16
  31. data/lib/vagrant-libvirt/action/message_not_created.rb +0 -16
  32. data/lib/vagrant-libvirt/action/message_not_running.rb +0 -16
  33. data/lib/vagrant-libvirt/action/message_not_suspended.rb +0 -16
  34. data/lib/vagrant-libvirt/action/package_domain.rb +0 -105
  35. data/lib/vagrant-libvirt/action/prepare_nfs_settings.rb +0 -94
  36. data/lib/vagrant-libvirt/action/prepare_nfs_valid_ids.rb +0 -17
  37. data/lib/vagrant-libvirt/action/prune_nfs_exports.rb +0 -27
  38. data/lib/vagrant-libvirt/action/read_mac_addresses.rb +0 -40
  39. data/lib/vagrant-libvirt/action/remove_libvirt_image.rb +0 -20
  40. data/lib/vagrant-libvirt/action/remove_stale_volume.rb +0 -50
  41. data/lib/vagrant-libvirt/action/resume_domain.rb +0 -34
  42. data/lib/vagrant-libvirt/action/set_boot_order.rb +0 -109
  43. data/lib/vagrant-libvirt/action/set_name_of_domain.rb +0 -64
  44. data/lib/vagrant-libvirt/action/share_folders.rb +0 -71
  45. data/lib/vagrant-libvirt/action/start_domain.rb +0 -303
  46. data/lib/vagrant-libvirt/action/suspend_domain.rb +0 -40
  47. data/lib/vagrant-libvirt/action/wait_till_up.rb +0 -102
  48. data/lib/vagrant-libvirt/cap/mount_p9.rb +0 -42
  49. data/lib/vagrant-libvirt/cap/nic_mac_addresses.rb +0 -17
  50. data/lib/vagrant-libvirt/cap/synced_folder.rb +0 -113
  51. data/lib/vagrant-libvirt/config.rb +0 -698
  52. data/lib/vagrant-libvirt/driver.rb +0 -118
  53. data/lib/vagrant-libvirt/errors.rb +0 -149
  54. data/lib/vagrant-libvirt/plugin.rb +0 -92
  55. data/lib/vagrant-libvirt/provider.rb +0 -130
  56. data/lib/vagrant-libvirt/templates/default_storage_pool.xml.erb +0 -13
  57. data/lib/vagrant-libvirt/templates/domain.xml.erb +0 -229
  58. data/lib/vagrant-libvirt/templates/private_network.xml.erb +0 -34
  59. data/lib/vagrant-libvirt/templates/public_interface.xml.erb +0 -23
  60. data/lib/vagrant-libvirt/util.rb +0 -11
  61. data/lib/vagrant-libvirt/util/collection.rb +0 -19
  62. data/lib/vagrant-libvirt/util/erb_template.rb +0 -22
  63. data/lib/vagrant-libvirt/util/error_codes.rb +0 -100
  64. data/lib/vagrant-libvirt/util/network_util.rb +0 -138
  65. data/lib/vagrant-libvirt/util/timer.rb +0 -17
  66. data/lib/vagrant-libvirt/version.rb +0 -5
  67. data/locales/en.yml +0 -159
  68. data/spec/spec_helper.rb +0 -9
  69. data/spec/support/environment_helper.rb +0 -46
  70. data/spec/support/libvirt_context.rb +0 -30
  71. data/spec/support/sharedcontext.rb +0 -34
  72. data/spec/unit/action/destroy_domain_spec.rb +0 -97
  73. data/spec/unit/action/set_name_of_domain_spec.rb +0 -21
  74. data/spec/unit/action/wait_till_up_spec.rb +0 -127
  75. data/spec/unit/config_spec.rb +0 -106
  76. data/spec/unit/templates/domain_all_settings.xml +0 -133
  77. data/spec/unit/templates/domain_defaults.xml +0 -46
  78. data/spec/unit/templates/domain_spec.rb +0 -75
  79. data/tools/create_box.sh +0 -130
  80. data/tools/prepare_redhat_for_box.sh +0 -119
  81. data/vagrant-libvirt.gemspec +0 -28
data/README.md DELETED
@@ -1,1311 +0,0 @@
1
- # Vagrant Libvirt Provider
2
-
3
- [![Join the chat at https://gitter.im/vagrant-libvirt/vagrant-libvirt](https://badges.gitter.im/vagrant-libvirt/vagrant-libvirt.svg)](https://gitter.im/vagrant-libvirt/vagrant-libvirt?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4
- [![Build Status](https://travis-ci.org/vagrant-libvirt/vagrant-libvirt.svg)](https://travis-ci.org/vagrant-libvirt/vagrant-libvirt)
5
- [![Coverage Status](https://coveralls.io/repos/github/vagrant-libvirt/vagrant-libvirt/badge.svg?branch=master)](https://coveralls.io/github/vagrant-libvirt/vagrant-libvirt?branch=master)
6
-
7
- This is a [Vagrant](http://www.vagrantup.com) plugin that adds an
8
- [Libvirt](http://libvirt.org) provider to Vagrant, allowing Vagrant to
9
- control and provision machines via Libvirt toolkit.
10
-
11
- **Note:** Actual version is still a development one. Feedback is welcome and
12
- can help a lot :-)
13
-
14
- ## QA status
15
-
16
- We periodically test basic functionality for vagrant-libvirt on various distributions.
17
- In the table below, build passing means that specific version combination of Vagrant + Vagrant-libvirt was installed correctly and `vagrant up` is working. Click the badge to see the log.
18
-
19
- |Vagrant|Vagrant-libvirt|ubuntu-12.04|ubuntu-14.04|ubuntu-16.04|debian-8|centos-6|centos-7|fedora-21|fedora-22|fedora-23|fedora-24|arch|
20
- |---|---|---|---|---|---|---|---|---|---|---|---|---|
21
- |1.9.1|master|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=ubuntu-12.04/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=ubuntu-12.04/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=ubuntu-14.04/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=ubuntu-14.04/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=ubuntu-16.04/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=ubuntu-16.04/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=debian-8/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=debian-8/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=centos-6/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=centos-6/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=centos-7/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=centos-7/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=fedora-21/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=fedora-21/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=fedora-22/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=fedora-22/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=fedora-23/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=fedora-23/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=fedora-24/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=fedora-24/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=arch/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.9.1,distro=arch/lastBuild/consoleText)|
22
- |1.9.1|0.0.37|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=ubuntu-12.04/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=ubuntu-12.04/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=ubuntu-14.04/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=ubuntu-14.04/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=ubuntu-16.04/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=ubuntu-16.04/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=debian-8/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=debian-8/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=centos-6/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=centos-6/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=centos-7/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=centos-7/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=fedora-21/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=fedora-21/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=fedora-22/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=fedora-22/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=fedora-23/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=fedora-23/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=fedora-24/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=fedora-24/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=arch/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.9.1,distro=arch/lastBuild/consoleText)|
23
- |1.9.1|0.0.35|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=ubuntu-12.04/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=ubuntu-12.04/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=ubuntu-14.04/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=ubuntu-14.04/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=ubuntu-16.04/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=ubuntu-16.04/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=debian-8/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=debian-8/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=centos-6/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=centos-6/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=centos-7/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=centos-7/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=fedora-21/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=fedora-21/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=fedora-22/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=fedora-22/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=fedora-23/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=fedora-23/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=fedora-24/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=fedora-24/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=arch/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.9.1,distro=arch/lastBuild/consoleText)|
24
- |1.8.7|master|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=ubuntu-12.04/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=ubuntu-12.04/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=ubuntu-14.04/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=ubuntu-14.04/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=ubuntu-16.04/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=ubuntu-16.04/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=debian-8/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=debian-8/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=centos-6/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=centos-6/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=centos-7/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=centos-7/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=fedora-21/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=fedora-21/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=fedora-22/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=fedora-22/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=fedora-23/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=fedora-23/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=fedora-24/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=fedora-24/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=arch/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=master,qa_vagrant_version=1.8.7,distro=arch/lastBuild/consoleText)|
25
- |1.8.7|0.0.37|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=ubuntu-12.04/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=ubuntu-12.04/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=ubuntu-14.04/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=ubuntu-14.04/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=ubuntu-16.04/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=ubuntu-16.04/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=debian-8/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=debian-8/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=centos-6/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=centos-6/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=centos-7/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=centos-7/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=fedora-21/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=fedora-21/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=fedora-22/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=fedora-22/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=fedora-23/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=fedora-23/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=fedora-24/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=fedora-24/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=arch/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.37,qa_vagrant_version=1.8.7,distro=arch/lastBuild/consoleText)|
26
- |1.8.7|0.0.35|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=ubuntu-12.04/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=ubuntu-12.04/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=ubuntu-14.04/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=ubuntu-14.04/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=ubuntu-16.04/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=ubuntu-16.04/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=debian-8/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=debian-8/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=centos-6/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=centos-6/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=centos-7/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=centos-7/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=fedora-21/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=fedora-21/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=fedora-22/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=fedora-22/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=fedora-23/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=fedora-23/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=fedora-24/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=fedora-24/lastBuild/consoleText)|[![Build Status](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=arch/badge/icon)](https://jenkins.infernix.net/job/vagrant-libvirt-qa/qa_vagrant_libvirt_version=0.0.35,qa_vagrant_version=1.8.7,distro=arch/lastBuild/consoleText)|
27
-
28
- ## Index
29
-
30
-
31
- - [Features](#features)
32
- - [Future work](#future-work)
33
- - [Installation](#installation)
34
- - [Possible problems with plugin installation on Linux](#possible-problems-with-plugin-installation-on-linux)
35
- - [Vagrant Project Preparation](#vagrant-project-preparation)
36
- - [Add Box](#add-box)
37
- - [Create Vagrantfile](#create-vagrantfile)
38
- - [Start VM](#start-vm)
39
- - [How Project Is Created](#how-project-is-created)
40
- - [Libvirt Configuration](#libvirt-configuration)
41
- - [Provider Options](#provider-options)
42
- - [Domain Specific Options](#domain-specific-options)
43
- - [Reload behavior](#reload-behavior)
44
- - [Networks](#networks)
45
- - [Private Network Options](#private-network-options)
46
- - [Public Network Options](#public-network-options)
47
- - [Management Network](#management-network)
48
- - [Additional Disks](#additional-disks)
49
- - [Reload behavior](#reload-behavior-1)
50
- - [CDROMs](#cdroms)
51
- - [Input](#input)
52
- - [PCI device passthrough](#pci-device-passthrough)
53
- - [USB Redirector Devices](#usb-redirector-devices)
54
- - [Random number generator passthrough](#random-number-generator-passthrough)
55
- - [Watchdog·Device](#watchdog-device)
56
- - [Smartcard device](#smartcard-device)
57
- - [CPU Features](#cpu-features)
58
- - [No box and PXE boot](#no-box-and-pxe-boot)
59
- - [SSH Access To VM](#ssh-access-to-vm)
60
- - [Forwarded Ports](#forwarded-ports)
61
- - [Synced Folders](#synced-folders)
62
- - [Customized Graphics](#customized-graphics)
63
- - [Box Format](#box-format)
64
- - [Create Box](#create-box)
65
- - [Development](#development)
66
- - [Contributing](#contributing)
67
-
68
- ## Features
69
-
70
- * Control local Libvirt hypervisors.
71
- * Vagrant `up`, `destroy`, `suspend`, `resume`, `halt`, `ssh`, `reload`,
72
- `package` and `provision` commands.
73
- * Upload box image (qcow2 format) to Libvirt storage pool.
74
- * Create volume as COW diff image for domains.
75
- * Create private networks.
76
- * Create and boot Libvirt domains.
77
- * SSH into domains.
78
- * Setup hostname and network interfaces.
79
- * Provision domains with any built-in Vagrant provisioner.
80
- * Synced folder support via `rsync`, `nfs` or `9p`.
81
- * Snapshots via [sahara](https://github.com/jedi4ever/sahara).
82
- * Package caching via
83
- [vagrant-cachier](http://fgrehm.viewdocs.io/vagrant-cachier/).
84
- * Use boxes from other Vagrant providers via
85
- [vagrant-mutate](https://github.com/sciurus/vagrant-mutate).
86
- * Support VMs with no box for PXE boot purposes (Vagrant 1.6 and up)
87
-
88
- ## Future work
89
-
90
- * Take a look at [open
91
- issues](https://github.com/vagrant-libvirt/vagrant-libvirt/issues?state=open).
92
-
93
- ## Installation
94
-
95
- First, you should have both qemu and libvirt installed if you plan to run VMs
96
- on your local system. For instructions, refer to your linux distribution's
97
- documentation.
98
-
99
- **NOTE:** Before you start using Vagrant-libvirt, please make sure your libvirt
100
- and qemu installation is working correctly and you are able to create qemu or
101
- kvm type virtual machines with `virsh` or `virt-manager`.
102
-
103
- Next, you must have [Vagrant
104
- installed](http://docs.vagrantup.com/v2/installation/index.html).
105
- Vagrant-libvirt supports Vagrant 1.5, 1.6, 1.7 and 1.8.
106
- *We only test with the upstream version!* If you decide to install your distros
107
- version and you run into problems, as a first step you should switch to upstream.
108
-
109
- Now you need to make sure your have all the build dependencies installed for
110
- vagrant-libvirt. This depends on your distro. An overview:
111
-
112
- * Ubuntu 12.04/14.04/16.04, Debian:
113
- ```shell
114
- apt-get build-dep vagrant ruby-libvirt
115
- apt-get install qemu libvirt-bin ebtables dnsmasq
116
- apt-get install libxslt-dev libxml2-dev libvirt-dev zlib1g-dev ruby-dev
117
- ```
118
-
119
- (It is possible some users will already have libraries from the third line installed, but this is the way to make it work OOTB.)
120
-
121
- * CentOS 6, 7, Fedora 21:
122
- ```shell
123
- yum install qemu libvirt libvirt-devel ruby-devel gcc qemu-kvm
124
- ```
125
-
126
- * Fedora 22 and up:
127
- ```shell
128
- dnf -y install qemu libvirt libvirt-devel ruby-devel gcc
129
- ```
130
-
131
- * Arch linux: please read the related [ArchWiki](https://wiki.archlinux.org/index.php/Vagrant#vagrant-libvirt) page.
132
- ```shell
133
- pacman -S vagrant
134
- ```
135
-
136
- Now you're ready to install vagrant-libvirt using standard [Vagrant
137
- plugin](http://docs.vagrantup.com/v2/plugins/usage.html) installation methods.
138
-
139
- ```shell
140
- $ vagrant plugin install vagrant-libvirt
141
- ```
142
-
143
- ### Possible problems with plugin installation on Linux
144
-
145
- In case of problems with building nokogiri and ruby-libvirt gem, install
146
- missing development libraries for libxslt, libxml2 and libvirt.
147
-
148
-
149
- On Ubuntu, Debian, make sure you are running all three of the `apt` commands above with `sudo`.
150
-
151
-
152
- On RedHat, Centos, Fedora, ...
153
-
154
- ```shell
155
- $ sudo dnf install libxslt-devel libxml2-devel libvirt-devel \
156
- libguestfs-tools-c ruby-devel gcc
157
- ```
158
-
159
- On Arch linux it is recommended to follow [steps from ArchWiki](https://wiki.archlinux.org/index.php/Vagrant#vagrant-libvirt).
160
-
161
- If have problem with installation - check your linker. It should be `ld.gold`:
162
-
163
- ```shell
164
- sudo alternatives --set ld /usr/bin/ld.gold
165
- # OR
166
- sudo ln -fs /usr/bin/ld.gold /usr/bin/ld
167
- ```
168
-
169
- If you have issues building ruby-libvirt, try the following:
170
- ```shell
171
- CONFIGURE_ARGS='with-ldflags=-L/opt/vagrant/embedded/lib with-libvirt-include=/usr/include/libvirt with-libvirt-lib=/usr/lib' GEM_HOME=~/.vagrant.d/gems GEM_PATH=$GEM_HOME:/opt/vagrant/embedded/gems PATH=/opt/vagrant/embedded/bin:$PATH vagrant plugin install vagrant-libvirt
172
- ```
173
-
174
- ## Vagrant Project Preparation
175
-
176
- ### Add Box
177
-
178
- After installing the plugin (instructions above), the quickest way to get
179
- started is to add Libvirt box and specify all the details manually within a
180
- `config.vm.provider` block. So first, add Libvirt box using any name you want.
181
- You can find more libvirt ready boxes at
182
- [Atlas](https://atlas.hashicorp.com/boxes/search?provider=libvirt). For
183
- example:
184
-
185
- ```shell
186
- vagrant init fedora/24-cloud-base
187
- ```
188
-
189
- ### Create Vagrantfile
190
-
191
- And then make a Vagrantfile that looks like the following, filling in your
192
- information where necessary. For example:
193
-
194
- ```ruby
195
- Vagrant.configure("2") do |config|
196
- config.vm.define :test_vm do |test_vm|
197
- test_vm.vm.box = "fedora/24-cloud-base"
198
- end
199
- end
200
- ```
201
-
202
- ### Start VM
203
-
204
- In prepared project directory, run following command:
205
-
206
- ```shell
207
- $ vagrant up --provider=libvirt
208
- ```
209
-
210
- Vagrant needs to know that we want to use Libvirt and not default VirtualBox.
211
- That's why there is `--provider=libvirt` option specified. Other way to tell
212
- Vagrant to use Libvirt provider is to setup environment variable
213
-
214
- ```shell
215
- export VAGRANT_DEFAULT_PROVIDER=libvirt
216
- ```
217
-
218
- ### How Project Is Created
219
-
220
- Vagrant goes through steps below when creating new project:
221
-
222
- 1. Connect to Libvirt localy or remotely via SSH.
223
- 2. Check if box image is available in Libvirt storage pool. If not, upload it
224
- to remote Libvirt storage pool as new volume.
225
- 3. Create COW diff image of base box image for new Libvirt domain.
226
- 4. Create and start new domain on Libvirt host.
227
- 5. Check for DHCP lease from dnsmasq server.
228
- 6. Wait till SSH is available.
229
- 7. Sync folders and run Vagrant provisioner on new domain if setup in
230
- Vagrantfile.
231
-
232
- ### Libvirt Configuration
233
-
234
- ### Provider Options
235
-
236
- Although it should work without any configuration for most people, this
237
- provider exposes quite a few provider-specific configuration options. The
238
- following options allow you to configure how vagrant-libvirt connects to
239
- libvirt, and are used to generate the [libvirt connection
240
- URI](http://libvirt.org/uri.html):
241
-
242
- * `driver` - A hypervisor name to access. For now only kvm and qemu are
243
- supported
244
- * `host` - The name of the server, where libvirtd is running
245
- * `connect_via_ssh` - If use ssh tunnel to connect to Libvirt. Absolutely
246
- needed to access libvirt on remote host. It will not be able to get the IP
247
- address of a started VM otherwise.
248
- * `username` - Username and password to access Libvirt
249
- * `password` - Password to access Libvirt
250
- * `id_ssh_key_file` - If not nil, uses this ssh private key to access Libvirt.
251
- Default is `$HOME/.ssh/id_rsa`. Prepends `$HOME/.ssh/` if no directory
252
- * `socket` - Path to the libvirt unix socket (e.g.
253
- `/var/run/libvirt/libvirt-sock`)
254
- * `uri` - For advanced usage. Directly specifies what libvirt connection URI
255
- vagrant-libvirt should use. Overrides all other connection configuration
256
- options
257
-
258
- Connection-independent options:
259
-
260
- * `storage_pool_name` - Libvirt storage pool name, where box image and instance
261
- snapshots will be stored.
262
-
263
- For example:
264
-
265
- ```ruby
266
- Vagrant.configure("2") do |config|
267
- config.vm.provider :libvirt do |libvirt|
268
- libvirt.host = "example.com"
269
- end
270
- end
271
- ```
272
-
273
- ### Domain Specific Options
274
-
275
- * `disk_bus` - The type of disk device to emulate. Defaults to virtio if not
276
- set. Possible values are documented in libvirt's [description for
277
- _target_](http://libvirt.org/formatdomain.html#elementsDisks). NOTE: this
278
- option applies only to disks associated with a box image. To set the bus type
279
- on additional disks, see the [Additional Disks](#additional-disks) section.
280
- * `disk_device` - The disk device to emulate. Defaults to vda if not
281
- set, which should be fine for paravirtualized guests, but some fully
282
- virtualized guests may require hda. NOTE: this option also applies only to
283
- disks associated with a box image.
284
- * `nic_model_type` - parameter specifies the model of the network adapter when
285
- you create a domain value by default virtio KVM believe possible values, see
286
- the [documentation for
287
- libvirt](https://libvirt.org/formatdomain.html#elementsNICSModel).
288
- * `memory` - Amount of memory in MBytes. Defaults to 512 if not set.
289
- * `cpus` - Number of virtual cpus. Defaults to 1 if not set.
290
- * `nested` - [Enable nested
291
- virtualization](https://github.com/torvalds/linux/blob/master/Documentation/virtual/kvm/nested-vmx.txt).
292
- Default is false.
293
- * `cpu_mode` - [CPU emulation
294
- mode](https://libvirt.org/formatdomain.html#elementsCPU). Defaults to
295
- 'host-model' if not set. Allowed values: host-model, host-passthrough,
296
- custom.
297
- * `cpu_model` - CPU Model. Defaults to 'qemu64' if not set and `cpu_mode` is
298
- `custom` and to '' otherwise. This can really only be used when setting
299
- `cpu_mode` to `custom`.
300
- * `cpu_fallback` - Whether to allow libvirt to fall back to a CPU model close
301
- to the specified model if features in the guest CPU are not supported on the
302
- host. Defaults to 'allow' if not set. Allowed values: `allow`, `forbid`.
303
- * `numa_nodes` - Number of NUMA nodes on guest. Must be a factor of `cpu`.
304
- * `loader` - Sets path to custom UEFI loader.
305
- * `volume_cache` - Controls the cache mechanism. Possible values are "default",
306
- "none", "writethrough", "writeback", "directsync" and "unsafe". [See
307
- driver->cache in libvirt
308
- documentation](http://libvirt.org/formatdomain.html#elementsDisks).
309
- * `kernel` - To launch the guest with a kernel residing on host filesystems.
310
- Equivalent to qemu `-kernel`.
311
- * `initrd` - To specify the initramfs/initrd to use for the guest. Equivalent
312
- to qemu `-initrd`.
313
- * `random_hostname` - To create a domain name with extra information on the end
314
- to prevent hostname conflicts.
315
- * `cmd_line` - Arguments passed on to the guest kernel initramfs or initrd to
316
- use. Equivalent to qemu `-append`.
317
- * `graphics_type` - Sets the protocol used to expose the guest display.
318
- Defaults to `vnc`. Possible values are "sdl", "curses", "none", "gtk", "vnc"
319
- or "spice".
320
- * `graphics_port` - Sets the port for the display protocol to bind to.
321
- Defaults to 5900.
322
- * `graphics_ip` - Sets the IP for the display protocol to bind to. Defaults to
323
- "127.0.0.1".
324
- * `graphics_passwd` - Sets the password for the display protocol. Working for
325
- vnc and spice. by default working without passsword.
326
- * `graphics_autoport` - Sets autoport for graphics, libvirt in this case
327
- ignores graphics_port value, Defaults to 'yes'. Possible value are "yes" and
328
- "no"
329
- * `keymap` - Set keymap for vm. default: en-us
330
- * `kvm_hidden` - [Hide the hypervisor from the
331
- guest](https://libvirt.org/formatdomain.html#elementsFeatures). Useful for
332
- [GPU passthrough](#pci-device-passthrough) on stubborn drivers. Default is false.
333
- * `video_type` - Sets the graphics card type exposed to the guest. Defaults to
334
- "cirrus". [Possible
335
- values](http://libvirt.org/formatdomain.html#elementsVideo) are "vga",
336
- "cirrus", "vmvga", "xen", "vbox", or "qxl".
337
- * `video_vram` - Used by some graphics card types to vary the amount of RAM
338
- dedicated to video. Defaults to 9216.
339
- * `sound_type` - [Set the virtual sound card](https://libvirt.org/formatdomain.html#elementsSound)
340
- Defaults to "ich6".
341
- * `machine_type` - Sets machine type. Equivalent to qemu `-machine`. Use
342
- `qemu-system-x86_64 -machine help` to get a list of supported machines.
343
- * `machine_arch` - Sets machine architecture. This helps libvirt to determine
344
- the correct emulator type. Possible values depend on your version of qemu.
345
- For possible values, see which emulator executable `qemu-system-*` your
346
- system provides. Common examples are `aarch64`, `alpha`, `arm`, `cris`,
347
- `i386`, `lm32`, `m68k`, `microblaze`, `microblazeel`, `mips`, `mips64`,
348
- `mips64el`, `mipsel`, `moxie`, `or32`, `ppc`, `ppc64`, `ppcemb`, `s390x`,
349
- `sh4`, `sh4eb`, `sparc`, `sparc64`, `tricore`, `unicore32`, `x86_64`,
350
- `xtensa`, `xtensaeb`.
351
- * `machine_virtual_size` - Sets the disk size in GB for the machine overriding
352
- the default specified in the box. Allows boxes to defined with a minimal size
353
- disk by default and to be grown to a larger size at creation time. Will
354
- ignore sizes smaller than the size specified by the box metadata. Note that
355
- currently there is no support for automatically resizing the filesystem to
356
- take advantage of the larger disk.
357
- * `emulator_path` - Explicitly select which device model emulator to use by
358
- providing the path, e.g. `/usr/bin/qemu-system-x86_64`. This is especially
359
- useful on systems that fail to select it automatically based on
360
- `machine_arch` which then results in a capability error.
361
- * `boot` - Change the boot order and enables the boot menu. Possible options
362
- are "hd", "network", "cdrom". Defaults to "hd" with boot menu disabled. When
363
- "network" is set without "hd", only all NICs will be tried; see below for
364
- more detail.
365
- * `nic_adapter_count` - Defaults to '8'. Only use case for increasing this
366
- count is for VMs that virtualize switches such as Cumulus Linux. Max value
367
- for Cumulus Linux VMs is 33.
368
- * `uuid` - Force a domain UUID. Defaults to autogenerated value by libvirt if
369
- not set.
370
- * `suspend_mode` - What is done on vagrant suspend. Possible values: 'pause',
371
- 'managedsave'. Pause mode executes a la `virsh suspend`, which just pauses
372
- execution of a VM, not freeing resources. Managed save mode does a la `virsh
373
- managedsave` which frees resources suspending a domain.
374
- * `tpm_model` - The model of the TPM to which you wish to connect.
375
- * `tpm_type` - The type of TPM device to which you are connecting.
376
- * `tpm_path` - The path to the TPM device on the host system.
377
- * `dtb` - The device tree blob file, mostly used for non-x86 platforms. In case
378
- the device tree isn't added in-line to the kernel, it can be manually
379
- specified here.
380
- * `autostart` - Automatically start the domain when the host boots. Defaults to
381
- 'false'.
382
- * `channel` - [libvirt
383
- channels](https://libvirt.org/formatdomain.html#elementCharChannel).
384
- Configure a private communication channel between the host and guest, e.g.
385
- for use by the [qemu guest
386
- agent](http://wiki.libvirt.org/page/Qemu_guest_agent) and the Spice/QXL
387
- graphics type.
388
- * `mgmt_attach` - Decide if VM has interface in mgmt network. If set to 'false'
389
- it is not possible to communicate with VM through `vagrant ssh` or run
390
- provisioning. Setting to 'false' is only possible when VM doesn't use box.
391
- Defaults set to 'true'.
392
-
393
- Specific domain settings can be set for each domain separately in multi-VM
394
- environment. Example below shows a part of Vagrantfile, where specific options
395
- are set for dbserver domain.
396
-
397
- ```ruby
398
- Vagrant.configure("2") do |config|
399
- config.vm.define :dbserver do |dbserver|
400
- dbserver.vm.box = "centos64"
401
- dbserver.vm.provider :libvirt do |domain|
402
- domain.memory = 2048
403
- domain.cpus = 2
404
- domain.nested = true
405
- domain.volume_cache = 'none'
406
- end
407
- end
408
-
409
- # ...
410
- ```
411
-
412
- The following example shows part of a Vagrantfile that enables the VM to boot
413
- from a network interface first and a hard disk second. This could be used to
414
- run VMs that are meant to be a PXE booted machines. Be aware that if `hd` is
415
- not specified as a boot option, it will never be tried.
416
-
417
- ```ruby
418
- Vagrant.configure("2") do |config|
419
- config.vm.define :pxeclient do |pxeclient|
420
- pxeclient.vm.box = "centos64"
421
- pxeclient.vm.provider :libvirt do |domain|
422
- domain.boot 'network'
423
- domain.boot 'hd'
424
- end
425
- end
426
-
427
- # ...
428
- ```
429
-
430
- #### Reload behavior
431
-
432
- On `vagrant reload` the following domain specific attributes are updated in
433
- defined domain:
434
-
435
- * `disk_bus` - Is updated only on disks. It skips CDROMs
436
- * `nic_model_type` - Updated
437
- * `memory` - Updated
438
- * `cpus` - Updated
439
- * `nested` - Updated
440
- * `cpu_mode` - Updated. Pay attention that custom mode is not supported
441
- * `graphics_type` - Updated
442
- * `graphics_port` - Updated
443
- * `graphics_ip` - Updated
444
- * `graphics_passwd` - Updated
445
- * `graphics_autoport` - Updated
446
- * `keymap` - Updated
447
- * `video_type` - Updated
448
- * `video_vram` - Updated
449
- * `tpm_model` - Updated
450
- * `tpm_type` - Updated
451
- * `tpm_path` - Updated
452
-
453
- ## Networks
454
-
455
- Networking features in the form of `config.vm.network` support private networks
456
- concept. It supports both the virtual network switch routing types and the
457
- point to point Guest OS to Guest OS setting using UDP/Mcast/TCP tunnel
458
- interfaces.
459
-
460
- http://wiki.libvirt.org/page/VirtualNetworking
461
-
462
- https://libvirt.org/formatdomain.html#elementsNICSTCP
463
-
464
- http://libvirt.org/formatdomain.html#elementsNICSMulticast
465
-
466
- http://libvirt.org/formatdomain.html#elementsNICSUDP _(in libvirt v1.2.20 and higher)_
467
-
468
- Public Network interfaces are currently implemented using the macvtap driver.
469
- The macvtap driver is only available with the Linux Kernel version >= 2.6.24.
470
- See the following libvirt documentation for the details of the macvtap usage.
471
-
472
- http://www.libvirt.org/formatdomain.html#elementsNICSDirect
473
-
474
- An examples of network interface definitions:
475
-
476
- ```ruby
477
- # Private network using virtual network switching
478
- config.vm.define :test_vm1 do |test_vm1|
479
- test_vm1.vm.network :private_network, :ip => "10.20.30.40"
480
- end
481
-
482
- # Private network. Point to Point between 2 Guest OS using a TCP tunnel
483
- # Guest 1
484
- config.vm.define :test_vm1 do |test_vm1|
485
- test_vm1.vm.network :private_network,
486
- :libvirt__tunnel_type => 'server',
487
- # default is 127.0.0.1 if omitted
488
- # :libvirt__tunnel_ip => '127.0.0.1',
489
- :libvirt__tunnel_port => '11111'
490
- # network with ipv6 support
491
- test_vm1.vm.network :private_network,
492
- :ip => "10.20.5.42",
493
- :libvirt__guest_ipv6 => "yes",
494
- :libvirt__ipv6_address => "2001:db8:ca2:6::1",
495
- :libvirt__ipv6_prefix => "64"
496
-
497
- # Guest 2
498
- config.vm.define :test_vm2 do |test_vm2|
499
- test_vm2.vm.network :private_network,
500
- :libvirt__tunnel_type => 'client',
501
- # default is 127.0.0.1 if omitted
502
- # :libvirt__tunnel_ip => '127.0.0.1',
503
- :libvirt__tunnel_port => '11111'
504
- # network with ipv6 support
505
- test_vm2.vm.network :private_network,
506
- :ip => "10.20.5.45",
507
- :libvirt__guest_ipv6 => "yes",
508
- :libvirt__ipv6_address => "2001:db8:ca2:6::1",
509
- :libvirt__ipv6_prefix => "64"
510
-
511
-
512
- # Public Network
513
- config.vm.define :test_vm1 do |test_vm1|
514
- test_vm1.vm.network :public_network,
515
- :dev => "virbr0",
516
- :mode => "bridge",
517
- :type => "bridge"
518
- end
519
- ```
520
-
521
- In example below, one network interface is configured for VM `test_vm1`. After
522
- you run `vagrant up`, VM will be accessible on IP address `10.20.30.40`. So if
523
- you install a web server via provisioner, you will be able to access your
524
- testing server on `http://10.20.30.40` URL. But beware that this address is
525
- private to libvirt host only. It's not visible outside of the hypervisor box.
526
-
527
- If network `10.20.30.0/24` doesn't exist, provider will create it. By default
528
- created networks are NATed to outside world, so your VM will be able to connect
529
- to the internet (if hypervisor can). And by default, DHCP is offering addresses
530
- on newly created networks.
531
-
532
- The second interface is created and bridged into the physical device `eth0`.
533
- This mechanism uses the macvtap Kernel driver and therefore does not require an
534
- existing bridge device. This configuration assumes that DHCP and DNS services
535
- are being provided by the public network. This public interface should be
536
- reachable by anyone with access to the public network.
537
-
538
- ### Private Network Options
539
-
540
- *Note: These options are not applicable to public network interfaces.*
541
-
542
- There is a way to pass specific options for libvirt provider when using
543
- `config.vm.network` to configure new network interface. Each parameter name
544
- starts with `libvirt__` string. Here is a list of those options:
545
-
546
- * `:libvirt__network_name` - Name of libvirt network to connect to. By default,
547
- network 'default' is used.
548
- * `:libvirt__netmask` - Used only together with `:ip` option. Default is
549
- '255.255.255.0'.
550
- * `:libvirt__host_ip` - Adress to use for the host (not guest). Default is
551
- first possible address (after network address).
552
- * `:libvirt__dhcp_enabled` - If DHCP will offer addresses, or not. Used only
553
- when creating new network. Default is true.
554
- * `:libvirt__dhcp_start` - First address given out via DHCP. Default is third
555
- address in range (after network name and gateway).
556
- * `:libvirt__dhcp_stop` - Last address given out via DHCP. Default is last
557
- possible address in range (before broadcast address).
558
- * `:libvirt__dhcp_bootp_file` - The file to be used for the boot image. Used
559
- only when dhcp is enabled.
560
- * `:libvirt__dhcp_bootp_server` - The server that runs the DHCP server. Used
561
- only when dhcp is enabled.By default is the same host that runs the DHCP
562
- server.
563
- * `:libvirt__adapter` - Number specifiyng sequence number of interface.
564
- * `:libvirt__forward_mode` - Specify one of `veryisolated`, `none`, `nat` or
565
- `route` options. This option is used only when creating new network. Mode
566
- `none` will create isolated network without NATing or routing outside. You
567
- will want to use NATed forwarding typically to reach networks outside of
568
- hypervisor. Routed forwarding is typically useful to reach other networks
569
- within hypervisor. `veryisolated` described
570
- [here](https://libvirt.org/formatnetwork.html#examplesNoGateway). By
571
- default, option `nat` is used.
572
- * `:libvirt__forward_device` - Name of interface/device, where network should
573
- be forwarded (NATed or routed). Used only when creating new network. By
574
- default, all physical interfaces are used.
575
- * `:libvirt__tunnel_type` - Set to 'udp' if using UDP unicast tunnel mode
576
- (libvirt v1.2.20 or higher). Set this to either "server" or "client" for tcp
577
- tunneling. Set this to 'mcast' if using multicast tunneling. This
578
- configuration type uses tunnels to generate point to point connections
579
- between Guests. Useful for Switch VMs like Cumulus Linux. No virtual switch
580
- setting like `libvirt__network_name` applies with tunnel interfaces and will
581
- be ignored if configured.
582
- * `:libvirt__tunnel_ip` - Sets the source IP of the libvirt tunnel interface.
583
- By default this is `127.0.0.1` for TCP and UDP tunnels and `239.255.1.1` for
584
- Multicast tunnels. It populates the address field in the `<source
585
- address="XXX">` of the interface xml configuration.
586
- * `:libvirt__tunnel_port` - Sets the source port the tcp/udp/mcast tunnel with
587
- use. This port information is placed in the `<source port=XXX/>` section of
588
- interface xml configuration.
589
- * `:libvirt__tunnel_local_port` - Sets the local port used by the udp tunnel
590
- interface type. It populates the port field in the `<local port=XXX">`
591
- section of the interface xml configuration. _(This feature only works in
592
- libvirt 1.2.20 and higher)_
593
- * `:libvirt__tunnel_local_ip` - Sets the local IP used by the udp tunnel
594
- interface type. It populates the ip entry of the `<local address=XXX">`
595
- section of the interface xml configuration. _(This feature only works in
596
- libvirt 1.2.20 and higher)_
597
- * `:libvirt__guest_ipv6` - Enable or disable guest-to-guest IPv6 communication.
598
- See [here](https://libvirt.org/formatnetwork.html#examplesPrivate6), and
599
- [here](http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=705e67d40b09a905cd6a4b8b418d5cb94eaa95a8)
600
- for for more information. *Note: takes either 'yes' or 'no' for value*
601
- * `:libvirt__ipv6_address` - Define ipv6 address, require also prefix.
602
- * `:libvirt__ipv6_prefix` - Define ipv6 prefix. generate string `<ip family="ipv6" address="address" prefix="prefix" >`
603
- * `:libvirt__iface_name` - Define a name for the private network interface.
604
- With this feature one can [simulate physical link
605
- failures](https://github.com/vagrant-libvirt/vagrant-libvirt/pull/498)
606
- * `:mac` - MAC address for the interface. *Note: specify this in lowercase
607
- since Vagrant network scripts assume it will be!*
608
- * `:model_type` - parameter specifies the model of the network adapter when you
609
- create a domain value by default virtio KVM believe possible values, see the
610
- documentation for libvirt
611
- * `:libvirt__driver_name` - Define which network driver to use. [More
612
- info](https://libvirt.org/formatdomain.html#elementsDriverBackendOptions)
613
- * `:libvirt__driver_queues` - Define a number of queues to be used for network
614
- interface. Set equal to numer of vCPUs for best performance. [More
615
- info](http://www.linux-kvm.org/page/Multiqueue)
616
- * `:autostart` - Automatic startup of network by the libvirt daemon.
617
- If not specified the default is 'false'.
618
-
619
- When the option `:libvirt__dhcp_enabled` is to to 'false' it shouldn't matter
620
- whether the virtual network contains a DHCP server or not and vagrant-libvirt
621
- should not fail on it. The only situation where vagrant-libvirt should fail is
622
- when DHCP is requested but isn't configured on a matching already existing
623
- virtual network.
624
-
625
- ### Public Network Options
626
-
627
- * `:dev` - Physical device that the public interface should use. Default is
628
- 'eth0'.
629
- * `:mode` - The mode in which the public interface should operate in. Supported
630
- modes are available from the [libvirt
631
- documentation](http://www.libvirt.org/formatdomain.html#elementsNICSDirect).
632
- Default mode is 'bridge'.
633
- * `:type` - is type of interface.(`<interface type="#{@type}">`)
634
- * `:mac` - MAC address for the interface.
635
- * `:network_name` - Name of libvirt network to connect to.
636
- * `:portgroup` - Name of libvirt portgroup to connect to.
637
- * `:ovs` - Support to connect to an Open vSwitch bridge device. Default is
638
- 'false'.
639
- * `:trust_guest_rx_filters` - Support trustGuestRxFilters attribute. Details
640
- are listed [here](http://www.libvirt.org/formatdomain.html#elementsNICSDirect).
641
- Default is 'false'.
642
-
643
- ### Management Network
644
-
645
- vagrant-libvirt uses a private network to perform some management operations on
646
- VMs. All VMs will have an interface connected to this network and an IP address
647
- dynamically assigned by libvirt unless you set `:mgmt_attach` to 'false'.
648
- This is in addition to any networks you configure. The name and address
649
- used by this network are configurable at the provider level.
650
-
651
- * `management_network_name` - Name of libvirt network to which all VMs will be
652
- connected. If not specified the default is 'vagrant-libvirt'.
653
- * `management_network_address` - Address of network to which all VMs will be
654
- connected. Must include the address and subnet mask. If not specified the
655
- default is '192.168.121.0/24'.
656
- * `management_network_mode` - Network mode for the libvirt management network.
657
- Specify one of veryisolated, none, nat or route options. Further documentated
658
- under [Private Networks](#private-network-options)
659
- * `management_network_guest_ipv6` - Enable or disable guest-to-guest IPv6
660
- communication. See
661
- [here](https://libvirt.org/formatnetwork.html#examplesPrivate6), and
662
- [here](http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=705e67d40b09a905cd6a4b8b418d5cb94eaa95a8)
663
- for for more information.
664
- * `management_network_autostart` - Automatic startup of mgmt network, if not
665
- specified the default is 'false'.
666
-
667
- You may wonder how vagrant-libvirt knows the IP address a VM received. Libvirt
668
- doesn't provide a standard way to find out the IP address of a running domain.
669
- But we do know the MAC address of the virtual machine's interface on the
670
- management network. Libvirt is closely connected with dnsmasq, which acts as a
671
- DHCP server. dnsmasq writes lease information in the `/var/lib/libvirt/dnsmasq`
672
- directory. Vagrant-libvirt looks for the MAC address in this file and extracts
673
- the corresponding IP address.
674
-
675
- ## Additional Disks
676
-
677
- You can create and attach additional disks to a VM via `libvirt.storage :file`.
678
- It has a number of options:
679
-
680
- * `path` - Location of the disk image. If unspecified, a path is automtically
681
- chosen in the same storage pool as the VMs primary disk.
682
- * `device` - Name of the device node the disk image will have in the VM, e.g.
683
- *vdb*. If unspecified, the next available device is chosen.
684
- * `size` - Size of the disk image. If unspecified, defaults to 10G.
685
- * `type` - Type of disk image to create. Defaults to *qcow2*.
686
- * `bus` - Type of bus to connect device to. Defaults to *virtio*.
687
- * `cache` - Cache mode to use, e.g. `none`, `writeback`, `writethrough` (see
688
- the [libvirt documentation for possible
689
- values](http://libvirt.org/formatdomain.html#elementsDisks) or
690
- [here](https://www.suse.com/documentation/sles11/book_kvm/data/sect1_chapter_book_kvm.html)
691
- for a fuller explanation). Defaults to *default*.
692
- * `allow_existing` - Set to true if you want to allow the VM to use a
693
- pre-existing disk. If the disk doesn't exist it will be created.
694
- Disks with this option set to true need to be removed manually.
695
- * `shareable` - Set to true if you want to simulate shared SAN storage.
696
- * `serial` - Serial number of the disk device.
697
-
698
- The following example creates two additional disks.
699
-
700
- ```ruby
701
- Vagrant.configure("2") do |config|
702
- config.vm.provider :libvirt do |libvirt|
703
- libvirt.storage :file, :size => '20G'
704
- libvirt.storage :file, :size => '40G', :type => 'raw'
705
- end
706
- end
707
- ```
708
-
709
- For shared SAN storage to work the following example can be used:
710
- ```ruby
711
- Vagrant.configure("2") do |config|
712
- config.vm.provider :libvirt do |libvirt|
713
- libvirt.storage :file, :size => '20G', :path => 'my_shared_disk.img', :allow_existing => true, :shareable => true, :type => 'raw'
714
- end
715
- end
716
- ```
717
-
718
- ### Reload behavior
719
-
720
- On `vagrant reload` the following additional disk attributes are updated in
721
- defined domain:
722
-
723
- * `bus` - Updated. Uses `device` as a search marker. It is not required to
724
- define `device`, but it's recommended. If `device` is defined then the order
725
- of addtitional disk definition becomes irrelevant.
726
-
727
- ## CDROMs
728
-
729
- You can attach up to four CDROMs to a VM via `libvirt.storage :file,
730
- :device => :cdrom`. Available options are:
731
-
732
- * `path` - The path to the iso to be used for the CDROM drive.
733
- * `dev` - The device to use (`hda`, `hdb`, `hdc`, or `hdd`). This will be
734
- automatically determined if unspecified.
735
- * `bus` - The bus to use for the CDROM drive. Defaults to `ide`
736
-
737
- The following example creates three CDROM drives in the VM:
738
-
739
- ```ruby
740
- Vagrant.configure("2") do |config|
741
- config.vm.provider :libvirt do |libvirt|
742
- libvirt.storage :file, :device => :cdrom, :path => '/path/to/iso1.iso'
743
- libvirt.storage :file, :device => :cdrom, :path => '/path/to/iso2.iso'
744
- libvirt.storage :file, :device => :cdrom, :path => '/path/to/iso3.iso'
745
- end
746
- end
747
- ```
748
-
749
- ## Input
750
-
751
- You can specify multiple inputs to the VM via `libvirt.input`. Available
752
- options are listed below. Note that both options are required:
753
-
754
- * `type` - The type of the input
755
- * `bus` - The bus of the input
756
-
757
- ```ruby
758
- Vagrant.configure("2") do |config|
759
- config.vm.provider :libvirt do |libvirt|
760
- # this is the default
761
- # libvirt.input :type => "mouse", :bus => "ps2"
762
-
763
- # very useful when having mouse issues when viewing VM via VNC
764
- libvirt.input :type => "tablet", :bus => "usb"
765
- end
766
- end
767
- ```
768
-
769
- ## PCI device passthrough
770
-
771
- You can specify multiple PCI devices to passthrough to the VM via
772
- `libvirt.pci`. Available options are listed below. Note that all options are
773
- required:
774
-
775
- * `bus` - The bus of the PCI device
776
- * `slot` - The slot of the PCI device
777
- * `function` - The function of the PCI device
778
-
779
- You can extract that information from output of `lspci` command. First
780
- characters of each line are in format `[<bus>]:[<slot>].[<func>]`. For example:
781
-
782
- ```shell
783
- $ lspci| grep NVIDIA
784
- 03:00.0 VGA compatible controller: NVIDIA Corporation GK110B [GeForce GTX TITAN Black] (rev a1)
785
- ```
786
-
787
- In that case `bus` is `0x03`, `slot` is `0x00` and `function` is `0x0`.
788
-
789
- ```ruby
790
- Vagrant.configure("2") do |config|
791
- config.vm.provider :libvirt do |libvirt|
792
- libvirt.pci :bus => '0x06', :slot => '0x12', :function => '0x5'
793
-
794
- # Add another one if it is neccessary
795
- libvirt.pci :bus => '0x03', :slot => '0x00', :function => '0x0'
796
- end
797
- end
798
- ```
799
-
800
- Note! Above options affect configuration only at domain creation. It won't change VM behaviour on `vagrant reload` after domain was created.
801
-
802
- Don't forget to [set](#domain-specific-options) `kvm_hidden` option to `true` especially if you are passthroughing NVIDIA GPUs. Otherwise GPU is visible from VM but cannot be operated.
803
-
804
- ## USB Redirector Devices
805
- You can specify multiple redirect devices via `libvirt.redirdev`. There are two types, `tcp` and `spicevmc` supported, for forwarding USB-devices to the guest. Available options are listed below.
806
-
807
- * `type` - The type of the USB redirector device. (`tcp` or `spicevmc`)
808
- * `host` - The host where the device is attached to. (mandatory for type `tcp`)
809
- * `port` - The port where the device is listening. (mandatory for type `tcp`)
810
-
811
- ```ruby
812
- Vagrant.configure("2") do |config|
813
- config.vm.provider :libvirt do |libvirt|
814
- # add two devices using spicevmc channel
815
- (1..2).each do
816
- libvirt.redirdev :type => "spicevmc"
817
- end
818
- # add device, provided by localhost:4000
819
- libvirt.redirdev :type => "tcp", :host => "localhost", :port => "4000"
820
- end
821
- end
822
- ```
823
-
824
- ### Filter for USB Redirector Devices
825
- You can define filter for redirected devices. These filters can be positiv or negative, by setting the mandatory option `allow=yes` or `allow=no`. All available options are listed below. Note the option `allow` is mandatory.
826
-
827
- * `class` - The device class of the USB device. A list of device classes is available on [Wikipedia](https://en.wikipedia.org/wiki/USB#Device_classes).
828
- * `vendor` - The vendor of the USB device.
829
- * `product` - The product id of the USB device.
830
- * `version` - The version of the USB device. Note that this is the version of `bcdDevice`
831
- * `allow` - allow or disallow redirecting this device. (mandatory)
832
-
833
- You can extract that information from output of `lsusb` command. Every line contains the information in format `Bus [<bus>] Device [<device>]: ID [<vendor>:[<product>]`. The `version` can be extracted from the detailed output of the device using `lsusb -D /dev/usb/[<bus>]/[<device>]`. For example:
834
-
835
- ```shell
836
- # get bcdDevice from
837
- $: lsusb
838
- Bus 001 Device 009: ID 08e6:3437 Gemalto (was Gemplus) GemPC Twin SmartCard Reader
839
-
840
- $: lsusb -D /dev/bus/usb/001/009 | grep bcdDevice
841
- bcdDevice 2.00
842
- ```
843
-
844
- In this case, the USB device with `class 0x0b`, `vendor 0x08e6`, `product 0x3437` and `bcdDevice version 2.00` is allowed to be redirected to the guest. All other devices will be refused.
845
-
846
- ```ruby
847
- Vagrant.configure("2") do |config|
848
- config.vm.provider :libvirt do |libvirt|
849
- libvirt.redirdev :type => "spicevmc"
850
- libvirt.redirfilter :class => "0x0b" :vendor => "0x08e6" :product => "0x3437" :version => "2.00" :allow => "yes"
851
- libvirt.redirfilter :allow => "no"
852
- end
853
- end
854
- ```
855
-
856
- ## Random number generator passthrough
857
-
858
- You can pass through `/dev/random` to your VM by configuring the domain like this:
859
-
860
- ```ruby
861
- Vagrant.configure("2") do |config|
862
- config.vm.provider :libvirt do |libvirt|
863
- # Pass through /dev/random from the host to the VM
864
- libvirt.random :model => 'random'
865
- end
866
- end
867
- ```
868
-
869
- At the moment only the `random` backend is supported.
870
-
871
- ## Watchdog device
872
- A virtual hardware watchdog device can be added to the guest via the `libvirt.watchdog` element. The option `model` is mandatory and could have on of the following values.
873
-
874
- * `i6300esb` - the recommended device, emulating a PCI Intel 6300ESB
875
- * 'ib700` - emulating an ISA iBase IB700
876
- * `diag288` - emulating an S390 DIAG288 device
877
-
878
- The optional action attribute describes what `action` to take when the watchdog expires. Valid values are specific to the underlying hypervisor. The default behavior is `reset`.
879
-
880
- * `reset` - default, forcefully reset the guest
881
- * `shutdown` - gracefully shutdown the guest (not recommended)
882
- * `poweroff` - forcefully power off the guest
883
- * `pause` - pause the guest
884
- * `none` - do nothing
885
- * `dump` - automatically dump the guest
886
- * `inject-nmi` - inject a non-maskable interrupt into the guest
887
-
888
- ```ruby
889
- Vagrant.configure("2") do |config|
890
- config.vm.provider :libvirt do |libvirt|
891
- # Add libvirt watchdog device model i6300esb
892
- libvirt.watchdog :model => 'i6300esb', :action => 'reset'
893
- end
894
- end
895
- ```
896
-
897
- ## Smartcard device
898
- A virtual smartcard device can be supplied to the guest via the `libvirt.smartcard` element. The option `mode` is mandatory and currently only value `passthrough` is supported. The value `spicevmc` for option `type` is default value and can be supressed. On using `type = tcp`, the options `source_mode`, `source_host` and `source_service` are mandatory.
899
-
900
- ```ruby
901
- Vagrant.configure("2") do |config|
902
- config.vm.provider :libvirt do |libvirt|
903
- # Add smartcard device with type 'spicevmc'
904
- libvirt.smartcard :mode => 'passthrough', :type => 'spicevmc'
905
- end
906
- end
907
- ```
908
-
909
- ```ruby
910
- Vagrant.configure("2") do |config|
911
- config.vm.provider :libvirt do |libvirt|
912
- # Add smartcard device with type 'tcp'
913
- domain.smartcard :mode => 'passthrough', :type => 'tcp', :source_mode => 'bind', :source_host => '127.0.0.1', :source_service => '2001'
914
- end
915
- end
916
- ```
917
- ## Features
918
-
919
- Hypervisor features can be specified via `libvirt.features` as a list. The default
920
- options that are enabled are `acpi`, `apic` and `pae`. If you define `libvirt.features`
921
- you overwrite the defaults, so keep that in mind.
922
-
923
- An example:
924
-
925
- ```ruby
926
- Vagrant.configure("2") do |config|
927
- config.vm.provider :libvirt do |libvirt|
928
- # Specify the default hypervisor features
929
- libvirt.features = ['acpi', 'apic', 'pae' ]
930
- end
931
- end
932
- ```
933
-
934
- A different example for ARM boards:
935
-
936
- ```ruby
937
- Vagrant.configure("2") do |config|
938
- config.vm.provider :libvirt do |libvirt|
939
- # Specify the default hypervisor features
940
- libvirt.features = ["apic", "gic version='2'" ]
941
- end
942
- end
943
- ```
944
-
945
- ## CPU features
946
-
947
- You can specify CPU feature policies via `libvirt.cpu_feature`. Available
948
- options are listed below. Note that both options are required:
949
-
950
- * `name` - The name of the feature for the chosen CPU (see libvirts
951
- `cpu_map.xml`)
952
- * `policy` - The policy for this feature (one of `force`, `require`,
953
- `optional`, `disable` and `forbid` - see libvirt documentation)
954
-
955
- ```ruby
956
- Vagrant.configure("2") do |config|
957
- config.vm.provider :libvirt do |libvirt|
958
- # The feature will not be supported by virtual CPU.
959
- libvirt.cpu_feature :name => 'hypervisor', :policy => 'disable'
960
- # Guest creation will fail unless the feature is supported by host CPU.
961
- libvirt.cpu_feature :name => 'vmx', :policy => 'require'
962
- # The virtual CPU will claim the feature is supported regardless of it being supported by host CPU.
963
- libvirt.cpu_feature :name => 'pdpe1gb', :policy => 'force'
964
- end
965
- end
966
- ```
967
-
968
- ## USB device passthrough
969
-
970
- You can specify multiple USB devices to passthrough to the VM via
971
- `libvirt.usb`. The device can be specified by the following options:
972
-
973
- * `bus` - The USB bus ID, e.g. "1"
974
- * `device` - The USB device ID, e.g. "2"
975
- * `vendor` - The USB devices vendor ID (VID), e.g. "0x1234"
976
- * `product` - The USB devices product ID (PID), e.g. "0xabcd"
977
-
978
- At least one of these has to be specified, and `bus` and `device` may only be
979
- used together.
980
-
981
- The example values above match the device from the following output of `lsusb`:
982
-
983
- ```
984
- Bus 001 Device 002: ID 1234:abcd Example device
985
- ```
986
-
987
- Additionally, the following options can be used:
988
-
989
- * `startupPolicy` - Is passed through to libvirt and controls if the device has
990
- to exist. libvirt currently allows the following values: "mandatory",
991
- "requisite", "optional".
992
-
993
- ## No box and PXE boot
994
-
995
- There is support for PXE booting VMs with no disks as well as PXE booting VMs
996
- with blank disks. There are some limitations:
997
-
998
- * Requires Vagrant 1.6.0 or newer
999
- * No provisioning scripts are ran
1000
- * No network configuration is being applied to the VM
1001
- * No SSH connection can be made
1002
- * `vagrant halt` will only work cleanly if the VM handles ACPI shutdown signals
1003
-
1004
- In short, VMs without a box can be created, halted and destroyed but all other
1005
- functionality cannot be used.
1006
-
1007
- An example for a PXE booted VM with no disks whatsoever:
1008
-
1009
- ```ruby
1010
- Vagrant.configure("2") do |config|
1011
- config.vm.define :pxeclient do |pxeclient|
1012
- pxeclient.vm.provider :libvirt do |domain|
1013
- domain.boot 'network'
1014
- end
1015
- end
1016
- end
1017
- ```
1018
-
1019
- And an example for a PXE booted VM with no box but a blank disk which will boot from this HD if the NICs fail to PXE boot:
1020
-
1021
- ```ruby
1022
- Vagrant.configure("2") do |config|
1023
- config.vm.define :pxeclient do |pxeclient|
1024
- pxeclient.vm.provider :libvirt do |domain|
1025
- domain.storage :file, :size => '100G', :type => 'qcow2'
1026
- domain.boot 'network'
1027
- domain.boot 'hd'
1028
- end
1029
- end
1030
- end
1031
- ```
1032
-
1033
- Example for vm with 2 networks and only 1 is bootable and has dhcp server in this subnet, for example foreman with dhcp server
1034
- Name of network "foreman_managed" is key for define boot order
1035
- ```ruby
1036
- config.vm.define :pxeclient do |pxeclient|
1037
- pxeclient.vm.network :private_network,ip: '10.0.0.5',
1038
- libvirt__network_name: "foreman_managed",
1039
- libvirt__dhcp_enabled: false,
1040
- libvirt__host_ip: '10.0.0.1'
1041
-
1042
- pxeclient.vm.provider :libvirt do |domain|
1043
- domain.memory = 1000
1044
- boot_network = {'network' => 'foreman_managed'}
1045
- domain.storage :file, :size => '100G', :type => 'qcow2'
1046
- domain.boot boot_network
1047
- domain.boot 'hd'
1048
- end
1049
- end
1050
- ```
1051
-
1052
- ## SSH Access To VM
1053
-
1054
- vagrant-libvirt supports vagrant's [standard ssh
1055
- settings](https://docs.vagrantup.com/v2/vagrantfile/ssh_settings.html).
1056
-
1057
- ## Forwarded Ports
1058
-
1059
- vagrant-libvirt supports Forwarded Ports via ssh port forwarding. Please note
1060
- that due to a well known limitation only the TCP protocol is supported. For
1061
- each `forwarded_port` directive you specify in your Vagrantfile,
1062
- vagrant-libvirt will maintain an active ssh process for the lifetime of the VM.
1063
-
1064
- vagrant-libvirt supports an additional `forwarded_port` option `gateway_ports`
1065
- which defaults to `false`, but can be set to `true` if you want the forwarded
1066
- port to be accessible from outside the Vagrant host. In this case you should
1067
- also set the `host_ip` option to `'*'` since it defaults to `'localhost'`.
1068
-
1069
- You can also provide a custom adapter to forward from by 'adapter' option.
1070
- Default is `eth0`.
1071
-
1072
- ## Synced Folders
1073
-
1074
- vagrant-libvirt supports bidirectional synced folders via nfs or 9p and
1075
- unidirectional via rsync. The default is nfs. Vagrant automatically syncs the
1076
- project folder on the host to `/vagrant` in the guest. You can also configure
1077
- additional synced folders.
1078
-
1079
- You can change the synced folder type for `/vagrant` by explicity configuring
1080
- it an setting the type, e.g.
1081
-
1082
- ```shell
1083
- config.vm.synced_folder './', '/vagrant', type: 'rsync'
1084
- ```
1085
-
1086
- or
1087
-
1088
- ```shell
1089
- config.vm.synced_folder './', '/vagrant', type: '9p', disabled: false, accessmode: "squash", owner: "1000"
1090
- ```
1091
-
1092
- or
1093
-
1094
- ```shell
1095
- config.vm.synced_folder './', '/vagrant', type: '9p', disabled: false, accessmode: "mapped", mount: false
1096
- ```
1097
-
1098
- For 9p shares, a `mount: false` option allows to define synced folders without
1099
- mounting them at boot.
1100
-
1101
- Further documentation on using 9p can be found [here](https://www.kernel.org/doc/Documentation/filesystems/9p.txt). Please do note that 9p depends on support in the guest and not all distros come with the 9p module by default.
1102
-
1103
- **SECURITY NOTE:** for remote libvirt, nfs synced folders requires a bridged
1104
- public network interface and you must connect to libvirt via ssh.
1105
-
1106
-
1107
- ## Customized Graphics
1108
-
1109
- vagrant-libvirt supports customizing the display and video settings of the
1110
- managed guest. This is probably most useful for VNC-type displays with
1111
- multiple guests. It lets you specify the exact port for each guest to use
1112
- deterministically.
1113
-
1114
- Here is an example of using custom display options:
1115
-
1116
- ```ruby
1117
- Vagrant.configure("2") do |config|
1118
- config.vm.provider :libvirt do |libvirt|
1119
- libvirt.graphics_port = 5901
1120
- libvirt.graphics_ip = '0.0.0.0'
1121
- libvirt.video_type = 'qxl'
1122
- end
1123
- end
1124
- ```
1125
-
1126
- ## TPM Devices
1127
-
1128
- Modern versions of Libvirt support connecting to TPM devices on the host
1129
- system. This allows you to enable Trusted Boot Extensions, among other
1130
- features, on your guest VMs.
1131
-
1132
- In general, you will only need to modify the `tpm_path` variable in your guest
1133
- configuration. However, advanced usage, such as the application of a Software
1134
- TPM, may require modifying the `tpm_model` and `tpm_type` variables.
1135
-
1136
- The TPM options will only be used if you specify a TPM path. Declarations of
1137
- any TPM options without specifying a path will result in those options being
1138
- ignored.
1139
-
1140
- Here is an example of using the TPM options:
1141
-
1142
- ```ruby
1143
- Vagrant.configure("2") do |config|
1144
- config.vm.provider :libvirt do |libvirt|
1145
- libvirt.tpm_model = 'tpm-tis'
1146
- libvirt.tpm_type = 'passthrough'
1147
- libvirt.tpm_path = '/dev/tpm0'
1148
- end
1149
- end
1150
- ```
1151
-
1152
- ## Libvirt communication channels
1153
-
1154
- For certain functionality to be available within a guest, a private
1155
- communication channel must be established with the host. Two notable examples
1156
- of this are the qemu guest agent, and the Spice/QXL graphics type.
1157
-
1158
- Below is a simple example which exposes a virtio serial channel to the guest.
1159
- Note: in a multi-VM environment, the channel would be created for all VMs.
1160
-
1161
- ```ruby
1162
- vagrant.configure(2) do |config|
1163
- config.vm.provider :libvirt do |libvirt|
1164
- libvirt.channel :type => 'unix', :target_name => 'org.qemu.guest_agent.0', :target_type => 'virtio'
1165
- end
1166
- end
1167
- ```
1168
-
1169
- Below is the syntax for creating a spicevmc channel for use by a qxl graphics
1170
- card.
1171
-
1172
- ```ruby
1173
- vagrant.configure(2) do |config|
1174
- config.vm.provider :libvirt do |libvirt|
1175
- libvirt.channel :type => 'spicevmc', :target_name => 'com.redhat.spice.0', :target_type => 'virtio'
1176
- end
1177
- end
1178
- ```
1179
-
1180
- These settings can be specified on a per-VM basis, however the per-guest
1181
- settings will OVERRIDE any global 'config' setting. In the following example,
1182
- we create 3 VM with the following configuration:
1183
-
1184
- * **master**: No channel settings specified, so we default to the provider
1185
- setting of a single virtio guest agent channel.
1186
- * **node1**: Override the channel setting, setting both the guest agent
1187
- channel, and a spicevmc channel
1188
- * **node2**: Override the channel setting, setting both the guest agent
1189
- channel, and a 'guestfwd' channel. TCP traffic sent by the guest to the given
1190
- IP address and port is forwarded to the host socket `/tmp/foo`. Note: this
1191
- device must be unique for each VM.
1192
-
1193
- For example:
1194
-
1195
- ```ruby
1196
- Vagrant.configure(2) do |config|
1197
- config.vm.box = "fedora/24-cloud-base"
1198
- config.vm.provider :libvirt do |libvirt|
1199
- libvirt.channel :type => 'unix', :target_name => 'org.qemu.guest_agent.0', :target_type => 'virtio'
1200
- end
1201
-
1202
- config.vm.define "master" do |master|
1203
- master.vm.provider :libvirt do |domain|
1204
- domain.memory = 1024
1205
- end
1206
- end
1207
- config.vm.define "node1" do |node1|
1208
- node1.vm.provider :libvirt do |domain|
1209
- domain.channel :type => 'unix', :target_name => 'org.qemu.guest_agent.0', :target_type => 'virtio'
1210
- domain.channel :type => 'spicevmc', :target_name => 'com.redhat.spice.0', :target_type => 'virtio'
1211
- end
1212
- end
1213
- config.vm.define "node2" do |node2|
1214
- node2.vm.provider :libvirt do |domain|
1215
- domain.channel :type => 'unix', :target_name => 'org.qemu.guest_agent.0', :target_type => 'virtio'
1216
- domain.channel :type => 'unix', :target_type => 'guestfwd', :target_address => '192.0.2.42', :target_port => '4242',
1217
- :source_path => '/tmp/foo'
1218
- end
1219
- end
1220
- end
1221
- ```
1222
-
1223
- ## Custom command line arguments
1224
- You can also specify multiple qemuargs arguments for qemu-system
1225
-
1226
- * `value` - Value
1227
-
1228
- ```ruby
1229
- Vagrant.configure("2") do |config|
1230
- config.vm.provider :libvirt do |libvirt|
1231
- libvirt.qemuargs :value => "-device"
1232
- libvirt.qemuargs :value => "intel-iommu"
1233
- end
1234
- end
1235
- ```
1236
-
1237
- ## Box Format
1238
-
1239
- You can view an example box in the
1240
- [`example_box/directory`](https://github.com/vagrant-libvirt/vagrant-libvirt/tree/master/example_box).
1241
- That directory also contains instructions on how to build a box.
1242
-
1243
- The box is a tarball containing:
1244
-
1245
- * qcow2 image file named `box.img`
1246
- * `metadata.json` file describing box image (`provider`, `virtual_size`,
1247
- `format`)
1248
- * `Vagrantfile` that does default settings for the provider-specific
1249
- configuration for this provider
1250
-
1251
- ## Create Box
1252
-
1253
- To create a vagrant-libvirt box from a qcow2 image, run `create_box.sh`
1254
- (located in the tools directory):
1255
-
1256
- ```shell
1257
- $ create_box.sh ubuntu14.qcow2
1258
- ```
1259
-
1260
- You can also create a box by using [Packer](https://packer.io). Packer
1261
- templates for use with vagrant-libvirt are available at
1262
- https://github.com/jakobadam/packer-qemu-templates. After cloning that project
1263
- you can build a vagrant-libvirt box by running:
1264
-
1265
- ```shell
1266
- $ cd packer-qemu-templates
1267
- $ packer build ubuntu-14.04-server-amd64-vagrant.json
1268
- ```
1269
-
1270
- ## Development
1271
-
1272
- To work on the `vagrant-libvirt` plugin, clone this repository out, and use
1273
- [Bundler](http://gembundler.com) to get the dependencies:
1274
-
1275
- ```shell
1276
- $ git clone https://github.com/vagrant-libvirt/vagrant-libvirt.git
1277
- $ cd vagrant-libvirt
1278
- $ bundle install
1279
- ```
1280
-
1281
- Once you have the dependencies, verify the unit tests pass with `rspec`:
1282
-
1283
- ```shell
1284
- $ bundle exec rspec spec/
1285
- ```
1286
-
1287
- If those pass, you're ready to start developing the plugin. You can test the
1288
- plugin without installing it into your Vagrant environment by just creating a
1289
- `Vagrantfile` in the top level of this directory (it is gitignored) that uses
1290
- it. Don't forget to add following line at the beginning of your `Vagrantfile`
1291
- while in development mode:
1292
-
1293
- ```ruby
1294
- Vagrant.require_plugin "vagrant-libvirt"
1295
- ```
1296
-
1297
- Now you can use bundler to execute Vagrant:
1298
-
1299
- ```shell
1300
- $ bundle exec vagrant up --provider=libvirt
1301
- ```
1302
-
1303
- **IMPORTANT NOTE:** bundle is crucial. You need to use bundled Vagrant.
1304
-
1305
- ## Contributing
1306
-
1307
- 1. Fork it
1308
- 2. Create your feature branch (`git checkout -b my-new-feature`)
1309
- 3. Commit your changes (`git commit -am 'Add some feature'`)
1310
- 4. Push to the branch (`git push origin my-new-feature`)
1311
- 5. Create new Pull Request