How to Make Virtual Machines Talk to Each Other in VirtualBox

CISO Global
20 Apr 201904:52

Summary

TLDRThis tutorial demonstrates how to enable communication between a Windows 10 and a Kali Linux virtual machine running in VirtualBox. By default, they operate in isolated NAT environments with the same default IP address, preventing mutual connectivity. The solution involves setting up a new NAT network, 'Top Gun Network', with a unique address space to facilitate communication and DHCP assignment. The process includes configuring both VMs to use this new network, resulting in unique IP addresses for each and successful ping tests, ensuring both machines can communicate and access the internet.

Takeaways

  • πŸ’» The script discusses setting up network connectivity between two virtual machines, a Windows 10 and a Kali machine, running in VirtualBox.
  • πŸ”’ By default, both machines are isolated in their own NAT networks and cannot communicate with each other.
  • πŸ“ The script demonstrates how to check the current network configuration by using 'ifconfig' on the Kali machine and 'ipconfig' on the Windows machine.
  • 🌐 The default IP address assigned by VirtualBox for NAT is 10.0.2.15, which is the same for both machines, hence they cannot communicate.
  • πŸ› οΈ The solution is to set up a separate NAT network to enable communication between the two virtual machines.
  • βž• The script guides through adding a new NAT network in VirtualBox Manager under the network settings.
  • πŸ”„ The new network is named 'Top Gun Network' and has a different address space to avoid conflicts with the default NAT.
  • πŸ“ The address space for the new network is changed to 192.168.100.0 with the last 24 bits intended to support DHCP.
  • πŸ”„ The script shows how to change the network settings of both virtual machines to the newly created 'Top Gun Network'.
  • πŸ“ˆ After reconfiguring, both machines should be assigned unique IP addresses in the 192.168.100.x range, allowing them to communicate.
  • πŸ’‘ The script concludes with a demonstration of successful connectivity between the two machines and confirms that they can access the internet.

Q & A

  • What is the default network setting for virtual machines in VirtualBox?

    -The default network setting for virtual machines in VirtualBox is NAT (Network Address Translation), which isolates each VM in its own network environment.

  • Why can't two virtual machines running on the same NAT network communicate with each other?

    -Even though they have the same default address (e.g., 10.0.2.15), they can't communicate with each other because NAT isolates each VM in its own network, preventing direct communication.

  • What is the purpose of setting up a separate NAT network for virtual machines?

    -Setting up a separate NAT network allows the virtual machines to communicate with each other while still maintaining internet connectivity.

  • How can you verify the network settings of a virtual machine in VirtualBox?

    -You can verify the network settings of a virtual machine in VirtualBox by going to the machine's settings under the 'Network' section.

  • What command can you use to check the IP address of a virtual machine running in VirtualBox?

    -You can use the 'ifconfig' command on Linux-based systems (like Kali) or 'ipconfig' on Windows systems to check the IP address of a virtual machine.

  • What is the significance of the 'Top Gun Network' mentioned in the script?

    -The 'Top Gun Network' is a custom NAT network created in the script to allow the virtual machines to communicate with each other. It's a playful name given to the network by the author.

  • How do you create a new NAT network in VirtualBox?

    -To create a new NAT network in VirtualBox, go to 'Tools' > 'Preferences' > 'Network', click on the plus sign to add a new network, and configure the network settings as desired.

  • What is the IP address range used for the 'Top Gun Network' in the script?

    -The IP address range used for the 'Top Gun Network' is 192.168.100.x, with the last 24 bits (.x) being the host address.

  • Why is it important to enable DHCP for the new NAT network?

    -Enabling DHCP for the new NAT network allows the virtual machines to automatically receive IP addresses, ensuring they can communicate with each other and access the internet.

  • How can you confirm that the virtual machines are connected to the new NAT network?

    -You can confirm the virtual machines are connected to the new NAT network by checking their network settings and using the 'ifconfig' or 'ipconfig' command to see if they have been assigned IP addresses within the new network range.

  • What command can you use to test connectivity between the virtual machines?

    -You can use the 'ping' command followed by the IP address of the other virtual machine to test connectivity.

Outlines

00:00

πŸ–₯️ Setting Up Communication Between VMs in VirtualBox

This paragraph explains the default network isolation of virtual machines (VMs) in VirtualBox when using NAT. It details the process of configuring two VMs, a Windows 10 machine and a Kali machine, to communicate with each other by setting up a new NAT network. The default NAT network assigns the same private IP address range to both VMs, preventing communication. The solution involves creating a custom NAT network named 'Top Gun Network' with a unique IP address space to ensure both VMs receive unique DHCP addresses, enabling them to ping each other and maintain internet connectivity.

Mindmap

Keywords

πŸ’‘VirtualBox

VirtualBox is a free and open-source virtualization software that allows users to run multiple operating systems on a single physical computer. In the context of the video, VirtualBox is used to run both a Windows 10 and a Kali Linux machine simultaneously, enabling the user to demonstrate how to set up a network for communication between the two virtual machines.

πŸ’‘NAT (Network Address Translation)

NAT is a method used to remap one IP address space into another by modifying network address information in the IP header of packets while they are in transit across a traffic routing device. In the video, the default NAT configuration in VirtualBox assigns the same private IP address range to both virtual machines, which prevents them from communicating with each other unless a new NAT network is set up.

πŸ’‘IP Address

An IP address is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. In the script, the IP addresses assigned to the Kali and Windows 10 machines are crucial for setting up a new NAT network and ensuring that the machines can communicate with each other and access the internet.

πŸ’‘ifconfig

ifconfig is a command-line utility for displaying and managing network interfaces on Unix and Unix-like operating systems. In the video, the ifconfig command is used to check the IP address assigned to the Kali machine running in VirtualBox, which is necessary for understanding the network configuration.

πŸ’‘IP Address Range

An IP address range refers to a series of IP addresses that are grouped together and often used for specific purposes, such as a local network. The video discusses changing the default IP address range assigned by VirtualBox to a new range (192.168.100.0/24) to facilitate communication between the virtual machines.

πŸ’‘DHCP (Dynamic Host Configuration Protocol)

DHCP is a network management protocol used on IP networks where a server dynamically assigns an IP address and other network configuration parameters to each device on a network, so they can communicate with other IP networks. The video mentions enabling DHCP to automatically assign IP addresses to the virtual machines within the newly created NAT network.

πŸ’‘Network Interface

A network interface is a software or hardware component that allows a computer to connect to and communicate with a network. In the video, the network interface settings of the virtual machines are modified to connect them to the newly created NAT network, enabling communication between the machines.

πŸ’‘Ping

Ping is a network administration software utility used to test the connectivity between computers on a network. In the video, the ping command is used to verify that the Windows and Kali virtual machines can communicate with each other after the new NAT network has been set up.

πŸ’‘Internet Connectivity

Internet connectivity refers to the ability of a device or network to access the internet. The video aims to ensure that both virtual machines can communicate with each other and also maintain access to the internet, which is a key requirement for many network configurations.

πŸ’‘Virtual Machine (VM)

A virtual machine is an emulation of a computer system. Virtual machines are based on computer architectures and provide the functionality of a physical computer. In the video, the term VM is used to refer to the Windows 10 and Kali Linux systems running in VirtualBox, which are the subjects of the network configuration tutorial.

Highlights

Two virtual machines in VirtualBox are not communicating by default without a separate NAT network setup.

VirtualBox assigns a default NAT address to machines, which results in both machines having the same address but being unable to communicate.

To enable communication between the virtual machines, a new NAT network must be configured in VirtualBox.

The default NAT network configuration in VirtualBox is identified as having an address of 10.0.2.15.

A new NAT network named 'Top Gun Network' is created to allow virtual machines to communicate exclusively.

The address space for the new NAT network is changed to 192.168.100.0 to differentiate from the default address.

DHCP support is enabled for the new NAT network to automatically assign IP addresses to virtual machines.

The process of assigning the new NAT network to the virtual machines involves changing the network settings in VirtualBox.

After assigning the new NAT network, the virtual machines should receive unique IP addresses within the specified range.

The Kali virtual machine is reconfigured to use the 'Top Gun Network' for communication.

The Windows 10 virtual machine is also reconfigured to use the 'Top Gun Network' for network communication.

After reconfiguration, the virtual machines are expected to receive IP addresses in the 192.168.100.x range.

Ping tests are performed to verify connectivity between the virtual machines after network reconfiguration.

Both virtual machines are confirmed to have internet connectivity in addition to internal network communication.

The final step includes verifying that the virtual machines can ping each other, indicating successful network configuration.

Transcripts

play00:00

so finally you have a Windows 10 machine

play00:04

running and a Kali machine running both

play00:06

of them in VirtualBox but they're not

play00:08

talking to each other by default if you

play00:11

do not set up a separate nat network

play00:13

they will both be nat 'add but they'll

play00:16

beam added in an isolated environment

play00:20

for instance on the left over here I've

play00:22

got Kali if I do an ifconfig and this is

play00:26

running in VirtualBox I see my

play00:28

addressing kept address for Kali is 10 0

play00:31

to 15 on the right side I have Windows

play00:35

to enterprise if I do a type II config I

play00:38

see my address is 10 0 to 15 so they

play00:42

both have the same address but they

play00:45

can't talk to each other the 10 0 to 15

play00:48

is the default address that VirtualBox

play00:51

assigns to any machine that has setup

play00:54

for NAT so what we need to do if you

play00:57

want these two machines to talk to each

play01:00

other

play01:00

and beam added we have to set up a

play01:03

separate new NAT network and that's what

play01:06

we'll do in this video so let's go to

play01:09

VirtualBox and if we just verify what I

play01:14

was discussing if we look at the Kali

play01:15

machine and look at the settings go to

play01:19

network it's configured for just NAT

play01:22

there's a default to go to Windows 10

play01:26

Enterprise that is configured for NAT

play01:31

which is the default so what we need to

play01:33

do is set up a new network so let's

play01:37

click on Tools click on preferences and

play01:41

this is in VirtualBox manager click on

play01:45

network click on the little plus sign

play01:47

here to add a new network it called it

play01:51

nat network we can click on the gear

play01:53

icon here to change it let's call this

play01:56

our this is the Top Gun Network

play02:03

so only the elite can be part of this

play02:04

network so so we're gonna change this

play02:08

address space I like to change it to

play02:10

something different so it doesn't look

play02:12

the same as the 1002 so let's change

play02:15

this to 1 9 2 1 6 8 . 100 let's say dot

play02:22

0 this last 24 we certainly wanted to

play02:26

support DHCP because we want both of our

play02:29

virtual machines assigned a DHCP address

play02:31

that's pretty much it so click on OK now

play02:34

we have the top gun' network it is 192

play02:38

168 1

play02:40

to the callee and the Windows 10 machine

play02:44

to this new network and they should be

play02:46

automatically assigned an IP address in

play02:48

the 192.168.1 hundred space so I'll

play02:53

start with Kali over here click on Kali

play02:56

I'll go to settings you could also on

play03:00

the machine itself go to machine and

play03:03

settings up here either way works so

play03:05

I'll do it this way through the virtual

play03:08

machine interface go to network we're

play03:11

going to change this right here so right

play03:14

now it says net it was nat we're gonna

play03:16

we're gonna change it to a nat network

play03:18

and then we'll select the one we just

play03:20

created which is top gun' network so the

play03:23

steps are select nat network and it will

play03:26

choose the nap network we saw we created

play03:29

ok so now if I do I have to fig I should

play03:35

get the 192 168 address you may have to

play03:38

do it a couple of times like I did right

play03:39

there so this one is 192 168 dot 100.4

play03:42

on the windows machine will do the same

play03:46

thing machine settings go to network nap

play03:52

network top gun network ok so if I hit

play03:58

the up arrow ipconfig it says

play04:00

disconnected it's reconnecting and we'll

play04:03

go ahead and say yes to that so now I

play04:07

see this is dot 5 over here for Windows

play04:10

on the left side Kali is 4 so

play04:13

technically they should be able to ping

play04:15

each other and talk to each

play04:16

because they have unique IP addresses so

play04:18

for this one and the windows we'll see

play04:21

if we can ping Kali

play04:22

so ping one 92168 dot 104 that's working

play04:28

let's see if we can ping little bug comm

play04:31

as well that's working so we have

play04:35

connectivity between the guest on the

play04:38

same network and we have internet

play04:39

connectivity so that's how to make sure

play04:43

two different machines or as many

play04:45

machines as you have in VirtualBox can

play04:47

talk to each other and at the same time

play04:49

have access to the Internet

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
VirtualBoxNetworkingVMsNATIP ConfigDHCPInternet AccessInter-VM PingTop Gun NetworkTutorial