You are on page 1of 3

Creating a Network of Devices using Virtual Machines in VirtualBox

Objectives:
Part 1: Launch Oracle VM VirtualBox

Part 2: Configure the base virtual machine, DEVASC-LABVM

Part 3: Clone the DEVASC-LABVM

Part 4: Check the Internet Access

Part 5: Configuring the hostname

Part 6: Get the Network Interfaces/Adapter

Part 7: Configure the Network Interfaces on each clone

Part 8: Reboot the machine

Part 9: Check and Ping the IP Adresses

Required Resources:
 1 PC with operating system of your choice
 Virtual Box or VMWare
 DEVASC Virtual Machine
 Internet Connection

Instructions

Part 1: Launch Oracle VM VirtualBox

Part 2: Configure the base virtual machine, DEVASC-LABVM


Step 1: Check the Host-Only Adapter

a. In the upper-left corner of the VirtualBox, click File.


b. Go to Host Network Manager. Check if there is a VirtualBox Host-Only Ethernet Adapter. If it is missing
you can create one, by clicking the Create icon.
c. In the Adapter tab, check the Configure Adapter Manually. Take note of your IPv4 address and Ipv4
Network Mask.
d. Click on the DHCP Server tab and uncheck the Enable Server.
e. Click OK.

Step 2: Configure the DEVASC-LABVM Adapter

a. Right-click on DEVASC-LABVM and select Settings.


b. Go to Network and click Adapter 2 tab, check the Enable Network Adapter. Then click on Attached To
and select Host-Only Adapter. The Name should be similar to VirtualBox Host-Only Ethernet Adapter.
c. Click OK.

Part 3: Clone the DEVASC-LABVM


Step 1: Create the first machine clone

a. Right-click on DEVASC-LABVM and select Clone from the menu.


b. In the dialogue box, rename the VM to DEVASC-LABVM PC-1.
c. Click on the MAC Address Policy and select Generate new MAC Addresses for all network adapters.
d. Click Next.
e. In the next dialogue box, choose Full clone and click Clone.

Step 2: Create the second machine clone

a. Right-click on DEVASC-LABVM again and select Clone from the menu.


b. In the dialogue box, rename the VM to DEVASC-LABVM PC-2.
c. Click on the MAC Address Policy and select Generate new MAC Addresses for all network adapters.
d. Click Next.
e. In the next dialogue box, choose Full clone and click Clone.

Part 4: Check the Internet Access


Step 1: Start the Virtual Machine clones

Hold down the Shift key and select each VM clones and click the Start icon.

Step 2: Ping to check internet

Open Terminal of each VM and ping google.com, Ctrl+C to stop pinging.

Part 5: Configuring the hostname


Step 1: Change the hostname

a. Open and edit the necessary file on each terminal with the command:
sudo nano /etc/hostname
b. In the nano editor, type PC-1 to change the hostname of the first clone and type PC-2 on the second one.
c. To save the changes use Ctrl+X and enter Y.

Step 2: Open host file

a. To open the host file use the command on each terminal:


sudo nano /etc/hosts
b. Change the old hostname to PC-1 and PC-2, respectively on each clone.
c. Save and close the file using Ctrl+X and enter Y.

Part 6: Get the Network Interfaces/Adapter


Step 1: Use the ifconfig command
a. To get the network interfaces, use the command:
ifconfig -a
b. Take note of your second adapter name which is enp0s8.

Part 7: Configure the Network Interfaces on each machine


Step 1: Change the network interfaces of each clone

a. Open the file of each terminal using the command:


sudo nano/etc/network/interfaces
b. In the editor, type the following:
#DEVASC-LABVM M1
auto enp0s8
iface enp0s8 inet static
address 192.168.56.100
netmask 255.255.255.0
#DEVASC-LABVM M2
auto enp0s8
iface enp0s8 inet static
address 192.168.56.101
netmask 255.255.255.0
Note: The address depends on your IPv4 address that you get earlier in this activity.
c. Save and close the file using Ctrl+X and enter Y.

Part 8: Reboot the machine


To reboot, on each terminal use the command:
sudo reboot

Part 9: Check and Ping the IP Adresses


Step 1: Open Terminal

After rebooting, open the Terminal on each machine clone. Notice that their hostname has been
changed.

Step 2: Ping the IP addresses

If everything is working correctly, the clones should be able to communicate with each other. For the first PC
use ping 192.168.56.101 which is the second PC’s IP address, and use ping 192.168.56.100 on the
second PC. You should be getting ping responses.

You might also like