March 7, 2019
Building VMware Home Lab: Complete How-To
VMware is one of the best virtualization platforms in the world, popular among IT specialists due to its ability to provide high speed operations, reliability, scalability, security and convenience. The number of VMware users is growing every day – VMware provides virtualization solutions for both home and enterprise-level users which satisfy all of them. VMware type 2 hypervisors can be installed on existing operating systems running on desktops and laptops while the type 1 hypervisor can be installed directly on physical servers (a bare metal hypervisor). Type 2 hypervisors such as VMware Player, Workstation or Fusion are usually more affordable for users and IT enthusiasts than the type 1 hypervisor (ESXi Server). Not every user has a free physical server or servers in the inventory on which to try an ESXi and VMware vSphere enterprise grade virtualization solution. Technically, ESXi can be installed on your physical computer but you may need to integrate a VIB package into the ESXi installation disk image if the ESXi installer cannot detect some devices (VIB packages contain device drivers for ESXi).
Today’s blog post explains how to deploy VMware home lab for trying vSphere with ESXi hosts and vCenter in your existing environment by using a laptop or desktop computer. This blog post also instructs you on how to attach shared storage and use vMotion/Storage vMotion for migrating VMs between ESXi hosts and datastores. The blog post is written in a walkthrough format to make the installation process of VMware home lab clearer.
Hardware Configuration for a VMware Home Lab
VMware Workstation is used in today’s blog post for deploying ESXi hosts as virtual machines. Moreover, VMware provides a nested virtualization feature. Hence, you can create a VM running inside a VM. In this particular case you can deploy a VM on an ESXi host running on a VM. To be able to work comfortably with the VMware home lab you need to have a computer that meets the following requirements: 32 GB of RAM, a multicore x64 CPU with 1.3 GHz or faster core speed (produced in 2011 or later) that supports Intel VT-x or AMD-V virtualization hardware extensions, a hard disk drive (HDD) with about 200 GB of free space (SSD is preferred due to a higher read/write speed), Ethernet network adapter, Linux or Windows x64 operating system (with GUI) installed on your physical machine.
The following software is used for the VMware home lab explained in today’s blog post:
- VMware Workstation 15 is used as a desktop hypervisor
- VMware ESXi Server 6.7 as a VM (2 VMs total)
- VMware vCenter Server 6.7 (1 VM, deployed as a virtual appliance)
- FreeNAS 11.2 for creating an iSCSI shared storage (1 VM)
- Lubuntu 16 Linux for installing on a nested VM
Below you can see a principal scheme of a VMware home lab to be deployed.
Total requirements are based on the following minimum requirements:
- ESXi needs at least 4 GB of RAM (8 GB or more are recommended); 2 CPU cores.
- vCenter Server needs at least 8 GB of RAM; 2 CPU cores.
- FreeNAS: 8 GB of RAM is recommended.
- Your host operating system needs at least 4 GB of RAM to work properly
- VMware Workstation needs at least 2 GB of RAM (4 GB or more are recommended)
Licensing and price
You can set up a VMware home lab for free for the appropriate period of time if you respect the appropriate installation combination. It is recommended to set up all lab components in a short time period (for example, for a few days) because after installing ESXi, the trial period begins and if you try to install vCenter in a month after installing ESXi, you’ll have only one month left for testing vSphere in your lab.
VMware Workstation provides a 60-day free trial for new users. When the trial period expires, VMware recommends that you buy a license - otherwise VMs cannot be started. You can use the VMware Player to run your VMs for free after that, but the VMware Player includes fewer features: for example, the Virtual Network Editor is missing. VMware Workstation and VMware Player can be installed on a Linux operating system that is completely free. You don’t need to go out and buy a Windows OS for your VMware home lab setup. Of course, if you already have a computer running Windows, you can use it for installing VMware Workstation.
ESXi provides a free 60-day full-featured evaluation period. When the trial period expires, you should apply for a license. You can also use a free license, but most of the most important features are disabled in the free version. You can also create a new VM and install ESXi from scratch in your VMware test lab. Read the blog post about Free ESXi to learn more about ESXi licensing.
VMware vCenter Server for vSphere 6.7 can be used for a 60-day evaluation period free of charge.
FreeNAS is a completely free software solution based on the FreeBSD operating system.
Installing VMware Workstation
Now that the hardware is prepared and the operating system is installed, you can download and install the VMware Workstation on your physical machine. In order to download VMware Workstation for Linux or Windows, visit this page on VMware’s site.
Installing VMware Workstation on Linux
Go to the directory where you saved the downloaded installer file. In the current example the VMware Workstation installer is located in the Downloads directory:
Make the installer file executable:
sudo chmod +x ./VMware-Workstation-Full-15.0.2-10952284.x86_64.bundle
Run the VMware Workstation Linux installer:
The installation wizard window now appears. Answer the questions provided by the wizard and click Next for switching to the next step.
- Accept the license agreement.
- Would you like to check for product updates on startup? Select Yes or No.
- Would you like to join the VMware Customer Experience Improvement Program? Select Yes or No.
- Enter the user that will initially connect to the Workstation Server. Type the user name of the account you are using in Linux.
- Choose a directory for your shared virtual machines, for example, /var/lib/VMware/SharedVMs
- Enter the port to use for HTTPS access to Workstation Server (443 by default).
- Enter the license key. Keep this field empty for the free trial mode.
- The product is ready to be installed. Click the Install button.
GNU C Compiler must be installed before running the VMware Workstation. In order to install this compiler, execute the command:
sudo apt-get -y install gcc make linux-headers-$(uname -r) dkms
The interfaces of VMware Workstation for Linux and for Windows are identical. Below you can see the screenshot of the interface of VMware Workstation 15 running on Linux.
VMware Player is also installed by default when you install VMware Workstation.
Installing VMware Workstation on Windows
Go to the directory where you saved the downloaded installer and run the installer file. The name of the file is VMware-workstation-full-15.0.2-10952284.exe in this case. Similarly to the installation on Linux, a wizard opens. After configuring options click Next for switching to the next step of the wizard.
- On the Welcome screen click Next.
- Accept the license agreement.
- Select the installation destination.
- Tick the checkboxes if you want to check for updates on startup and join the VMware Customer Experience Improvement Program.
- Select the shortcuts you wish to place on your system.
- Click Install to begin the installation.
- The final installation screen allows you to enter a license (is not necessary for a free trial mode).
Now you have the installed instance of VMware Workstation on your physical computer.
Deploying a VM Running ESXi on VMware Workstation
For further experiments conducted in VMware home lab used for writing this blog post, a laptop with VMware Workstation 15 installed on Windows 10 should be used (there are C: and D: partitions on a disk). You can reproduce all explained actions on a Linux machine because VMware Workstation is a cross-platform virtualization solution (note that the paths would be different on a Linux machine). The next step is to install ESXi on a VM.
Creating a VM
Download the ESXi 6.7 installer in the ISO format from this page of VMware’s site. You may need to create a VMware account for downloading the installation image; this process is free.
Create a directory to store virtual machines, for example D:\VMware home lab\
Create a subdirectory D:\VMware home lab\ESXi6-7a for storing the files of the first ESXi VM.
Create a new virtual machine in VMware Workstation. Click File > New Virtual Machine. The new virtual machine wizard appears.
- On the Welcome screen select Custom (advanced) and click Next.
- Choose the Virtual Machine Hardware Compatibility. Select Workstation 15.x and click Next.
- Guest Operating System Installation. Select the Installer disk image file (iso) and browse the ESXi installer iso file. Click Next.
- Select a Guest Operating System. Select VMware ESX, then select VMware ESXi 6.x in the drop-down menu and click Next.
- Name the Virtual Machine. Enter the VM name, for example, ESXi6-7a. Select the D:\VMware home lab\ESXi6-7a directory you have created before as a VM location. Click Next.
- Processor Configuration. Specify the following parameters:
- Number of processors: 2
- Number of Cores per processor: 1
If you use 1 CPU with 1 core, the ESXi installer displays an error during installation. Click Next.
- Memory for the Virtual Machine. Specify the amount of memory equal to 4096 MB and click Next.
- Network Type. Select Use network address translation (NAT) and click Next.
- Select I/O Controller Types. Select Paravirtualized SCSI (Recommended) and click Next.
- Select a Disk Type. Select SCSI (Recommended) as a disk type and click Next.
- Select a Disk. Click Create a new virtual disk and click Next.
- Specify Disk Capacity. Set maximum disk size to 5 GB. ESXi doesn’t consume much disk space, and a 5GB disk is enough for ESXi installation. Select Store virtual disk as a single file. Click Next.
- Specify Disk File. Place your virtual disk in the directory specified as the VM location. In this case, the D:\VMware home lab\ESXi6-7a\ESXi6-7a.vmdk is used. Click Next.
- Ready to Create Virtual Machine. Check your VM settings and click Finish to create the VM.
Installing ESXi on a VM
After finishing configuration in the wizard, a VM should be powered on automatically. The VM boots from the ISO image and you can see the ESXi installer interface.
- On the Welcome screen press Enter.
- Read and accept the End User License Agreement (EULA). Press F11 to continue.
- Select a disk to install or upgrade. Select your 5GB virtual disk created before. Press Enter to continue.
- Select a keyboard layout. US Default is selected in this case. Click Enter to Continue.
- Enter a root password. Confirm the root password. Press Enter to continue.
- On the Confirm Install screen press F11 to start the installation.
Read this blog post to see the explanation of ESXi installation in details with screenshots.
Editing VM settings and configuring network
Once ESXi have been installed, shut down the VM running ESXi (click VM > Power > Shut Down Guest or press Ctrl+E in the interface of VMware Workstation) and prepare it for further network and storage configuration. Let’s create a second virtual disk that we’ll use for VM datastore (later nested VMs can be placed on that storage). You should also create a second virtual network adapter (NIC – network interface controller) that can be used for NIC teaming or for connecting to shared storage (we recommend that you use a separate storage network for connecting shared storage to ESXi hosts).
In order to add a new virtual disk to a VM, click VM > Settings and in the Virtual Machine Settings window click Add > Hard Disk, then click Next.
- Select the virtual disk type: SCSI (Recommended). Click Next.
- Create a new virtual disk. Click Next.
- Set a disk size equal to 40 GB and select the “Store virtual disk as a single file” option. Don’t tick the check box “Allocate all disk space now” if you don’t want to use thick provisioning. You can set the maximum disk size for more than 40 GB if you have enough disk space on your physical computer. Click Next.
- Specify virtual disk file location. D:\VMware home lab\ESXi6-7a\ESXi6-7a-0.vmdk is used in the current example because it is convenient to store all VM files in the one directory. Click Finish to create a virtual disk.
In order to add a second network adapter, similarly click Add > Network Adapter. Let’s select different networks for connecting ESXi hosts with each other (NAT Network) and for connecting ESXi hosts with shared storage (Host-Only Network).
The NAT network allows VMs to connect with each other, a host machine, and for a host to connect to VMs. VMs can access an external network that can be accessed by a host.
The Host-Only network allows VMs to communicate with each other and with a host. A host can communicate with VMs. VMs don’t have access to external networks and Internet.
You can find a detailed comparison of VMware virtual networks in this blog post.
VMware Workstation provides you with a virtual network editor with which you can configure your virtual networks such as NAT and Host-Only networks. Moreover, you can create more NAT and Host-Only networks and assign the network addresses, virtual gateways and virtual DHCP servers for them.
The following connection scheme can be used in the VMware ESXi home lab explained in today’s blog post:
Open a Virtual Network Editor by clicking Edit > Virtual Network Editor. Let’s define the following network configuration:
VMnet8 (NAT network)
Network Address: 192.168.101.0/24
Gateway IP: 192.168.101.2
DHCP Settings: IP range is 192.168.101.201 - 192.168.101.254; Default lease time settings.
Network Address 192.168.105.0/24
DHCP Settings: IP range is 192.168.105.201 – 192.168.105.254
In order to edit settings, select the VMnet8 network and click the NAT Settings button.
Set the gateway IP address and advanced network settings. Click OK to save the changes.
Similarly, click the DHCP settings button for editing the DHCP configuration.
Similarly, you can edit DHCP settings for VMnet1 and other networks.
Note: You can use other IP addresses in your VMware home labs. If you want to recreate the environment explained in the blog post, you can use the same configuration for more convenience.
Deploying a Second ESXi Host by Copying the VM
You have just created a VM, installed ESXi 6.7, and configured the VM and networks. Let’s create one more ESXi VM by copying the existing VM. Open your file manager, for example Windows Explorer, and go to the directory where your first VM is residing. In this case, this directory is D:\VMware home lab\. The directory of the first VM is D:\VMware home lab\ESXi6-7a\. Create a directory named ESXi6-7b in the D:\VMware home lab\ directory. Shut down your VM running ESXi (ESXi6-7a). Copy all files from the ESXi6-7a directory to the ESXi6-7b directory. Now you can see one of the advantages of hardware virtualization in action – you don’t need to deploy a new VM from scratch; instead, you can copy the existing VM for multiplying your VMs.
Rename the virtual disks and VM configuration file in the ESXi6-7b directory if you wish to prevent confusion (this step is not necessary):
ESXi6-7a.vmdk → ESXi6-7b.vmdk
ESXi6-7a-0.vmdk → ESXi6-7b-0.vmdk
ESXi6-7a.vmx → ESXi6-7b.vmx
Open the cloned VM in VMware Workstation. Click File > Open and select the D:\VMware home lab\ESXi6-7b\ESXi6-7b.vmx file. Go to VM > Settings > Options and rename your VM to ESXi6-7b. Power on your second ESXi VM (VM > Power > Power On).
VMware Workstation warns you that the virtual disk file is not found. Click Browse and select your D:\VMware home lab\ESXi6-7b\ESXi6-7b.vmdk file. Click Open. The warning is displayed once more for the second virtual disk. Similarly select the ESXi6-7b-0.vmdk file and click Open.
Next, VMware Workstation will warn that this virtual machine might have been removed or copied. Click I Copied It and your second VMs should be loaded.
Why is this warning displayed? It is displayed because the copied VM has the same UUID (Universal Unique Identifier that is a 128-bit integer) as the source VM. UUID is generated depending on VM location and is used for generating VM’s MAC (Media Access Control) address for a virtual network adapter. If you select I Moved It, then the UUID will be preserved. If you select I Copied It, the new UUID will be generated. Each machine must have a unique UUID that is a machine’s digital fingerprint. An example of UUID is 34 5e cb fa fd d4 a1 e1 72 3b 05 62 4d 3a 52 85.
Now you have two VMs on which ESXi servers are installed.
Basic ESXi Configuration
Power on the first VM on which you installed ESXi (ESXi6-7a) and press F2 to customize the system. As you can see on the screenshot, a virtual DHCP server for the VMnet8 virtual network works properly, and the IP address is obtained automatically (192.168.101.202). However, we recommend that you set IP addresses for servers manually and you can see how to do this below. Select Configure Management Network in the System Customization menu and press Enter.
Select the Network Adapters option in the Configure Management Network menu.
You can see the second network adapter you have recently added to the VM. It is better to enable the second adapter later in the web interface. Press Esc to return to the Configure Management Network menu.
Select IPv4 Configuration in the Configure Management Network menu. In this menu Set static IPv4 address and network configuration.
- IPv4 address: 192.168.101.101
- Subnet Mask: 255.255.255.0
- Default Gateway: 192.168.101.2
Press Enter to apply changes.
You can configure the IP settings for the second network adapter later on, when preparing to set up shared storage. Disable IPv6 if you are not going to use this network type. Restart your ESXi VM after configuring the network settings to apply changes. The host name can be changed in System Customization > Configure Management Network > DNS Configuration. In the current example ESXi01 is the name of the first virtual ESXi host for the ESXi home lab (the default host name is localhost).
Now go to the System Customization menu, enter Troubleshooting Options, then enable ESXi Shell and SSH. Enabling these options allows you to manage the ESXi Server with a local console or remotely via SSH.
Open your web browser and enter https://192.168.101.101 in the address bar. Confirm security exception and you will see the login page of VMware Host Client with which you can manage your ESXi host. Enter the login and password you have specified during ESXi installation. Click Log in.
Creating a new datastore
After your login, VMware asks you whether you want to help improve the VMware Host Client. Tick the check box if you want and click OK. Let’s create a new datastore that will utilize the second 40GB virtual disk. This type of datastore is referred to as directly attached storage (DAS). In order to create a new datastore, select Storage in the Navigator (which is located in the left pane of the window), then click New Datastore.
- Select creation type. On this screen select how you would like to create a datastore. Click Create new VMFS datastore and click Next.
- Select device. On this step, select a device on which you would like to create a new VMFS partition. In this case, a 40GB virtual disk is selected. Enter the name of the datastore, for example, datastore40. Then click Next.
- Select partitioning options. Select Use full disk and VMFS6, then click Next.
- Ready to complete. Check the datastore configuration summary and click Finish to complete the datastore creation.
The datastore is now created.
Configuring a network used for shared storage
As you recall, a second NIC was created for the ESXi VM, but was not configured. Now it’s time to configure the second network interface that will be used by the ESXi host for connecting to shared network attached storage. For establishing this connectivity, you have to create a new virtual switch and a new VMkernel NIC. A VMkernel NIC is used for connecting ESXi to a specified network by using the vSwitch to which this VMkernel NIC is connected. Read the blog post about VMware vSwitch to learn more.
Open VMware Host Client and go to Networking > Virtual switches, then click Add standard virtual switch. Note, that there is a vSwitch0 that is created automatically when ESXi is installed.
The Add standard virtual switch window appears. Enter the vSwitch name, for example, vSwitch1. Select vmnic1 in the dropdown menu as Uplink 1. Edit other settings if needed and then click the Add button to add a new virtual switch.
After creating a new vSwitch, go to Networking > VMkernel NICs and click Add VMkernel NIC to create a new VMkernel network adapter.
Define the following parameters in the Add VMkernel NIC window.
- Port group: New port group
- New port group: Storage
- Virtual switch: vSwitch1
- IPv4 Configuration: Static
- Address: 192.168.105.101
- Subnet mask: 255.255.255.0
Tick the checkboxes near the services you want to allow for this VMkernel NIC.
Click the Create button.
Now you can ping the IP address of VMkernel (192.168.105.101) from your host on which VMware Workstation in installed. The first ESXi host is configured. Power on your second VM on which ESXi host is installed (this VM has been cloned recently) and configure your second ESXi host similarly as you configured your first ESXi host, apart from the host name and IP addresses.
The following network parameters are used for the second ESXi in the current example.
1st network adapter (NAT network): IP address 192.168.101.102, mask 255.255.255.0, gateway 192.168.101.2.
2nd network adapter (Host-only network): IP address 192.168.105.102, mask 255.255.255.0.
Deploying vCenter Server
After configuring two VMs as ESXi hosts, you are ready to deploy VMware vCenter Server for managing your ESXi home lab centrally. Download vCenter Server from VMware’s site by using this link. The name of the downloaded file is VMware-VCSA-all-6.7.0-11726888.iso in this example. Open this ISO file or mount it to a virtual CD/DVD drive and copy the VMware-vCenter-Server-Appliance-126.96.36.19900-11726888_OVF10.ova from the vcsa directory of the ISO image to a custom directory on your physical machine (vCenter Server appliance is a partially configured distribution built on a Linux basis that is called a Photon OS).
Deploying the OVA template
In the graphical user interface of VMware Workstation click File > Open and select the extracted VMware-vCenter-Server-Appliance-188.8.131.5200-11726888_OVF10.ova file.
- A pop-up window with EULA (End User License Agreement) is displayed (the OVA import wizard is opened). Tick the check box “I accept the terms of the license agreement” and click Next. Create the D:\VMware home lab\vCenter6-7 directory and define this directory as a storage path for the new virtual machine. Enter the name of the new VM, such as vCenter6-7. Click Next to continue.
- Provide a name and logical storage path for the new virtual machine. In this case the VM name is vCenter6-7 and the VM location is the same as the location for previously created VMs - D:\VMware home lab\vCenter6-7\. Click Next to continue.
- Select deployment options. At this step select the Tiny vCenter Server with Embedded PSC option that will be enough for a small ESXi home lab. Click Next.
- Set the additional properties for this virtual machine. This screen contains multiple menu entries that must be configured. After configuring one menu entry, click another string for configuring the remaining parameters. Drag your mouse over the “i” icon on the right side of the window for reading useful tips.
- Host Network IP address Family: IPv4
- Host Network Mode: static
- Host Network Prefix: 24. In the binary format the /24 mask is 11111111.11111111.11111111.00000000 (24 ones) that is the same as 255.255.255.0 in a decimal format.
- Host Network Default Gateway: 192.168.101.2
- Host Network DNS Servers: 192.168.101.2
- Host Network Identity: vcenter6-7.localdomain (enter the FQDN – a fully qualified domain name).
SSO Configuration. Enter login and password that will be used for Single Sign On.
System Configuration. Enter the root password and confirm this password. This password will be used for console login.
Upgrade Configuration. The parameters of this sub-menu must be configured if you wish to upgrade the existing VMware vCenter Server. Skip configuring this category of parameters if you deploy a fresh vCenter instance.
Miscellaneous. You can skip configuring this category of parameters.
Networking Properties. Enter the domain name (the same as used by ESXi host you have deployed). In the current example, the default localdomain name is used. Click Import to start deploying the vCenter VM from the OVA template. After deploying is complete, the VM is started automatically. The blue-gray management interface is similar to the yellow-gray ESXi management interface (see the screenshot below).
The Static IP Configuration has already been done by you with the OVA deployment wizard. You can check the IP configuration to make sure that network settings are configured correctly inside the VM.
By default, the virtual network adapter of your VM running vCenter may be connected to a network that is distinct from your NAT network (for example, your vCenter VM may be connected to a VMnet0 Bridged network that is not used by any of your VMs in this case). Check the network settings. In the interface of VMware Workstation, click VM > Settings. In the Hardware tab click on your network adapter and select NAT (much like as you had configured for the first and the second VMs running ESXi). After doing this, open the console on your physical machine and ping your vCenter Server IP address (ping 192.168.101.103 in this case) to make sure that the network works properly for your VM running vCenter.
Finishing deploying vCenter
Now that you have deployed your vCenter Server, you should do the rest of VCSA (vCenter Server Appliance) configuration for your ESXi home lab. Make sure that your VMs running vCenter and ESXi servers are functioning. Enter the IP address of your vCenter Server in the address bar of the browser (https://192.168.101.103:5480 in this case) to continue configuring vCenter.
In the Getting Started screen click the Set up icon to configure this appliance as a new vCenter Server. Then the Stage 2 installation wizard is opened.
- Introduction. On this screen click Next.
- Appliance configuration. Set the network configuration (see the screenshot below). You can see the network configuration you have set while deploying the OVA template. Edit the settings if necessary and click Next.
- SSO configuration. Click Create a new SSO domain. You can use the default vsphere.local domain name in this case. Set the Single Sign On password for administrator and confirm the password. Then click Next.
- Configure CEIP. Tick the check box if you want to join the VMware Customer Experience Program. Click Next.
- Ready to complete. Review your settings and click Finish to finalize deploying vCenter. Look at the progress bar and wait until the installation process finishes.
Errors that may occur
Sometimes errors may occur during installation. This section can help you fix some of the most common errors you can expect to encounter.
The supplied System Name is not valid
Important: If there is not a local DNS server in your network, you can get the error message during VMware lab setup at the stage 2 of deploying vCenter.
Error: The supplied System Name is not valid.
Resolution: If the supplied system name is a FQDN, then make sure the DNS forward lookup results in at least one valid IP address in the system. If the supplied system name is an IP address, then it should be one of the valid IP address(es) in the system.
This is because vCenter needs a configured DNS server with A and PTR records for resolving host names to IP addresses and inversely. This is not the same DNS server that is defined for connecting outside your local network (to Internet, for example) in this case. You may need to re-deploy the OVA template after displaying this error.
In the current VMware home lab that is deployed for writing this blog post, the following host names are used for the hosts.
- The virtual network interface of the host machine used for connecting to a VMnet8 (NAT network) - 192.168.101.1 as localdns.localdomain
- The virtual network interface of the virtual gateway used for VMs behind the NAT: 192.168.101.2 as localdns2.localdomain (a virtual DHCP server distributes this IP as a primary DNS server for DHCP clients)
- The network interface of vCenter Server running as a VM: 192.168.101.103 as vCenter6-7.localdomain
If you don’t have a DNS server, you may edit the hosts file on your VM running vCenter and on a physical machine on which VMware Workstation is installed. This solution is helpful for the first time for the VMware home lab setup when you don’t have available resources for running a separate VM as a DNS server or for deploying a DNS server on your physical machine. Of course, it is better to configure a fully-functioning DNS server in the local area network of a production environment for deploying VMware vSphere.
Let’s edit the hosts file on a physical machine. If you use Windows, edit the C:\Windows\System32\drivers\etc\hosts with a text editor executed as Administrator. If VMware Workstation is installed on Linux, edit the /etc/hosts file. The following strings are added in this case on the host machine:
In order to fix the “Supplied System Name is not valid” issue on the VM running vCenter Server Appliance, try to do the following steps.
- Open the blue-gray management interface of the vCenter Server Appliance in VMware Workstation.
- Press CTRL+ALT+F3 to enter console. Log in the console as the root user (use the password you have specified during deploying vCenter from the OVA template).
- Enable shell by entering the command:
shell.set --enabled true
- Enter shell by using the command:
- Open the hosts file:
- Check if the following strings are present in the hosts file of VCSA:
192.168.101.103 vcenter6-7.localdomain vcenter6-7
192.168.101.1 localdns localdns.localdomain
192.168.101.2. localdns2 localdns2.localdomain
If such strings are missing, add them.
- Try to ping the IP address of the virtual DNS server specified in the network configuration of the VM running VCSA.
503 Service Unavailable
This error may occur after rebooting vCenter Server. When you enter the address of your vCenter for accessing VMware vSphere Client in the address bar of your browser (for example, https://192.168.101.103) you should see the following error message:
503 Service Unavailable (Failed to connect to endpoint: [N7Vmacore4Http20NamedPipeServiceSpecE:0x000055ea10bcc9c0] _serverNamespace = / action = Allow _pipeName =/var/run/vmware/vpxd-webserver-pipe)
This error can occur if some vCenter services have not started yet. Check to verify that the appropriate services are running by going to the web page for vCenter appliance management. In this case, the following address should be used:
VMware vCenter Server and VMware vSphere Web client services must be started. Select the needed service that is not running and click Start or Restart. You may need to wait for a few minutes. Also check other services if necessary. When the necessary services are running, try to reconnect to your VMware vSphere Client.
Centralized vSphere management with vCenter
Now you can log in to vCenter with VMware vSphere Client. Enter the IP address of your vCenter Server into an address bar of your web browser. The introduction web page is loaded where you should select one of two options:
- Launch vSphere Client (HTML5)
- Launch vSphere Web Client (FLEX)
Let’s use the HTML5 Client. On the VMware Single Sign-On page enter the user name (email@example.com) and the password you have previously specified.
Create a new datacenter
Once you have logged in VMware vSphere client, you will see nothing in the vCenter inventory. First of all, you should add a new datacenter that is a logical container (directory) where your hosts and clusters are placed. In order to add a new datacenter, click Actions > New Datacenter. Enter the datacenter name, for example Datacenter1 and click OK.
Add your ESXi host to the datacenter. Right-click your datacenter name and click Add Host in the context menu. Your VM running ESXi must be powered on.
The Add Host wizard is opened.
- Name and location. Enter the IP address of the ESXi host you want to add and click Next. In this case the IP address of the added host is 192.168.101.101.
- Connection settings. Select the user name and password you have specified during ESXi installation (the root user is used in this case). Click Next. Click Yes if a certificate security alert is displayed.
- Host summary. Review the summary of the host and click Next.
- Assign the license. In the ESXi home lab explained in this blog post, the evaluation 60-day license is used for all VMware products. Hence, you don’t need to change anything on this screen. Click Next to continue.
- Lockdown Mode. Select the Disabled option to keep the ability to manage the ESXi host without vCenter Server. Click Next.
- VM location. Select the datacenter where your VMs will be stored after creation. As there is only one datacenter at this moment, you should not change anything on this screen. Click Next.
- Ready to complete. Check the configuration summary and click Finish to add the host.
Wait for a few seconds until your ESXi host is connected to vCenter Server. ESXi01 is now added to the vCenter Server inventory. Repeat these steps and add the second ESXi host (ESXi02 in this case) to your vCenter.
Let’s create a new virtual machine on a virtual ESXi host for VMware home lab. This will be a nested VM.
Note: There are three methods of creating a new VM in this case. A new VM can be created with vCenter by using VMware vSphere Client, with VMware Host client (creating a new VM by using standalone ESXi host managing tools) and with VMware Workstation by connecting to vCenter or ESXi host in the interface of VMware Workstation.
Deploying a Nested VM on a Virtual ESXi Host
Insert an ISO installation image of the operating system you want to install on your virtual ESXi host into the virtual CD/DVD drive of the VM running ESXi. In this example Lubuntu 16 32-bit installer can be used because this Ubuntu-based Linux distribution is light-weight; this is important when the hardware resources of your VMware home lab are limited. In order to insert the installation ISO image into a virtual optical drive, select your VM running ESXi (ESXi6-7a in this case), and click VM > Settings in the VMware Workstation interface.
In the Virtual Machine Settings window, select CD/DVD, select the Use ISO image file option, and select the ISO bootable installation image (click Browse to navigate your file system for selecting the ISO file).
When the ISO installation media is inserted into an optical drive of your virtual ESXi host, open VMware vSphere client and select your ESXi host in the vCenter inventory. Right click the ESXi host and in the Actions menu select New Virtual Machine.
A New Virtual Machine Wizard is open.
- Select a creation type. Choose Create a new virtual machine and click Next.
- Select a name and folder. Enter your virtual machine name, for example Lubuntu16, select your datacenter (the Datacenter1 is the only datacenter available at this moment in this example) and click Next.
- Select a compute resource. Select your first ESXi host (ESXi01 that has the IP address 192.168.101.101 is selected in this example). Then click Next.
- Select storage. Select the datastore you have created when configuring the ESXi host. In this case, the datastore40 is selected. Click Next to continue.
- Select compatibility. If you have ESXi hosts of versions older than 6.7 (6.5, 6.0, 5.5 etc.), you should select the compatibility with the oldest version of ESXi that is present in your virtual environment. Let’s select ESXi 6.0 and later compatibility for this example. Click Next.
- Select a guest OS. As Lubuntu 16 32-bit is used as a guest OS for the VM that is deployed, the Guest OS family must be Linux and the Guest OS version must be Ubuntu Linux (32-bit). Click Next.
- Customize hardware. This step includes many settings. Be attentive and edit the settings as following:
- CPU: 1
- Memory: 1 GB
- New Hard Disk: 16 GB, Thin Provision (click your new hard disk to expand the list of settings).
- New CD/DVD Drive: Host Device, Connect at power on.
Click Next to continue.
- Ready to complete. Check the configuration summary and click Finish to start VM creation.
Your VM has now been created. In order to install a guest OS, select the VM and start the VM (Actions > Power > Power On). Click Launch Web Console to see the image displayed by a “virtual monitor” connected to a VM. Install Lubuntu Linux on a VM as usual. After installing Linux, install VMware Tools on your guest OS. Open Terminal and check to verify if your Linux has Internet access with the following commands.
A virtual network adapter that obtained the IP address via DHCP and Internet connection works properly for this nested VM running in the VMware ESXi lab (see the screenshot above). Install VMware Tools from online repositories by using the following command:
apt-get install open-vm-tools
The command must be executed with root privileges. Answer the questions provided by the console wizard of the VMware Tools installer to complete the installation. Sometimes you need to reboot the VM after installing VMware Tools. Refresh the web page of the VMware vSphere client in your browser and you should see the VMware Tools version and running status.
Note: You can connect to a VM not only with Web Console. You can also connect to a VM with VMware Workstation. The advantage to this method is that you can set a higher resolution to be displayed by a VM running on an ESXi host remotely (the maximum resolution displayed in Web Console of VMware vSphere (Web) Client is 1152 X 864. In order to connect to a remote VM running on an ESXi host, you should connect to the ESXi server or vCenter that manages that particular ESXi server by clicking File > Conect to server in the interface of VMware Workstation.
Thus, at this moment, most of the components of VMware home lab are configured:
- Virtual networks
- A guest Linux VM (a nested VM) running on ESXi01.
Now let’s see how to migrate a VM from one ESXi host to another by using vCenter. After that, you can learn how to connect a shared datastore to an ESXi host.
Migrating a VM Between Hosts by Using vCenter Server
Make sure that both VMs running ESXi hosts and a vCenter VM are operational. Open VMware vSphere Client in your web browser for accessing your vCenter Server.
VMware provides the vMotion feature for performing VM migration between hosts and datastores. Storage vMotion is used when VM migrates from one storage to another. vMotion allows you to migrate VMs even if the VMs are running. You can test this great enterprise-level feature in your own ESXi home lab. Try to ping your nested Linux VM during the migration process to check that there is no downtime.
Right-click the VM running on the first ESXi host (ESXi01 – 192.168.101.101) and click Migrate in the Actions menu.
The Migrate Wizard is open.
- Select a migration type. On this step you can select one of the three options:
- Change the compute resource only. Select this option if a VM is located on a shared datastore connected to multiple ESXi hosts.
- Change storage only. Select this option if you want to remove the VM from one directly attached datastore to another. Both directly attached datastores are connected to the same ESXi host in this case.
- Change both compute resource and storage. Select this option if you want to migrate a VM from one host to another. Both hosts may use different datastores in this case.
The third option is suitable in the case reproduced in the current VMware home lab. Both ESXi hosts have their own 40GB datastores. The running VM will be migrated from one host to another (ESXi01 > ESXi02) and from one 40GB datastore to another (datastore40 > datastore40-2).
After selecting the appropriate option, click Next to continue.
- Select a compute resource. This option allows you to define an ESXi host, as well as which CPU and memory resources will be used to run a VM. Select vCenter6-7 > Datacenter01 > 192.168.101.102 (the IP address of ESXi02 that is the second host in this VMware test environment). Click Next to continue.
- Select storage. At this stage, you should select the destination storage for the virtual machine migration.
Select the virtual disk format: The same as the source (Thin provisioning in this case).
Select the datastore (datastore40-2 in this case).
Click Next to continue.
- Select networks. Select destination networks for the virtual machine migration. VM Network is selected for this purpose in the current example. Click Next.
- Select vMotion priority. You can select a high priority (recommended) or a normal priority. Select a high priority and click Next.
- Ready to complete. Check your VM migration parameters and click Finish to start migration.
Wait until the VM migration process is finished. You can open the Recent Tasks bar in the bottom of the VMware vSphere Client web interface to check the task’s progress. After the VM migration task is completed successfully, your VM will begin running on the second ESXi host (see the screenshot below).
You can see a preview of the Lubuntu VM desktop where the console was opened in order to check the network and install VMware Tools before migration. The virtual machine running state is preserved.
Connecting Shared iSCSI Storage to an ESXi Host
Connecting shared iSCSI storage is the final stage of today’s VMware home lab setup. iSCSI protocol provides block-level access to the shared storage by carrying SCSI instructions over TCP/IP network. An ESXi host can access data on the block level similarly as it can access the directly attached storage. iSCSI protocol is widely used due to its affordability (many NAS devices support iSCSI) and ease of setup when compared to Fibre Channel SAN systems. You can attach the iSCSI datastore to an ESXi host when directly attached storage is full or when you need to deploy a cluster.
FreeNAS installed on a VM will be used to create an iSCSI target in this example. The iSCSI target is then connected as shared datastore to the ESXi host. FreeNAS is a free distribution based on the FreeBSD operating system that provides a web interface for creating and managing network shares. Download the ISO installation image from the official site and place it to the D:\VMware home lab\ directory where VMs and installation images are located for more convenience. In this case, the latest stable release of FreeNAS is used (FreeNAS-11.2-U2.iso).
Open VMware Workstation and create a new VM with the following parameters:
- Hard disk 1: 10 GB
- Hard disk 2: 20 GB
- Hard disk 3: 20 GB
- CD/DVD: Using file D:\VMware home lab\FreeNAS-11.2-U2.iso
- Network adapter: Host Only network
- Memory: 8 GB
- CPU: 1 processor
- The VM name: FreeNAS11-2
Power on the VM, boot from the FreeNAS ISO installation image and install FreeNAS on the VM. The installation process is straightforward – answer the questions provided by the installation wizard. Install FreeNAS on the 10GB disk. Remember the root password you specify. When installation is complete, reboot the FreeNAS 11-2 VM and check the network settings. The IP address is obtained via DHCP (192.168.105.134 in this case). Press 1 in the main menu and set a static IP address such as 192.168.105.105. The web server interface link is displayed in the FreeNAS console interface.
Creating an iSCSI Target in FreeNAS
Enter the address of the FreeNAS web interface in your browser. In the current example, http://192.168.105.105 is the necessary address. Select the legacy web interface and enter the root username and the password you have specified during the FreeNAS installation.
- In the web interface of FreeNAS, go to Storage > Volumes > Volume Manager and create a new volume with the parameters:
- Volume name: volume1
- Available disks. Click the + (plus) button to add available two 20-GB disks that you created before during the VM creation.
- Volume layout: Mirror. Your new volume should resemble the software RAID1.
Click the Add Volume button to create a new volume.
- Go to Storage > Volumes > [your_volume_name] > Create zvol and create a new zvol. A zvol is a feature of the Zettabyte File System (ZFS) intended for creating a raw block device over ZFS that allows you to use a zvol as an iSCSI extent.
In this example, the configured parameters of a zvol are:
- zvol name: iSCSI-zvol
- Size for this zvol: 12G (you should not use more than 80% your available space for your zvol). 12G is less than 80% of 20G.
- Sync: Inherit (standard)
- Compression level: Inherit (lz4)
- ZFS deduplication: Inherit (off)
Click the Add zvol button to create a new zvol.
- Go to Services > Control Services and enable the iSCSI service - click the Start now button and tick the “Start on boot” check box.
- Go to Services > iSCSI > Target Global Configuration to see the automatically generated Base name (IQN) and click Save. Now you can add a portal. Go to Services > iSCSI > Portals and click Add Portal.
The following parameters are used for creating a new portal in this example:
- Comment: iSCSI_Portal
- Discovery Auth Method: None
- Discovery Auth Group: None
- IP address: 0.0.0.0 (can be associated from any IP address of any interface)
- Port: 3260 (a default TCP 3260 port is used)
Click the OK button to add the portal.
- Go to Services > iSCSI > Initiators and click Add Initiator. Use the following parameters to enable all initiators from authorized networks to access this iSCSI share:
- Initiators: ALL
- Authorized network: ALL
Click OK to continue.
- In order to create a iSCSI Target that is a combination of configured portals, valid initiators and authentication methods, go to Services > iSCSI > Targets and click Add Target. The following parameters are used in this example of configuring the iSCSI Target for VMware home lab setup:
- Target Name: iscsitarget1
- Target Alias: iscsitarget1
- Portal Group ID: 1 (iSCSI_Portal)
- Initiator Group ID: 1
- Auth Method: None
- Authentication Group number: None
Click OK to create the iSCSI Target.
- Go to Services > iSCSI > Extents and click Add Extent to define resources that must be shared with clients.
The following parameters are used in this case:
- Extent Name: iscsi-extent
- Extent Type: Device
- Device: volume1/iSCSI-zvol (12G)
- Logical Block Size: 512
- Go to Services > iSCSI > Associated Targets and click Add Target/Extent.
The parameters used in the above example are the following:
- Target: iscsitarget1
- LUN ID: 1 (the value must be between 1 and 1023)
- Extent: iscsi-extent
Click the OK button to finalize the creation of your iSCSI Target.
- Your iSCSI target is now ready. Remember the base name of the iSCSI target that is displayed in the Sharing > Block (iSCSI) > Target Global Configuration tab. In this case iqn.2005-10.org.freenas.ctl is the Base Name that would be used in the explained VMware home lab for connecting the iSCSI Target to an ESXi server as a shared datastore.
Adding a new iSCSI datastore to an ESXi host
Open VMware Host client and log in to one of your ESXi hosts running on VMs (for example, ESXi02 – https://192.168.101.102). Enter the IP address of your ESXi host in the address bar of your web browser for doing this. In the Navigator pane, go to Storage, then click the Adapters tab in the main part of the window. You should see the existing storage adapters (disk controllers). First you need to add a software iSCSI adapter.
- Click Software iSCSI in the Adapters tab. In the configure iSCSI window set the following parameters as in the example below:
- iSCSI enabled: Enabled
- Static targets. Target: iqn.2005-10.org.freenas.ctl (the name you memorized after configuring the iSCSI Target in FreeNAS). Address: 192.168.105.105 (the IP address of your FreeNAS machine). Port 3260 (a default TCP port number used for iSCSI connection).
- Dynamic targets. Address 192.168.105.105. Port 3260.
Click Save configuration for creating a new iSCSI adapter.
Note: As you recall, in the section about configuring ESXi hosts (in the beginning of this blog post) the host only network 192.168.105.0/24 was configured for each ESXi especially for connecting to shared storage.
- In the Adapters tab, click Rescan and click Refresh. After that you will see the new iSCSI Software Adapter you have created before.
- Now it’s time to add a shared iSCSI datastore to your ESXi host. Click the Datastores tab and click New datastore (similarly as you have done for adding a local 40GB datastore to your ESXi hosts). The wizard window appears.
1). Select creation type. Click Create a new VMFS datastore and click Next.
2). Select device. Select a device on which to create a new VMFS partition. Enter a name, for example, datastore-iscsi. Select your FreeNAS iSCSI Disk from the list of unclaimed devices. Then click Next.
3). Select partitioning options. Select the Use full disk option and VMFS6 file system. Click Next.
4). Ready to complete. Check the datastore settings and click Finish to create the datastore.
Now the second ESXi host is configured to use a shared iSCSI datastore. This datastore is displayed in the Datastores tab of the Storage section in the interface of VMware Host Client (see the screenshot below). You can use this datastore similarly as you use your directly attached datastore. Make sure that your NAS device on which the iSCSI Target is configured (a VM running FreeNAS in this case) is running before powering on ESXi hosts.
Repeat these steps and add a shared datastore which you created on FreeNAS to your another ESXi host. After that, your vSphere configuration will be almost ready to deploy a cluster.
Other Experiments You Can Conduct in Your VMware Home Lab
At this point you have a fully workable VMware home lab with two ESX hosts (one of which runs a nested Linux VM), vCenter Server and FreeNAS (used as iSCSI target). As for today’s blog post, the VMware lab setup is finished. Not all features and possibilities were explained above. You can perform many more operations that may be used in the production environment, for example:
- Migrate your nested VM (Lubuntu16 in this case) from the directly attached storage to the shared storage (datastore40-2 > datastore-iscsi) with Storage vMotion.
- Deploy the High availability (HA) and Distributed Resource Scheduller (DRS) cluster. The eBook about VMware clustering can help you to do this.
- Install VMware PowerCLI to experience all the advantages of scripting and automation provided by VMware.
- Configure VMware vSAN
- Create VM templates, deploy VMs from templates.
Before deploying VMware vSphere in the production environment, you should pay special attention to your VMs in the framework of data protection. Deploy NAKIVO Backup & Replication on a VM running in your ESXi home lab and test how the product performs backup, replication and recovery of VMware VMs running on your ESXi hosts.
Today’s blog post has covered the full process of VMware home lab setup in detail. The lab can be deployed on a mid-level desktop or even laptop – you can test VMware vSphere for free in your own VMware lab by using 60-day trial versions of VMware software (VMware Workstation, ESXi, vCenter Server Appliance) and free Linux and FreeNAS systems. Deploying and configuring VMware Workstation VMs running ESXi, vCenter, FreeNAS in addition to deploying a nested VM running Lubuntu are also explained in detail. Hopefully, this blog post will help you learn more about the VMware vSphere, one of the best hardware virtualization solutions in the world. Test vSphere in your VMware home lab and join the community of people who are optimizing their IT infrastructure with modern virtualization technologies. Don’t forget to test how your virtual machines can be backed up. NAKIVO Backup & Replication can help you to protect your VMs in the best way possible.