Creating a Virtual Environment for the OpenShift Platform Using Oracle VirtualBox

Posted: February 23rd, 2014 | Author: | Filed under: Technology | Tags: , | No Comments »

With the base configurations for the virtual machine complete, start the virtual machine by selecting the machine from the VirtualBox Manager and clicking Start. This will attempt to boot the machine using the operation system media previously specified. A typical installation of the operating system can be completed without any special configurations. Ignore any configurations related to networking components as they will be manually configured after the installation completes. Choose an installation of a basic server when given the option as the OpenShift platform does not require the installation of a graphical user interface and the following instructions assumes a basic server has been installed.

With the installation of the operating system complete, we need to configure the networking components on each machine before additional configurations and the installation of OpenShift can be completed. The following instructions will cover how to configure both the broker and node virtual machines with the proper networking configuration to support the OpenShift environment. They are written for either Red Hat Enterprise Linux 5 or 6 or Fedora less than version 17.

First, let’s configure each of the network adapters. Navigate to /etc/sysconfig/network-scripts directory where we will be able to configure each network adapter. Interface eth0 represents the host-only network adapter and allows our guests to communicate with each other and with the host machine. VirtualBox provides a DHCP server to allocate IP addresses for machines configured host-only networking mode. We will configure each virtual machine with a static IP address that falls outside of the default assignable DHCP range ( to ensure our machines consistently utilize the same network address.

For the purposes of this discussion, eth0 on each virtual machine will be configured with the following IP addresses:

  • Broker:
  • Node:

Make the following modifications on each machine to the file ifcfg-eth0

  • Change ONBOOT to yes to activate the interface at boot
  • Change BOOTPROTO from dhcp to none (Earlier versions required the directive “static”)
  • Change NM_CONTROLLED from yes to no to prevent the NetworkManager from controlling the device
  • Add IPADDR to represent the static IP address for the interface (specify a different address for each machine)
  • Add NETMASK to represent the subnet mask

An example is shown below

IPADDR=< or>

Next, we will configure the second adapter, configured using NAT networking mode, to connect to external resources on the Internet. Typically, adapters using NAT are configured in a network. However, since the machines utilize NAT as their second adapter, it will instead use the network. Within each NAT network, VirtualBox allocates a default set of IP addresses to provide key resources for virtual machines. The following lists these resources:

  • Default guest IP address: 10.0.x.15
  • Default DNS: 10.0.x.3
  • Default Gateway: 10.0.x.2

Each machine configured in a NAT configuration is isolated from other virtual machines which allows for the reuse of the same IP address across multiple virtual machines. Configure the eth1 interface of each machine to utilize the IP address by editing the contents of the ifcfg-eth1 file as follows:


Next, we will configure our virtual machines to connect to the Domain Name System (DNS) by modifying the resolver configuration file located at /etc/resolv.conf. We will utilize the Google Public DNS to support our virtual machines. Configure the resolver file with the following:


Finally, we need to configure the virtual machines to connect to external networks by configuring the default gateway address. As mentioned earlier, the default gateway for the NAT networking mode is located at 10.0.x.2. Add the following line to the network configuration file located at /etc/sysconfig/network


Once these configurations have been applied, restart the virtual machines for the settings to take effect.

With the configurations in place, lets go ahead and validate connectivity. First, ping each guest machine from the host machine by opening up a terminal on the host machine and running the following commands:

# ping
# ping

If the command returns a response and no time outs are indicated, host-only networking has been successfully configured. To validate NAT connectivity, we can first attempt to ping the Google Public DNS server configured earlier, then attempt name resolution against this server. From each guest machine, issue the following command to ping the Google Public DNS server:

# ping

A successful response indicates the default gateway is properly applied. To validate name resolution, attempt to resolve the IP address of using the host command:

# host

A response similar to the following indicates DNS configurations have been applied successfully. has address has address has address has address has address has address has address has address has address has address has address has IPv6 address 2607:f8b0:4009:800::1003 mail is handled by 10 mail is handled by 40 mail is handled by 20 mail is handled by 50 mail is handled by 30

At this point, both virtual machines representing the broker and node instances for an OpenShift environment have been initially configured. To continue the full installation of OpenShift, consult the deployment guide which will describe the steps for installing and configuring OpenShift for your newly created virtual environment.

Leave a Reply