Simple way to connect a windows server 2019 and other VM in VirtualBox
Creating a simple network lab within VirtualBox using Windows Server and Windows 10 can be a great way to learn about networking. This guide is designed to be clear and straightforward, suitable for beginners.
- Download the Windows Server 2019 ISO.
- Download the Windows 10 ISO.
Download and install Oracle VM VirtualBox on your host machine.
Create two new virtual machines (VMs) in VirtualBox and install Windows Server 2019 on the first VM and Windows 10 on the second VM.
- Open VirtualBox, go to
File > Preferences > Network
. - Click on the "NAT Networks" tab and then on the "Add new NAT Network" button.
- Optionally change the name of the NAT Network.
- Take note of the "IPv4 Prefix" under General Options for later use.
-
Start your Windows Server VM and open Server Manager.
-
Click on "Local Server".
-
Click on the "Ethernet" link to open network settings.
-
Right-click your network adapter and choose "Properties".
-
Select "Internet Protocol Version 4 (TCP/IPv4)" and click "Properties".
-
Configure your static IP, subnet mask, default gateway, and DNS.
IP address: 10.0.2.10 Subnet mask: 255.255.255.0 Default gateway: 10.0.2.1 Preferred DNS server: 8.8.8.8
Repeat similar steps on your Windows 10 VM, ensuring the IP address is unique within the network.
-
Use the
ping
command to test connectivity to the default gateway and the internet. -
Test the connectivity between your Windows Server and Windows 10 VMs.
ping 10.0.2.1 ping 8.8.8.8
Allow ICMP (ping requests) through the Windows Server firewall with the following PowerShell command:
```powershell
New-NetFirewallRule -DisplayName "Allow ICMPv4-In" -Protocol ICMPv4 -IcmpType 8 -Enabled True -Action Allow -Profile Any
```
Try accessing the internet from both VMs and sharing files between them to validate your network lab setup.
You've successfully set up a basic network lab with Windows Server and a Windows 10 VM in VirtualBox. You can expand this lab by adding more VMs or exploring other networking features.