2020.03.26 – Building a VMware vSphere Virtual Lab with VMware Fusion – Part 0: Starting a Technical Project

I will public a few pages step-by-step how I work to build a VMware vSphere Virtual Lab with VMware Fusion.

All Photos are here: https://photos.app.goo.gl/8mZmnAGTjN8j3M1p8

Overview

I read a blog and I plan to apply all info and steps. I will publish all I do!

Mine lab parts:

GraspingTech’s helping guid:

Diagram of vSphere Virtual Lab

Details

I have a MacBook PRO at the bottom which is running VMware Fusion and has two custom networks (vmnet10 and vmnet11).

The green network (vmnet10) is a private network used for managing ESXi hosts, vCenter Server (vc01), the pfSense firewall (fw01) and the iSCSI storage server (us01).

The red network (vmnet11) is a separate private network which has NAT enabled so that VMs can access the internet through the MacBook. This network will be used to simulate a WAN connection coming into your lab. Traffic on this network will go through the virtual pfSense firewall running on an ESXi machine.

There will be four Virtual Machines (VMs) running on VMware Fusion. These machines simulate what would be physical machines in a production environment. They are the ESXi hosts and the storage servers.

The VMs at the top of the diagram will run on the virtual ESXi hosts. These are the pfSense firewall, vCenter Server and a demo web server. Notice the web server is on a different subnet to the management machines (10.1.2.0), this is because it will be on its own network (DMZ) that is segregated by VLANS. Traffic from the DMZ will need to go through the pfSense firewall.

The diagram also shows two iSCSI networks with different VLANS. The traffic from iSCSI and any other vSphere network traffic will run through the same virtual switch (vmnet10) as the management network and we’ll use VLANS to segregate it. You can think of this switch as being a simulation of a stacked 10 GB physical switch.

My Hardware and Software I’m planing to use or I’m already using:

  • I’m planning to read and use nested virtualisation
  • I am using MacBook Pro (15-inch, 2016):
    • macOS Catalina version 10.15.3
    • Processor 2,9 GHs Quad-Core Intel
    • Memory 16 GB 2133 MHsLPDDR3 (of RAM)
  • Installed and use VMware Fusion PRO Version 11.5.3: this allows the hardware assisted virtualisation feature of the CPU to be used in a virtual machine.
  • Install and use VMware vSphere ESXi 6.7. I will include details for this installation in this blog.

What I Have Done Next?

Step 1: Nested Virtualization on a Mac

In past I remember I had these problem of getting the two main open-source virtualisation products (QEMU and VirtualBox) to run nested virtualisation.

It seems that this is because they don’t pass the hardware assisted virtualization feature of the CPU to the virtual machine.

$ kvm-ok  
INFO: Your CPU does not support KVM extensions  
INFO: For more detailed results, you should run this as root  
HINT:   sudo /usr/sbin/kvm-ok

It seems that nested virtualisation is possible on a Mac only with VMware Fusion application.

Network virtualisation can be enabled by ticking the VMware Fusion => I select VMware => I select ESX 6 => Processor & Memory => Advanced Option => Enable hypervisor applications in this virtual machine option.

Now when running the kvm-ok command I get the following output.

$ kvm-ok 
INFO: /dev/kvm exists 
KVM acceleration can be used

Seems that the only way to get nested virtualisation working on a Mac at the time of writing, is to use a commercial product like VMware Fusion.

Step 2: Create VMware Fusion Networks

Reading and learning from here …

I have to create virtual networks so that I can test various network infrastructure configurations on a single MacBook PRO with VMware Fusion PRO.

I’ve closed VMware Fusion and I’ve opened Terminal application.

Now I edit the file using help from my article about vim: 2020.03.31 – Using vim command in Terminal in MacBook Pro

I’ve edited the VMware Fusion networkingconfig file.

sudo vim /Library/Preferences/VMware\ Fusion/networking

I’ve aded many network. I need them to use Juniper Applications (vMX, vSR and vQFX). The first, 10 and 11, is proposed into GRASPINGTECH blog, Building a VMware vSphere Virtual Lab with VMware Fusion – Part 1: Installing ESXi article post.

VERSION=1,0
answer VNET_10_DISPLAY_NAME vSphere
answer VNET_10_HOSTONLY_NETMASK 255.255.255.0
answer VNET_10_HOSTONLY_SUBNET 10.1.1.0
answer VNET_10_VIRTUAL_ADAPTER yes
answer VNET_11_DHCP no
answer VNET_11_DISPLAY_NAME WAN
answer VNET_11_HOSTONLY_NETMASK 255.255.255.0
answer VNET_11_HOSTONLY_SUBNET 198.18.0.0 <- this IP was modified
answer VNET_11_NAT yes
answer VNET_11_NAT_PARAM_UDP_TIMEOUT 30
answer VNET_11_VIRTUAL_ADAPTER yes
answer VNET_12_DHCP no
answer VNET_12_HOSTONLY_NETMASK 255.255.255.0
answer VNET_12_HOSTONLY_SUBNET 198.18.12.0
answer VNET_12_NAT no
answer VNET_12_VIRTUAL_ADAPTER yes
answer VNET_13_DHCP no
answer VNET_13_HOSTONLY_NETMASK 255.255.255.0
answer VNET_13_HOSTONLY_SUBNET 198.18.13.0
answer VNET_13_NAT no
answer VNET_13_VIRTUAL_ADAPTER yes
answer VNET_14_DHCP no
answer VNET_14_HOSTONLY_NETMASK 255.255.255.0
answer VNET_14_HOSTONLY_SUBNET 198.18.14.0
answer VNET_14_NAT no
answer VNET_14_VIRTUAL_ADAPTER yes
answer VNET_15_DHCP no
answer VNET_15_HOSTONLY_NETMASK 255.255.255.0
answer VNET_15_HOSTONLY_SUBNET 198.18.15.0
answer VNET_15_NAT no
answer VNET_15_VIRTUAL_ADAPTER yes
answer VNET_16_DHCP no
answer VNET_16_HOSTONLY_NETMASK 255.255.255.0
answer VNET_16_HOSTONLY_SUBNET 198.18.16.0
answer VNET_16_NAT no
answer VNET_16_VIRTUAL_ADAPTER yes
answer VNET_17_DHCP no
answer VNET_17_HOSTONLY_NETMASK 255.255.255.0
answer VNET_17_HOSTONLY_SUBNET 198.18.17.0
answer VNET_17_NAT no
answer VNET_17_VIRTUAL_ADAPTER yes
answer VNET_18_DHCP no
answer VNET_18_HOSTONLY_NETMASK 255.255.255.0
answer VNET_18_HOSTONLY_SUBNET 198.18.18.0
answer VNET_18_NAT no
answer VNET_18_VIRTUAL_ADAPTER yes
answer VNET_19_DHCP no
answer VNET_19_HOSTONLY_NETMASK 255.255.255.0
answer VNET_19_HOSTONLY_SUBNET 198.18.19.0
answer VNET_19_NAT no
answer VNET_19_VIRTUAL_ADAPTER yes
answer VNET_1_DHCP yes
answer VNET_1_DHCP_CFG_HASH 082DB7B9E93CDB115407783A34BFA59C2487BDEE
answer VNET_1_HOSTONLY_NETMASK 255.255.255.0
answer VNET_1_HOSTONLY_SUBNET 192.168.185.0
answer VNET_1_VIRTUAL_ADAPTER yes
answer VNET_20_DHCP no
answer VNET_20_HOSTONLY_NETMASK 255.255.255.0
answer VNET_20_HOSTONLY_SUBNET 192.18.20.0
answer VNET_20_NAT no
answer VNET_20_VIRTUAL_ADAPTER yes
answer VNET_21_DHCP no
answer VNET_21_HOSTONLY_NETMASK 255.255.255.0
answer VNET_21_HOSTONLY_SUBNET 192.18.21.O
answer VNET_21_NAT no
answer VNET_21_VIRTUAL_ADAPTER yes
answer VNET_22_DHCP no
answer VNET_22_HOSTONLY_NETMASK 255.255.255.0
answer VNET_22_HOSTONLY_SUBNET 192.18.22.0
answer VNET_22_NAT no
answer VNET_22_VIRTUAL_ADAPTER yes
answer VNET_23_DHCP no
answer VNET_23_HOSTONLY_NETMASK 255.255.255.0
answer VNET_23_HOSTONLY_SUBNET 192.18.23.0
answer VNET_23_NAT no
answer VNET_23_VIRTUAL_ADAPTER yes
answer VNET_24_DHCP no
answer VNET_24_HOSTONLY_NETMASK 255.255.255.0
answer VNET_24_HOSTONLY_SUBNET 192.18.24.0
answer VNET_24_NAT no
answer VNET_24_VIRTUAL_ADAPTER yes
answer VNET_8_DHCP yes
answer VNET_8_DHCP_CFG_HASH C788B1360C2E747C97853514C902FE9DBDDC7A88
answer VNET_8_HOSTONLY_NETMASK 255.255.255.0
answer VNET_8_HOSTONLY_SUBNET 192.168.100.0 <- I have changed the Internet company, the switch so I have to modify here the IP address to solve the problem of all Virtual Machine
answer VNET_8_NAT yes
answer VNET_8_VIRTUAL_ADAPTER yes <- was missing and I've added
add_bridge_mapping en0 2

VNET 1 is displayed between 19 and 20. Maybe the VMware Fusion works like this ….

Note: I have done some modification. I copy-paste here the modificated version and I described details about VMware Fusion Networks here: 2020.04.11 – Virtual Network Customization in VMware Fusion

Note: I hade a problem with Network Adapters and I solved here.

We will use these custom networks when creating our ESXis, Juniper Applications, iSCSI VMs and more …

I wanted to put all network into existing ESXi 6.x like this: open VMware Fusion > click ESXi 6.x from VIRTUAL MACHINES > click Add Device… > click Network Adapter.

When I wanted to create a new Network Adapter 11 (I had already 10) I get an error: The virtual machine already contains the maximum number of network adapters.

OK … I stop here with network configuration and I go farther …

Step 3: Modify the Mac hosts file

The next step, is to edit the MacBook PRO hosts file so that I can access the ESXi hosts or vCenter Server using domain names in the web browser instead of by IP address.

sudo vim /etc/hosts

I have added the following lines to the hosts file. Is all I have installed or some new things I want to install and use soon.

 10.1.1.10      esxi00.silvique.ro            esxi00
 10.1.1.11      esxi01.silvique.ro            esxi01
 10.1.1.12      esxi02.silvique.ro            esxi02
 10.1.1.13      esxi03.silvique.ro            esxi03
 10.1.1.14      esxi04.silvique.ro            esxi04
 10.1.1.51      evepro.silvique.ro            evepro
 10.1.1.101     vc01.silvique.ro              vc01
 10.1.1.201     us01.silvique.ro              us01
 10.1.1.251     fw01.silvique.ro              fw01
 10.1.1.251     pfSense.silvique.ro           pfSense
 10.1.1.221     gns3.silvique.ro              gns3
 10.1.1.222     ubuntu-16-server.silvique.ro  ubuntu-16-server
 10.1.1.223     ubuntu-16.silvique.ro         ubuntu-16
 192.168.197.20 vmx.silvique.ro               vmx
 192.168.197.16 vsrx1.silvique.ro             vsrx1
 192.168.197.17 vsrx2.silvique.ro             vsrx2
 192.168.197.18 vsrx3.silvique.ro             vsrx3
 192.168.197.19 vsrx4.silvique.ro             vsrx4
 192.168.197.21 vqfx1.silvique.ro             vqfx1
 192.168.197.22 vqfx2.silvique.ro             vqfx2          

Note: I have available 6 CPU(s) for ESXi. And I will install and use all in different labs.

I can test to see if the domains map to the IP addresses. I power-on esxi01 and use Terminal to ping either esxi01 or esxi01.silvique.ro and I noticed what IP address the ping command tries to get a reply from.

murgescusilvia@Murgescus-MacBook-Pro ~ % ping 10.1.1.11
 PING 10.1.1.11 (10.1.1.11): 56 data bytes
 64 bytes from 10.1.1.11: icmp_seq=4 ttl=64 time=0.591 ms
 64 bytes from 10.1.1.11: icmp_seq=5 ttl=64 time=0.326 ms
 

 murgescusilvia@Murgescus-MacBook-Pro ~ % ping esxi01
 PING esxi01.silvique.ro (10.1.1.11): 56 data bytes
 64 bytes from 10.1.1.11: icmp_seq=3 ttl=64 time=0.647 ms
 64 bytes from 10.1.1.11: icmp_seq=4 ttl=64 time=0.875 ms
 

 murgescusilvia@Murgescus-MacBook-Pro ~ % ping esxi01.silvique.ro
 PING esxi01.silvique.ro (10.1.1.11): 56 data bytes
 64 bytes from 10.1.1.11: icmp_seq=6 ttl=64 time=0.369 ms
 64 bytes from 10.1.1.11: icmp_seq=7 ttl=64 time=0.323 ms

I have done these tests after finishing to install ESXi01. So, last things from Step 2 and Step 3 is after finishing Part 1: Installing ESXi.

Note on 2020.03.27: To be able to open ESXi into Firefox using https://esxi00/ after the modifications I have include into these article I have to power-off and power-on the MacBook PRO. It is NOT ENOUGH to power-off and power-on this only the VMware Fusion application!!!

Note: And the tutorial for ESXi installation will be exactly Part 1: Installing ESXi