This is part II of a series about what happens when a server fields a Web request. It is geared toward junior Web developers interested in learning more about Web infrastructure. It assumes some experience with DNS. If you are familiar with virtualization and have Vagrant installed, feel free to skip this post.

When you’re learning about system administration, it is helpful to have a private server to muck around on so that your mistakes do not affect users. Fortunately, you can use a tool called [Vagrant](https://www.vagrantup.com/) to easily create virtual servers on your development machine. This tutorial requires Vagrant, so you will need to follow [these instructions](https://docs.vagrantup.com/v2/installation/) if you do not have it already (it is pretty easy). You will also need [VirtualBox](https://www.virtualbox.org/wiki/Downloads).

This blog post aims to help developers create a virtual server while also explaining what, exactly, that means.

### 1. Creating a clean virtual server

For this tutorial, I have predefined some _very_ vanilla Vagrant settings to get things started. To grab those, run `git clone https://github.com/handlers/servers.git`.

Now `cd` into that directory. `ls` and you’ll see that the repository has a `Vagrantfile` which contains details about the server that Vagrant is going to create. If you poke around that Vagrantfile and `ctrl + f` for “config.vm.box,” you should see a line that looks like this: `config.vm.box = “ubuntu/trusty64″`. This tells Vagrant that our server should come preloaded with the [Trusty release](https://wiki.ubuntu.com/TrustyTahr/ReleaseNotes) of the Ubuntu operating system. You should also note that this Vagrantfile specifies a [_private IP_](https://www.arin.net/knowledge/address_filters.html) address of `192.168.33.11`.

### 2. Creating your virtual server

We will now use Vagrant to create a virtual server on your computer. Make sure you’re in the project directory you cloned from GitHub and run `vagrant up`. (It may take a while to download the Ubuntu base image.1) Eventually your terminal should spit out something like this:

When you run `vagrant up`, you create something that walks and talks like a real server, but it is actually running within your own computer. For our purposes, it is important that the virtual server is _networked_. We can prove it by pinging the IP referenced in the Vagrantfile (`192.168.33.11`).

As you can see, we are getting packets back from the IP address we just created.

Vagrant also preloads the machine with a user named `vagrant`, and you can `ssh` into the machine as this user. Try running `vagrant ssh` from within the project directory.2 You should see a prompt like this:

“`
vagrant@vagrant-ubuntu-trusty-64:~$
“`

It allows you to do everything you can do on a regular server, from checking out the machine’s OS to poking around its directory structure.

You now have a virtual Ubuntu server running on your computer, complete with `ssh` access. `cd /` and take a little time to check out what’s going on. It might be helpful to check out this Wikipedia article on [Unix’s normal directory structure](http://en.wikipedia.org/wiki/Unix_filesystem#Conventional_directory_layout). Many, many websites run on computers that have directories laid out like this. Don’t worry about messing some part of your server up — creating a fresh image is as easy as bringing down your existing server with `vagrant destroy` and then running `vagrant up` again. Remember that these commands (`vagrant ___`) should be issued from your computer, not from within the virtual machine.

You have now completed the first step in understanding how your server fields Web requests, creating a very basic, networked virtual server. You are controlledly replicating the Internet on your development machine. Stay tuned for part III, in which we configure our server to handle HTTP requests with NGINX.

### Extra credit

If you _really_ want to get down into the guts of what’s going on, try `ssh`ing into your virtual server and running `tcpdump -i any icmp[icmptype] == 8` to see what happens when you `ping` it. It is pretty cool!

—–

1 The wait is more bearable when you realize you are basically downloading a whole computer!2 It is worth noting that you did not run your system’s standard `ssh` command, but rather a Vagrant utility called `ssh` which opens a shell session on the virtual machine. You can, however, also run `ssh vagrant@192.168.33.11` with password `vagrant`.