Difference between revisions of "Vagrantfile"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
  
 
* [[Vagrantfile example]]
 
* [[Vagrantfile example]]
 +
 +
* https://github.com/vagrant-libvirt/vagrant-libvirt
 +
  
 
  Vagrant.configure("2") do |config|
 
  Vagrant.configure("2") do |config|
Line 8: Line 11:
 
   config.vm.provider :libvirt do |libvirt|
 
   config.vm.provider :libvirt do |libvirt|
 
     libvirt.default_prefix = ""
 
     libvirt.default_prefix = ""
 +
    libvirt.memory = 8192
 
   end
 
   end
 
  end
 
  end
  
Username: vagrant
+
It will create a 2 CPU 2 GB memory machine.
Password: vagrant
 
  
 +
To login use:
 +
* Username: vagrant
 +
* Password: vagrant
  
 
  Vagrant.configure("2") do |config|
 
  Vagrant.configure("2") do |config|
  config.vm.box = "[[bento/fedora-32]]"
+
  config.vm.box = "[[fedora/32-cloud-base]]"
 
  end
 
  end
  
 
  Vagrant.configure("2") do |config|
 
  Vagrant.configure("2") do |config|
  config.vm.box = "[[fedora/32-cloud-base]]"
+
  config.vm.box = "[[bento/fedora-32]]"
 
  end
 
  end
  
Line 43: Line 49:
 
* <code>[[vagrant up --provider=libvirt]]</code>
 
* <code>[[vagrant up --provider=libvirt]]</code>
  
 +
 +
== Related terms ==
 +
* <code>[[generic/rhel8]]</code>
 +
* <code>[[public_network]]</code>
 +
* <code>[[vagrant init]]</code>
  
 
== See also ==
 
== See also ==

Latest revision as of 12:42, 17 September 2022


Vagrant.configure("2") do |config|
  config.vm.box = "generic/ubuntu2010"
  config.vm.define "YOUR_VM_MACHINE_NAME"

  config.vm.provider :libvirt do |libvirt|
    libvirt.default_prefix = ""
    libvirt.memory = 8192
  end
end

It will create a 2 CPU 2 GB memory machine.

To login use:

  • Username: vagrant
  • Password: vagrant
Vagrant.configure("2") do |config|
  config.vm.box = "fedora/32-cloud-base"
end
Vagrant.configure("2") do |config|
 config.vm.box = "bento/fedora-32"
end

Including a hostname

Vagrant.configure("2") do |config|
  config.vm.box = "fedora/32-cloud-base"
  config.vm.define "YOUR_HOSTNAME_MACHINE"
end

Including a hostname and removing default prefix

Vagrant.configure("2") do |config|
  config.vm.box = "fedora/32-cloud-base"
  config.vm.define "YOUR_HOSTNAME_MACHINE"

  config.vm.provider :libvirt do |libvirt|
    libvirt.default_prefix = ""
  end 
end



Related terms[edit]

See also[edit]

Advertising: