Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Alan Fox
Alan Fox
10,214 Points

Virtual Machine Overview - What is happening exactly?

Hi All,

I would like to get my head around exactly what is happening with the virtual machine setup on windows so please tell me if I have this correct!

1) cmdr - is this just a fancy box for the command line or is it more like a mac terminal? Can I do more things with it?

2) Is vagrant a blueprint for a machine? Is it like an OS?

3) Does VirtualBox take the vagrant file and create the virtual machine based on it?

4) If I upgrade this virtual machine (e.g. install something like rbm) is that data stored in the vagrant folder or is it stored somewhere else (like virtualbox folder)

5) If I want the exact same virtual machine on a different computer do I just copy that vagrant file?

What OS am I actually running?

Many Thanks

Al

2 Answers

James Barnett
James Barnett
39,199 Points

1) cmdr - is this just a fancy box for the command line or is it more like a mac terminal?

Well the "mac terminal" is really 3 distinct things. A command line app, bash command processor, an ecosystem of tools made for unix-like systems.

So cmder provides the first 2 of those things. If you want to get some of those tools on Windows you can check out scoop


2) Is vagrant a blueprint for a machine?

Vagrant = A collection of provisioning scripts that interact with a hypervisor to make provisioning VMs easier


3) Does VirtualBox take the vagrant file and create the virtual machine based on it?

You start with a VM packed in vagrant format, called a Vagrant Base Box, then you take a vagrant file and vagrant talks to Virtual Box to configure the VM.


4) If I upgrade this virtual machine (e.g. install something like rbm) is that data stored in the vagrant folder or is it stored somewhere else (like virtualbox folder)

In the virtual disk image in the virtualbox folder


5) If I want the exact same virtual machine on a different computer do I just copy that vagrant file?

If you want everything you've installed on a VM (like you mentioned in question 4) then you'll need the virtual disk images same as the answer to question 4.

If you want a VM that starts out the same like the way Treehouse VM is then you'll need 2 parts( vagrant base box & vagrant file) same as the answer to question 3

James Barnett
James Barnett
39,199 Points

Let's define our terms:

  • VM: Short for virtual machine, an OS running in an isolated environment, it's basically a computer inside of a file
  • Host OS: The OS of your physical computer
  • Guest OS: The OS of your VM
  • Hypervisor: An application run on the Host OS that enables you to interact with a VM
  • Virtual Box: A popular free hypervisor
  • Vagrant: A collection of provisioning scripts that interact with a hypervisor to make provisioning VMs easier. Vagrant currently supports 3 hypervisors Virtual Box, VMWare Workstation & VMWare Fusion.
  • Vagrant Base Box: A VM with an OS installed that has been packaged Vagrant-compatible format
  • VagrantFile: A template for vagrant box, written in Ruby, for configuring the options for a box such as which vagrant base box to use, how much memory, space, IP address etc
  • Vagrant Box: Vagrant Base Box + VagrantFile = Vagrant Box
Alan Fox
Alan Fox
10,214 Points

Wow, plenty for me to get my head around!

Thanks for taking the time to answer my questions

James Barnett
James Barnett
39,199 Points

The long and short of it is, that Vagrant basically expands the use case of VMs by trying to solve the "well it works on my machine" issue of collaboration