This post may not be specifically about Configuration Manager but if you are studying for certification exams, you will likely find it extremely helpful to have a virtual lab environment that you can use to try out new things and test your knowledge. Many people (even myself) will often use their home network as their lab but this isn’t always optimal. If I break my network and my family can’t use the internet or reach the network shares I will quickly end up in the dog house.
What do you need?
Computer with adequate storage and memory:
These days, you don’t need a lot to build a virtual lab environment. Just about any computer with enough storage and memory will do. One can grab a gaming laptop with 16GB or more RAM these days and for most tasks this will be plenty. Personally I run one on my desktop (32GB RAM) and one on my gaming laptop (24GB RAM). This allows me to have a lab environment wherever I go.
Virtual Machine software:
The 2 main players here are VMware Workstation and VirtualBox. While VirtualBox is free I feel that VMWare Workstation offers some features that make it worth the cost. And really, if you’re talking about your career and future, the cost is definitely a worthwhile investment. I’ll probably go into VirtualBox more in future blog posts but for now we are going to stick with VMware Workstation. Fortunately, you can demo it for free and do everything covered in this lab.
Read on for the full post!
Open VMware Workstation. From the Edit menu, select “Virtual Network Editor…”
By default VMware comes configured with 3 Virtual Network Options: Bridged, Host-only and NAT. While we could just modify one of these, it’s best to leave the defaults as-is and add our own (on Windows, VMware can have 25!).
Click Add Network. Choose a network to add, you can pick whatever you want here, I like 10 because it’s easy to remember.
Vmware Workstation will assign a default subnet but we want to set up our own DHCP server later so we are going to disable this.
Also since this network will be completely isolated, we don’t need this tied to a virtual network adapter in Windows. So we will uncheck both the options.
Now we have our Virtual Network configured and we can start to create some Virtual Machines for our Lab. We’ll start by creating a folder for our Lab to help us keep everything organized so we know what VMs are a part of our lab and which are used for other purposes.
Now we are finally ready to start creating some Virtual Machines! The first thing we should probably create is a firewall / router. Even on most home networks these days, you don’t connect your computer directly to your ISP-provided Modem. While we aren’t worried so much about our virtual lab being attached, we do want to prevent our lab from interfering with services on our network and vice-versa.
There are many choices out there for standalone firewall OSs like m0n0wall and pfSense, for my virtual labs I use and prefer m0n0wall simply because it is very small and light on resources (I want to save my memory and drive space for my other machines in my virtual lab!).
Now let’s create our new Virtual Machine.
We’ll stick with Custom (advanced) VMs for this entire lab.
Hardware compatibility isn’t really important for this sort of lab but you may want to choose a version that is compatible with ESX Server in case you ever wish to migrate one of your machines to vSphere if you have such an environment available to you.
I prefer to use the option “I will install the operating system later.” as I want to gain as much experience as possible performing the installations.
M0nowall is based off the FreeBSD Operating System so in this case we will choose Other > FreeBSD.
It’s a good idea to come up with a naming convention for your lab just to keep things organized.
For a firewall, we only need a single processor and core but later on you may wish to use more on some of your other virtual machines.
If you’re using m0n0wall, you can lower your memory to 128MB here.
Choosing the Network Type is where things can get a little confusing. What you chose here will depend on what kind of environment your Host computer (the computer running VMware Workstation) is running on.
If you are limited to a certain number of devices on your network or in a corporate network where only approved devices are allowed, you will want to choose NAT. If you don’t have any such restrictions, you may as well select bridged networking which will give this virtual machine a unique IP address on your network. Think of this as the WAN port on your home router, this is what is connected directly to the internet and filtering out all the bad traffic that is trying to harm your computers. The benefit to using bridged networking is that if we want to later, we can poke holes in our firewall in order to allow access to select services in our lab. For example, we could allow RDP connections to one of the virtual machines inside.
Just use the default controller type and disk type.
Next we create a new virtual disk. For m0n0wall we need very little storage space. Let’s pick 256MB (0.25GB). And just this one time, we can select the option to store virtual disk as a single file.
Again we will store the disk file in the default location, with the VM.
Select Finish to complete the wizard.
You will need to drag the new VM into the lab folder you created earlier.
The next step is to edit the virtual machine settings so we can customize it a little further.
The first thing we need to do is add a network adapter because we need to connect our firewall to the virtual network we created earlier. Select Add. Then highlight Network Adapter and click Next.
Now we need to select our Custom virtual network we configured earlier. Select the Custom radial and then use the drop-down to select the network you created.
Now you will see 2 network adapters in the VM settings. This is much more… firewall-like…
Next we need to install an Operating System on our VM. Select CD/DVD (IDE) from the hardware devices list and then Use ISO image file. Browse to where you saved the m0n0wall ISO and select that.
We are now ready to boot our virtual machine. Select OK to close the Virtual Machine Settings dialog and then “Power on this virtual machine”.
A lot of text will scroll across the screen but eventually you will get be left with a menu. At this point, you do have a working firewall but m0n0wall is only running in memory and has not yet been installed to the harddrive of the computer. This means any changes you make will not be saved. So before anything we’ll pick option 7 to “Install on Hard Drive”.
There will only be one hard drive since we only created one. Enter ad0 at the prompt and then press Enter.
Press y and Enter to install to the hard drive and reboot the firewall.
Once m0n0wall finishes installing, you will see a screen like this and be ready to start configuring. In almost every case (in my experience) the network cards will be backwards. What this means is m0n0wall will have your LAN and WAN adapters backwards. The LAN adapter will have an address of 192.168.1.1 (the default) and the WAN IP Address will be unknown. In order to fix this, we will need to reverse which network cards m0n0wall uses for WAN and LAN.
This brings us to another problem, when reconfiguring, m0n0wall will also change the names of the adapters. To start they are called em0 and sis1. Select 1 and ENTER to swap the WAN and LAN interfaces.
You will notice, m0n0wall now calls the devices em0 and em1. Fortunately we know that em0 was by default set to LAN, so this is the one we want to now become our WAN interface. And em1 will become the LAN interface.
Because we’re just setting up a simple lab network, we don’t need to configure any VLANs. We’ll answer “N” to that question and hit Enter to move on.
Because we are using a virtual environment, m0n0wall will be unable to auto-detect our interfaces for us so be sure to manually enter the devices here:
At the next prompt, just press Enter:
Again, press y to proceed and reboot the firewall with the new configuration (I have no idea why this is so Windows 98-esq and requires a reboot).
The firewall will reboot. If you selected NAT for your WAN adapter, you may not see an IP address right away, but fear not!
If you ping the Gateway for your NAT network (in my case 192.168.32.1 (I know this because the NAT network is 192.168.32.0 on my computer and you can find that in your virtual network settings from earlier). Once the console returns from that command, you will now have the WAN IP address listed.
Our network now has a firewall!
Now we will add a virtual machine to our lab so we can actually start… labb-ing?
Again once you have started the New Virtual Machine Wizard, use a Custom configuration and select that you will install the operating system later. Be sure to select which Guest Operating System you will be installing, Windows 7, 8, Server 2008/2012. In this case I’ll be using Server 2012.
When selecting a network type, pick any of the first 3 options as this is just temporary; however we still wish to have a network card in our VM and reconfiguring an existing NIC will still be quicker than adding a new one to the VM later.
Select whichever disk size you wish but if it’s larger than a couple of GB you’ll want to make sure you will probably want to Split the virtual Disk into multiple files (this makes backup much easier). You can check the box beside Allocate all disk space now if you wish but to save on storage space I usually leave this un-checked. You will take a performance hit leaving it un-checked but in my experience it’s not enough to worry about since my lab isn’t about speed, it’s about having enough resources to run many virtual machines at the same time to simulate various tasks.
Again, once your VM is created and you’ve closed the wizard, move your new VM into the lab folder you created earlier.
Now we need to adjust our network settings to ensure that the new virtual machine is in our lab network and not another network. Edit the virtual machine settings and select Network Adapter from the settings dialog window. Under Network connection, select Custom: Specific virtual network. Select the network you configured earlier, in my case it is VMnet10.
Next select the CD/DVD drive in the settings editor. Select the ISO you wish to boot from and then OK to close the settings editor.
Now you’re ready to install your OS, boot you VM and go for it!