Troubleshot Linux Network Issue in VirtualBox

 Issue:
Virtual Machine's 2nd network adapter in VirtualBox is not active.

Known Information: 
Virtual machine running Rocky Linux 8.5 has 2 virtual network adapters.  

Adapter 1 is running NAT













Adapter 2 is running Host-only Adapter











If interface enp0s8 still not coming up, run the following commands to enable the port
$ sudo ifconfig enp0s8 up
or
$ sudo ip link set enp0s8 up
$ sudo dhclient enp0s8


If interface enp0s8 is not getting DHCP IP after previous step, run the following commands to enableDHCP
$ sudo nano /etc/netplan/00-installer-config.yaml

Add the following entry under ethernets section
# This is the network config written by 'subiquity'
network:
  ethernets:
    enp0s3:
      dhcp4: true
    enp0s8:
      dhcp4: true
      dhcp6: true
  version: 2

Save and exit editor. 
Apply netplan changes by running this command
$ sudo netplan apply

If you are remotely SSH to the server, most likely you will get disconnected.  Remote host might have a new IP address.

Comments