[Resolved] No IP Address assigned to second host only adapter

Discussions about using Linux guests in VirtualBox.
Post Reply
paul12345
Posts: 15
Joined: 12. Dec 2017, 11:23

[Resolved] No IP Address assigned to second host only adapter

Post by paul12345 »

* Edit I am not sure what I have done to make this happen but there now is an IP address assigned to the first adapter but still cannot access the vm on the IP address and I still cannot access the internet from the VM.

I already use a centos 6 vm from my windows 10 host and it has a host only adapter and a NAT adapter configured and this works ok, I can connect out from the vm to the internet and I can connect into the vm to run tomcat apps in my local browser and connect via pgadmin and apache dorectory studio etc.

I needed to create a new VM so I created a centos 7 vm and then created a second host only adapter using a different IP address range, and attempted to use this for the new VM in virtual box. In windows the new host only adapter looks fine and there are no issues with assigning the second adapter to the centos 7 vm in virtual box.

However when I start the vm the network adapter doesnt have an IP address, it never gets assigned one via dhcp and when I tried using a static IP in the range the second host only adapter is configured for I can see the adapter has the IP in linux but I still cannot access the internet.

Is anyone able to help me get it working? I can snip screenshots of anything that would be useful, I kind of figured if I used the same adapter set up as my currently working vm then it would just work but it doesnt appear to.
cmd_ip_config.png
cmd_ip_config.png (46.45 KiB) Viewed 33238 times
win10_net_config.png
win10_net_config.png (16.08 KiB) Viewed 33238 times
vbox1.png
vbox1.png (34.25 KiB) Viewed 33238 times
vbox1.png
vbox1.png (34.25 KiB) Viewed 33238 times
Last edited by paul12345 on 12. Dec 2017, 12:38, edited 1 time in total.
paul12345
Posts: 15
Joined: 12. Dec 2017, 11:23

Re: No IP Address assigned to second host only adapter

Post by paul12345 »

vbox3.png
vbox3.png (26.48 KiB) Viewed 33238 times
vbox2.png
vbox2.png (26.63 KiB) Viewed 33238 times
vbox4.png
vbox4.png (29.54 KiB) Viewed 33238 times
paul12345
Posts: 15
Joined: 12. Dec 2017, 11:23

Re: No IP Address assigned to second host only adapter

Post by paul12345 »

ifconfig.png
ifconfig.png (91.87 KiB) Viewed 33238 times
paul12345
Posts: 15
Joined: 12. Dec 2017, 11:23

Re: No IP Address assigned to second host only adapter

Post by paul12345 »

I resolved this issue, it seems that it was the NAt adapter that was causing the issue as the host adapter does get an IP address. For anyone reading this that wants a possible solution all I needed to so was set the following property to enabled:

File:
sudo nano /etc/sysconfig/network-scripts-ifcfg-enp0s8

property:
ONBOOT=yes
r9guy
Posts: 2
Joined: 12. Mar 2012, 20:51

Re: No IP Address assigned to second host only adapter

Post by r9guy »

for those on windows can you say what we need to do
Last edited by socratis on 7. Jan 2019, 21:10, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
tc64
Posts: 1
Joined: 26. Feb 2020, 01:44

Re: [Resolved] No IP Address assigned to second host only adapter

Post by tc64 »

@paul12345
Are you using enterprise edition of virtualbox?
I'm confused because I'm using virtualbox 6.1 and don't see any option to add a Host Only network, only NAT Network.
shesk
Posts: 1
Joined: 26. Feb 2020, 19:41

Re: [Resolved] No IP Address assigned to second host only adapter

Post by shesk »

I am having a similar issue. When I add a second adapter it breaks, causing eth1 to remain unassigned. Some additional details for my scenario that may or may not coincide with OP.

A. 1 Adapter only set to Intel PRO/1000 MT Desktop (NAT) - Internet connection and IP assigned (10.0.2.15/24)
B. 1 Adapter only set to PCnet-PCI II (Host-only Adapter, 'VirtualBox Host-Only Ethernet Adapter') - virtual network created and working, IP assigned (192.168.56.101)
C. 2 Adapters, 1st NAT (settings from A) 2nd Host-only (settings from B) - eth0 gets assigned 192.168.56.101, eth1 unassigned. No internet access

Host: Windows 10
Guest: Kali Linux 2020-01-20

I played around with settings a static IP to eth0 and eth1 but haven't had success there.
If I swap the Adapter Type on both it switched eth0 and eth1, assigning both what looked like appropriate IPs, but no internet access.

Code: Select all

eth0 10.0.2.15/24
eth1 192.168.56.101
But when I ping google or pull up a browser it times out.

I'm still googling around to find an answer, but haven't had any luck yet.
mignarly
Posts: 1
Joined: 29. Oct 2020, 00:22

Re: [Resolved] No IP Address assigned to second host only adapter

Post by mignarly »

I am having exactly the same issue. Were you able to resolve it?
shesk wrote:I am having a similar issue. When I add a second adapter it breaks, causing eth1 to remain unassigned. Some additional details for my scenario that may or may not coincide with OP.

A. 1 Adapter only set to Intel PRO/1000 MT Desktop (NAT) - Internet connection and IP assigned (10.0.2.15/24)
B. 1 Adapter only set to PCnet-PCI II (Host-only Adapter, 'VirtualBox Host-Only Ethernet Adapter') - virtual network created and working, IP assigned (192.168.56.101)
C. 2 Adapters, 1st NAT (settings from A) 2nd Host-only (settings from B) - eth0 gets assigned 192.168.56.101, eth1 unassigned. No internet access

Host: Windows 10
Guest: Kali Linux 2020-01-20

I played around with settings a static IP to eth0 and eth1 but haven't had success there.
If I swap the Adapter Type on both it switched eth0 and eth1, assigning both what looked like appropriate IPs, but no internet access.

Code: Select all

eth0 10.0.2.15/24
eth1 192.168.56.101
But when I ping google or pull up a browser it times out.

I'm still googling around to find an answer, but haven't had any luck yet.
Post Reply