VirtualBox Basics -1 – Local Host Networks

Overview: This page is dedicated for the Virtualbox LOCAL HOST NETWORK.

Most pages and youtubes do a pretty good job showing what you can do in creating the actual virtual box “virtual machine” however I don’t see a deep explanation of the basic networking skills to ensure your virtual machines will talk to each other on your laptop or desktop environment.

Without further ado, here are the prerequisites:
1.) Virtualbox is installed.
2.) Your virtual machine(s) configured.
preferably for beginners, install the latest Ubuntu LTS. But if you have
a Windows virtual machine we can do this exercise.
3.) Virtual box should have admin rights on a Windows HOST environment.

Let’s examine the first area of the Virtualbox’s networking…the LOCAL HOSTED NETWORK. Please see my gif below:

virtualbox local host network.gif

Comments about this GIF:

  • Where we will be focusing on is the Host-only Network section of Virtualbox.
    • Once you have this Virtualbox Ethernet Adapter, you will notice a couple of different changes to mine.
      • The ADAPTER’S PRIVATE address is 169.254.164.60 with a 255.255.0.0
        • The INTERNAL network will be managed by this adapter and will create a local server under the DHCP Server tab.
        • I assigned that address as 169.254.1.1 in the same subnet of 255.255.0.0.
        • I further limited the number of addresses between 169.254.1.200 to 169.254.1.222.
  • For a seasoned networking guy, this is a very large scope for a single local host environment. Personally, I don’t care about the “proper” scope and subnet mask since clearly all this is merely playing in my local host system. I also wanted the reader to know you can make the scope as big as you want provided you understand the following basic rules:
    • Your host addresses should stay in the same subnet of your gateway. It makes no difference to me if you change all these settings to the typical 192.168.x.x network, so long as you designate your DHCP server to be on the same subnet. Since my DHCP server is assigned a 169.254.1.1 and it’s within the scope of addresses possible, the DHCP server will assign an IP address ONLY within the 22 address I set in the scope area. More importantly, when you boot up your Ubuntu, it will send out a broadcast on that network interface and will receive the first IP address available in that range.

 

Where all these interfaces are? Taking the tour…

To locate your Virtualbox Network Interface on Windows search for Network and Sharing Center in Windows 10…

virtualbox ethernet adapter.gif

Sometimes users will not have the ability to use a local host network. If you get an error, check to see if the Virtualbox Ethernet Network adapter is even enabled or installed. The GIF below shows I have multiple private virtual network cards. These bad boys control all the traffic within your local laptop or desktop. Don’t believe me? Run Wireshark on the Wifi adapter or Ethernet port where you get out to the internet…and see if any traffic is crossing over from the local networks onto your outgoing Internet interface. You’ll find the Virtualbox adapter is handling all those packets. There’s even a setting when configuring your virtual machine to allow if the packets are broadcasted inside the local network. We’ll get into that much later.

That covers the adapter that Virtualbox uses…what about where to configure the network interface for the actual virtual machine? Good question.

After you create your virtual machine, you can always go back into the settings and in the network area, specify the local host network you want this adapter to use to connect.

setting the local host network.gif

Comments about this GIF:

  1. I right clicked the virtual machine I had and decided to go to the Network section.
  2. From there, I knew I had a local host network so I ADDED a network card to the existing virtual machine. If you are quick, you will notice I have a NAT interface. That’s a completely different TYPE of interface to go out to the Internet. I just wanted to show you, between the NAT interface and the Local Host Network, you can purposefully direct your virtual machines network requests to a peer on the same local network or with a NAT interface, have it also connect to the internet.

Now that we have taken the tour of Virtualboxs’ Network settings, with the White Hat it’s going to make sense when I instruct you to install a Kali Linux but ONLY ADD A LOCAL HOST NETWORK CARD to prevent unintentionally scanning any other type of card. Keeping your Penetration-type virtual machine contained.

If you have another virtual machine, like my Centos LAMP, you would want to NAT out to the Internet to install and upgrade the virtual machine.

Hope you enjoyed this post and I will be posting more to expand on this site. Thanks for reading!