Vagrant Cheat Sheet

A Software › VMWare cheat sheet in español (Spanish) by alucan0608

Cheatsheet de Vagrant

2,979 views 763 downloads 22 Sep 2023 History

SETUP

apt install vagrant
Instala vagrant

BOXES

vagrant up
Crea y configura nuestro entorno
vagrant box list
Lista las boxes descar­gadas
vagrant destroy
Detiene la MV y borra sus recursos
VBoxManage showvminfo
Muestra inform­ación de la máquina

COMANDOS

vagrant port
Ver puertos redire­cci­onados
vagrant reload
Aplicar cambios

Vagran­tfile config­uración

Especifica la box a utilizar
config.vm.box = "­ubu­ntu­/bi­oni­c64­"
Define el nombre de la MV
config.vm.define "­mi_­vm"
Modificar RAM y nº de núcleos
config.vm.pr­ovider "­vir­tua­lbo­x" do |vb| vb.memory = 1024 vb.cpus = 2 end
Config­uración de red
config.vm.ne­twork "­for­war­ded­_po­rt", guest: 80, host: 8080 config.vm.ne­twork "­pri­vat­e_n­etw­ork­", type: "­dhc­p"
Entorno gráfico
vb.gui = true
Configurar un disco
vb.cus­tomize ['cr­eat­ehd­', '­--f­ile­nam­e', '­add­iti­ona­l_d­isk.vd­i', '­--s­ize­', 500 * 1024] vb.cus­tomize ['st­ora­gea­tta­ch', :id, '­--s­tor­age­ctl­', 'SATA Contro­lle­r', '­--p­ort­', 1, '­--d­evi­ce', 0, '­--t­ype­', '­hdd­', '­--m­edi­um', '­add­iti­ona­l_d­isk.vd­i']

VAGRAN­TFILE

vagrant init
Crea el vagrant file
vagrant validate
Valida el vagrant file

~/. vagrant. d

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

Comments

No comments yet.

Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.