Server does not recognize second VirtualBox Adapter
Solution 1:
have you got the interface configured in /etc/network/interfaces
? if not add the lines
auto eth1
iface eth1 inet dhcp
and restart
Solution 2:
To find your available interfaces use:
ip link
this will show you the interfaces you have, like so:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 08:00:27:1d:bd:93 brd ff:ff:ff:ff:ff:ff
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 08:00:27:c2:c1:92 brd ff:ff:ff:ff:ff:ff
Now add the last interface to the interfaces (in this case enp0s8
)
vi /etc/network/interfaces
Type in [i]
to edit (and move with arrow keys or before [i] hjkl
(left, down, up, right))
auto enp0s8
iface enp0s8 inet dhcp
Save and close with [esc] :wq
Solution 3:
For latest versions (18.04) of the Ubuntu, network settings are stored in
/etc/netplan/50-cloud-init.yaml
.
Get device name with
dmesg | grep enp
(enp could be replaced to your device type).-
Then insert (for device named enp0s8):
enp0s8: addresses: [] dhcp4: true optional: true
Then use
sudo netplan apply
to apply changes.
Solution 4:
Ubuntu Server 20.04 LTS uses Netplan for network configuration by default. The default configuration file in that case is /etc/netplan/00-installer-config.yaml
.
-
Get the device name with
ip link
-
Insert the device in the file
/etc/netplan/00-installer-config.yaml
(for example,enp0s8
):
enp0s8:
addresses: [192.168.2.89/24] # example
gateway4: 192.168.2.1
dhcp4: true
- Run
sudo netplan apply
to apply changes.
Check this link for more information.