Auxiliary Tools :: VirtualBox. Host-only Network

 

With Host-Only networking, VirtualBox doesn’t try to use a physical network adapter on the host. Instead in VirtualBox you can create up to 8 virtual adapters for connections between the host and virtual machines created in VirtualBox. The virtual machines can talk to each other and the host as if they were connected through a physical Ethernet switch.
I used:
VirtualBox 5.1.20 on Windows 10
VMs Fedora 25 (Centos 7)
Creating/Editing a Host-only adapters
(1) File > Preferences > Network > (Tab) Host-only Network

(2) Add adapters (“+” icon)

I need four machines. You can build one or two.

(3) Edit adapters (DHCP Server is disabled. I use static IPs.)


Repeat the above for adapters #3, #4, #5 with IPv4 Address: 192.168.2.1, 192.168.3.1, 192.168.4.1 (and DHCP servers are disabled).

Creating VMs

Create VMs: pc-1, pc-2, pc-3, pc-4
Storage: Fedora-MATE_Compiz-Live-x86_64-25-1.3.iso
Install on HD: user: root; hostname: pc-1, pc-2, pc-3, pc-4

Adapter name: pc-1, … pc-4 with adapters name …#2 to …#5 acordingly:

Static IPv4

(1) Set addresses (System > Preferences > Internet and Network > Network Connection > enp0s8 > Edit):

(2) Repeat the above for: pc-2 / addres: 192.168.2.1; pc-3 / address: 192.168.3.1; pc-4 / address: 192.168.4.1

(3) Test:

ipconfig – Windows:

Port Forwarding and SSH

VirtualBox (Network > Adapter 1 > Advanced > Port Forwarding):

1. pc-1: Name: SSH Protocol: TCP Host Port: 14501 Guest Port: 22
2. pc-2: Name: SSH Protocol: TCP Host Port: 14502 Guest Port: 22
3. pc-3: Name: SSH Protocol: TCP Host Port: 14503 Guest Port: 22
4. pc-4: Name: SSH Protocol: TCP Host Port: 14504 Guest Port: 22

For each PC do:

systemctl enable sshd.service
systemctl start sshd.service

Test (for 14504 (pc-4), repeat for others):

Internet (Windows 10)

Configure static IP on Windows (Repeat for pc-2, pc-3, pc-4. Sorry, I have Windows PL.):

 

Leave a Reply