Cheatography
                https://cheatography.com
            
        
        
    
                   
                            
    
                    Setup a Vagrant box or small network
                    
                 
                    
        
        
            
    
        
                            
        
                
        
            
                                
            
                
                                                | Vagrant Setup
                        
                                                                                    
                                                                                            | Vagrant installs at c:\hashicorp\vagrant |  
                                                                                            | Make a directory for each separate vm                   only 1 vagrant file can exist per directory' |  
                                                                                            |  i.e. c:\hashicorp\vagrant\ansible
 |  
                                                                                            |      c:\hashicorp\vagrant\debian10
 |  
                                                                                            |      c:\hashicorp\vagrant\netbox
 |  Initial Config [/hashicorp/vagrant/precise64]
                        
                                                                                    
                                                                                            | vagrant init [ Initializes new vagrantfile
 ] |  
                                                                                            | vagrant up [starts the box] |  
                                                                                            | rm Vagrantfile [removes vagrant init] |  i.e. vagrant init hashicorp/precise64
 General VagranMaintenance
                        
                                                                                    
                                                                                            |  see adjacent screen shot |  
                                                                                            | vagrant box list | |lists all available vagrant boxes on this endpoint |  
                                                                                            | vagrant status | | displays status for box in current directory |  
                                                                                            | vagrant box outdated | | checks if box is up to date |  
                                                                                            | must run from a box path |  
                                                                                            | vagrant global-status | | displays status for all local boxes |  
                                                                                            | vagrant global-status --prune  | | status of all boxes; dropping invalid entries |  
                                                                                            | vagrant box add <name> or <url> | | downloads box image to your end point |  
                                                                                            | vagrgant box remove <name> | | deletes box from end point |  
                                                                                            | vagrant package | | packages a running environment in a reusable box |  Advanced Vagrant Box Mgmt
                        
                                                                                    
                                                                                            | vagrant provision | | forces end point to re-provision |  
                                                                                            | vagrant reload --provision | | restart end point forcing provisioning |  
                                                                                            | vagrant provision --debug | | increases verbosity during debug |  
                                                                                            | vagrant up --provision | tee provision.log | | runs vagrant up provisioning & output logs placed in a file |  
                                                                                            | enable VBGuest auto update |  Notes / Alerts
                        
                                                                                    
                                                                                            | If a PC goes to sleep, vagrant boxes will be forceably shutdown but no data should be lost |  Windows Base Box [vagrant box add]Vagrant Logs
                        
                                                                                    
                                                                                            | vagrant up --provision | tee provision.log | forces provisioning and writes a log |  
                                                                                            | vagrant_log=info vagrant up | use env var VAGRANT_LOG to set verbosity |  |  | Vagrant Use Commands [Run in Project Path]
                        
                                                                                    
                                                                                            | vagrant ssh |  
                                                                                            | vagrant ssh config |  
                                                                                            | vagrant suspend |  
                                                                                            | vagrant resume |  
                                                                                            | vagrant halt |  
                                                                                            | vagrant reload | | restarts box w/ new configuration |  
                                                                                            | vagrant destroy | | destroys current endpoint not the base box |  
                                                                                            | vagrant  --version |  Vagrant Plugins
                        
                                                                                    
                                                                                            | vagrant plugin | | manages all plugins |  
                                                                                            | vagrant plugin install vagrant-vbguest | | installs virtual box tools |  
                                                                                            | vagrant plugin install vagrant-hostmanager |  
                                                                                            |   - manages /etc/hosts within a multi machine environment |  
                                                                                            | vagrant plugin install vagrant-env |  
                                                                                            | | vagrant plugin install vagrant-hostsupdater | UPdates /etc/hosts file each time vagrant stops or starts |  Vagrant Share/Remote Access
                        
                                                                                    
                                                                                            | vagrant share | | share your environment with anyone |  
                                                                                            | vagrant connect | | connect to a shared end point |  
                                                                                            | vagrant hosts | | all hostnames managed by plugin |  
                                                                                            | vagrant hostmanager | | manages /etc/hosts within a  multi machine environment |  
                                                                                            | vagrant ssh-config | | provides connect config for machine |  
                                                                                            | vagrant rdp | | connects to other machine via rdp |  | 
            
                            
            
            
        
        
        
        
        
            
    
        
          
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets