How to set up your home lab

In the olden days, you had to have multiple computers to set up a home lab. Nowadays, you’re able to have a full lab running on a single computer thanks to the power of virtualization. Let’s get your home lab set up right now!

Photo by Hans Reniers on Unsplash

A great way to learn when you’re just getting started in IT is to set up a home lab. This allows you to mess around, try things out, and even break things without being worried about causing permanent damage. Many IT professionals maintain a home lab so they can learn without using their production environment at work. (You should never test things out in production!)

Setting up a home lab is quite easy and inexpensive;you just need your home computer. Why not follow these steps as you read this post? By the end of it, you’ll have a fully set up home lab!

We’ll be using something called “virtualization” to set up our environment, so let’s first understand what that means. Remember the movie “Matrix”? In that movie, the main character found out that the world he was living in was just a simulation running on top of the real world. Virtualization is pretty much that. Let’s say that you have a laptop that you’ve installed Windows on. You have the ability to run virtual machines (commonly referred to as VMs) on top of your laptop’s main operating system. These VMs are unaware that they’re running on another operating system, much like Neo was in the Matrix. In fact, these VMs can be on completely different operating systems entirely. For example, your main operating system could be running Windows 10, but you could be running a Linux VM, a Windows 7 VM, and a Windows Server 2012 VM on top of it.

There are a variety of virtualization options. A commonly used one is Oracle’s Virtual Box, which we’ll use today.

Let’s start by downloading Virtual Box. Go ahead and install it.

Once you’ve got Virtual Box installed, let’s make sure that the VMs you’re going to install are able to access the Internet and each other. We’ll setup a quick network for this purpose. Click on “File”, then “Preferences.” Then, choose the “Network” tab.

Go ahead and click the icon to add a network.

Choose any name you want for your network. Perhaps use something more original than the name I gave mine? You can use the same settings that I’ve used here. This is essentially telling Virtual Box to automatically assign IP addresses your VMs between 10.0.2.1 and 10.0.2.255. If you read last week’s post, you’re already familiar with how DHCP works, but if you missed it, why not read it after you’re done here?

Now, you’ve got a fully functional virtual lab minus the actual virtual machines. Let’s get some of those now. You can install as many as you want, but keep this in mind: the VMs will take up disk space, so only install as many as your hard drive can comfortably spare. Of course, it takes two seconds to delete them, so it’s not a huge deal if you create too many. The VMs also take up memory, but that’s only when they’re actively running. So, you can install a bunch of VMs but keep them off, only turning on the ones you intend to use for as long as you’re using them.

Ok, with that in mind, let’s go grab a Windows 10 VM. Head over to Microsoft’s developer page and download one of their Windows VM images. These images are meant for developers who need to test their code with the Edge browser and are given out free by Microsoft. Thanks Bill Gates! Note that these VMs expire in 90 days, so Microsoft recommends taking a snapshot of the VM which allows you to revert your VM back to the state it was in when you took the snapshot. We’ll do that in a little bit. Also, note the super secure password for your VM. At the time I’m writing this, the password is: “Passw0rd!” Go ahead and download the file for Virtual Box.

Now, while the file’s downloading, let’s take a moment to talk about the different types of files you may encounter as you set up your lab.

First, you have what’s called an “ISO”, which is essentially an installation file. To use this, you’ll first create your blank VM (we’ll do this in a second,) and then you’ll mount the ISO to boot from it. Think of it as unwrapping a brand new laptop and then putting in a Windows CD or USB stick to install Windows on it. Same concept here, except that your CD is virtual and it’s not called a CD, it’s called an ISO.

Some VMs, on the other hand, are called “virtual appliances.” These are images that are ready to go, no configuration needed. If you see something with a .ova extension, for example, that’s a virtual appliance.

In this case, Microsoft’s provided us with an OVA file, so it’ll be ready to go instantly. The only thing we need to do at this point is import it. So, to recap, for an ISO file you’ll need to create a blank VM and then install the operating system from the ISO, and for an OVA file you’ll simply import the OVA because it’s a ready-made VM. Don’t worry, I’ll walk you through an example for each.

Let’s import the OVA file now. Extract the OVA file (it came zipped to conserve space) and put it someplace you can easily find it.

Go back to Virtual Box and select “File,” “Import appliance,” then “OVA file.” Once you’ve clicked through the choices, you’re almost ready to go. We just need to tell your new machine how to access the network you created earlier. Right click on the machine and select “Settings.” Then, click on the network tab. From the drop down menu, select “NAT Network” and the network you created earlier.

Great, now you’re all set with a Windows VM!

Since we installed a virtual appliance, let’s now go over how to install a VM from an ISO. This time, we’ll install a Linux VM.

First, let’s create a new VM. Click on “Machine” and then select “New.” You can call it whatever you like. Select type “Linux” and version “Debian (64-bit).”

You’ll get to choose the amount of RAM you want to dedicate to this. Leaving the default is fine, or you can give it more if you want. It really depends on how much RAM you have installed in your computer. Select “Create a virtual hard disk now.” On the next screen, you can leave it as “VDI.” Dynamically allocated is fine for physical storage. Specify the location where the VM will live and the max disk size it can grow. If you’re not sure, it’s fine to leave defaults for all these choices.

You should now have a Debian Linux VM. However, there’s no operating system on it just yet. Let’s go get an ISO for this from the Debian download page.

From this page, you’ll see the current version of Debian. As I write this, that’s 10.3.0, so I’ll click on that link. Then, I’ll click on i386. Then, iso-cd.

The download files are at the bottom of the page. Download the one that’s called “Debian-10.3.0-i386-netinst.iso.” (Instead of 10.3.0, yours would have whatever the current version is, of course.)

Now, go back to Virtual Box.

Right click on the Debian VM you created earlier. Select “Settings,” then “Storage.” Under “Controller: IDE,” click on “Empty.” Then, select the CD icon all the way on the right.

Select “Choose/create a virtual optical disk” and navigate to your Debian ISO file. What you’ve just done here is the equivalent of putting in a CD into the CD drive on a physical computer to get it ready for installing an operating system.

Now, start your VM. Press install (regular, not graphical.) Keep the defaults. You can choose a domain name or leave it blank. For our lab purposes, it doesn’t matter. Click through and pick names and passwords to suit your needs.

When you get to the section called “partition disks,” select “Guided – use entire disk.” This will use the entire disk space you allocated for this VM.

Keep going with all the default choices, but make sure to choose “yes” when it asks you to confirm your partitioning choices. Then, wait a bit as the OS is installed.

For network mirror, you can choose “no.” Then, wait some more!

At the“Software selection” screen, choose “Standard system utilities.” Then, more waiting…

At this point, you’re probably remembering fondly how much easier using the OVA file was, but don’t worry, you’re almost done! Just install the grub loader on the virtual hard disk you created, and you now have a fully functional Debian Linux VM!

You now have enough knowledge to create more VMs of your choice. If you want to avoid having to redo all these steps if you break something, I recommend creating a snapshot of any new VM you create right after you create it. This will allow you to revert your VM to a state when everything was working. To take a snapshot, click on your powered off VM and select “Take,” which will create a snapshot for you to use later. You can create more than one snapshot to capture different moments in time that you’d like to be able to revert to.

You’ve now got a fully functional home lab to experiment with. Why not install a few more VMs on your own now? Try installing a Windows Server VM and see if you can figure out how to install Active Directory on it. And yes – you’re allowed (encouraged) to use Google to help you figure out how to do that.

Now go learn!

With each post, I cover a new topic to help you get your start (or keep progressing) in your IT career. If it’s your first time visiting this blog, start here. Or, see all my posts about interview questions you should be able to answer.

Author: Silicon Wanderer

I'm a merry wanderer on the path to financial independence through IT. I'm doing it, and I want to show you how you can to!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s