Build A Virtual Lab with VMware Workstation

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…”

2015-02-12 12_24_49-MHA-SWTEST1-7 - VMware Workstation

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!).

2015-02-12 12_31_34-Virtual Network Editor

Click Add Network. Choose a network to add, you can pick whatever you want here, I like 10 because it’s easy to remember.

2015-02-12 12_32_14-Add a Virtual Network

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.

2015-02-12 12_33_44-Virtual Network Editor

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.

2015-02-12 12_39_13-Virtual Network Editor

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.

2015-02-12 12_44_19-MHA-SWTEST1-7 - VMware Workstation-edit

2015-02-12 12_45_00-VMware Workstation-edit

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.

2015-02-12 12_56_32-VMware Workstation

We’ll stick with Custom (advanced) VMs for this entire lab.

2015-02-12 12_58_06-VMware Workstation

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.

2015-02-12 13_00_57-VMware Workstation

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.

2015-02-12 13_02_46-VMware Workstation

M0nowall is based off the FreeBSD Operating System so in this case we will choose Other > FreeBSD.

2015-02-12 13_05_03-VMware Workstation

It’s a good idea to come up with a naming convention for your lab just to keep things organized.

2015-02-12 13_06_52-VMware Workstation

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.

2015-02-12 13_09_11-VMware Workstation

If you’re using m0n0wall, you can lower your memory to 128MB here.

2015-02-12 13_10_36-VMware Workstation

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.

2015-02-12 13_22_17-VMware Workstation

Just use the default controller type and disk type.

2015-02-12 13_23_13-VMware Workstation

2015-02-12 13_24_19-VMware Workstation

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.

2015-02-12 13_25_27-VMware Workstation

2015-02-12 13_27_31-VMware Workstation

Again we will store the disk file in the default location, with the VM.

2015-02-12 13_34_27-VMware Workstation

Select Finish to complete the wizard.

2015-02-12 13_35_23-VMware Workstation

You will need to drag the new VM into the lab folder you created earlier.

2015-02-12 13_36_27-TM10-MONO - VMware Workstation-edit

2015-02-12 13_37_04-TM10-MONO - VMware Workstation

The next step is to edit the virtual machine settings so we can customize it a little further.

2015-02-12 13_37_57-TM10-MONO - VMware Workstation

2015-02-12 13_40_20-TM10-MONO - VMware Workstation

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.

2015-02-12 13_40_42-Virtual Machine Settings

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.

2015-02-12 13_42_18-Virtual Machine Settings

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.

2015-02-12 16_26_52-TM10-MONO - VMware Workstation

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”.

2015-02-12 16_34_27-TM10-MONO - VMware Workstation

There will only be one hard drive since we only created one. Enter ad0 at the prompt and then press Enter.

2015-02-12 16_34_57-TM10-MONO - VMware Workstation

Press y and Enter to install to the hard drive and reboot the firewall.

2015-02-12 16_38_22-TM10-MONO - VMware Workstation

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.

2015-02-12 16_43_13-TM10-MONO - VMware Workstation

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.

2015-02-12 16_49_33-TM10-MONO - VMware Workstation

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:

2015-02-12 16_51_17-TM10-MONO - VMware Workstation

At the next prompt, just press Enter:

2015-02-12 16_52_28-TM10-MONO - VMware Workstation

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).

2015-02-18 13_49_32-Virtual Lab VMware Workstation - OneNote

The firewall will reboot. If you selected NAT for your WAN adapter, you may not see an IP address right away, but fear not!

2015-02-18 13_47_52-Virtual Lab VMware Workstation - OneNote

 

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.

2015-02-12 17_02_18-TM10-MONO - VMware Workstation

 

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.

2015-02-17 12_50_23-MHA-TMEHRERVM01 - VMware Workstation

 

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.

2015-02-17 12_50_42-MHA-TMEHRERVM01 - VMware Workstation

 

Again, once your VM is created and you’ve closed the wizard, move your new VM into the lab folder you created earlier.

2015-02-17 12_51_59-TM10-DC01 - VMware Workstation

 

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.

2015-02-17 12_55_32-Virtual Machine Settings

 

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.

2015-02-17 13_04_19-TM10-DC01 - VMware Workstation

 

Now you’re ready to install your OS, boot you VM and go for it!

2015-02-17 13_06_41-TM10-DC01 - VMware Workstation

9 thoughts on “Build A Virtual Lab with VMware Workstation”

  1. I want to make different vm for sccm environment like.
    vm1 . ……..Ad + Dns + Dhcp
    Vm2 ……… Sccm + sql

    So , what is m0n0wall , is it the iso for vm.

  2. For this lab, I am using M0n0wall as a firewall to separate my lab environment from the rest of my network which already has a DC/DNS/DHCP server. It would be the same as adding a physical router on your network and placing actual computers behind that router. While you may be able to connect to the internet and possibly even ping addresses on that network, the services behind the router would not be available to your primary network without using port forwards.

  3. Dear sir, actually i need to learn sccm 2012 including it’s all activities like patch management, application deployment , osd etc.
    I have laptop 8gb ram, 700 gb hdd, intel i5 , win 7 prof _x64.

    I am planning to make sccm 2012 environment on it. For it i need to ask what are better options.

    Previously i made sccm 2007 environment on same laptop.
    I created 4 vm in workstation 11.

    1. vm for AD,DNS,DHCP……………..1 gb ram, win ser 2008 r2
    2. vm for sccm 2007,sql ………2 gb ram, win ser 2008 r2
    3. vm for client ……………….1 gb ram win 7 pro sp1
    4. vm for client ……………..1 gb ram win 7 pro sp1

    For sccm 2012 , what configuration should i need for vm’s.

    can i install sccm 2012 on win server 2008 r2
    should i need to install sql 2008 on different vm on on same vm of sccm .

  4. Hi Travis, I followed your guide and I have installed a vm server 2012 behind the M0n0 firewall on vmnet10 like you said. I can’t understand how my server 2012 can access the internet if it’s on the isolated vmnet10 we created? Any chance you can clarify for me I am struggling to find the answer. Thanks for the guide Travis

    Richard

    1. Thanks for your question Richard. The way server 2012 gets access to the internet is through m0n0wall. By giving m0n0wall 2 network interfaces (one on vmnet10 and one on either bridged or NAT), this allows it to pass traffic through to your server 2012 VM and any other VMs you add to the vmnet10 virtual network.

  5. Thank you Travis for your response. So the WAN NIC we setup on the m0n0wall is bridged to my physical NIC? That’s why the WAN gets an IP on my 192.168.0.0 home LAN? My boss told me that I needed two physical NIC’s on my PC for the m0n0wall to work so I was confused if it was actually working.

    Your knowledge and help is very appreciated. It’s not easy finding answers to details to specifics and unfortunately I am not an expert in VMWare but I’m learning. Thanks again Travis!!

    Richard

  6. Thank you for guiding. I have installed m0n0wall and I’m unable to see WAN ip address does it mean my lab do not have network connection. how to ping please?

  7. Hey,

    thanks for this tutorial. I’m struggeling with one point. What is I want to use subnet 10.0.0.x and I want a fixed IP on my server 10.0.0.10. How do I configure this to have internet access ? What do I put as default gateway for example ? The IP address of M0n0wall ?

Leave a Reply

Your email address will not be published. Required fields are marked *