Cheatsheet de Vagrant
|
apt install vagrant
Instala vagrant
|
|
vagrant up
|
Crea y configura nuestro entorno
|
|
vagrant box list
|
Lista las boxes descargadas
|
|
vagrant destroy
|
Detiene la MV y borra sus recursos
|
|
VBoxManage showvminfo
|
Muestra información de la máquina
|
|
vagrant port
|
Ver puertos redireccionados
|
|
vagrant reload
|
Aplicar cambios
|
|
Especifica la box a utilizar
config.vm.box = "ubuntu/bionic64"
|
|
Define el nombre de la MV
config.vm.define "mi_vm"
|
|
Modificar RAM y nº de núcleos
config.vm.provider "virtualbox" do |vb| vb.memory = 1024 vb.cpus = 2 end
|
|
Configuración de red
config.vm.network "forwarded_port", guest: 80, host: 8080 config.vm.network "private_network", type: "dhcp"
|
|
Entorno gráfico
vb.gui = true
|
|
Configurar un disco
vb.customize ['createhd', '--filename', 'additional_disk.vdi', '--size', 500 * 1024] vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', 'additional_disk.vdi']
|
|
vagrant init
|
Crea el vagrant file
|
|
vagrant validate
|
Valida el vagrant file
|
config.vm.provider «virtualbox» do |vb|
vb.name = «nombre»
vb.memory = «512»
vb.cpus = 2
vb.gui = true
end
config.vm.provider «virtualbox» do |vb|
file_to_disk = ‘tmp/disk.vdi’
unless File.exist?(file_to_disk)
vb.customize [‘createhd’,
‘–filename’, file_to_disk,
‘–size’, 500 * 1024]
end
vb.customize [‘storageattach’, :id,
‘–storagectl’, ‘SATAController’,
‘–port’, 1,
‘–device’, 0,
‘–type’, ‘hdd’,
‘–medium’, file_to_disk]
end
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.