Confused about NICs - Need to use LAN DHCP server

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
ImaginaryTango
Posts: 5
Joined: 25. Apr 2022, 06:53

Confused about NICs - Need to use LAN DHCP server

Post by ImaginaryTango »

I'm using a Debian guest and I'm confused about the different types of network interfaces available to my guest on VirtualBox. I've read a few articles on this and I think I'm missing something. I'm doing some experimentation on my LAN and working with a wifi bridge. I want to use a VM to test this rather than changing networking configuration on any system I need or changing the gateway/DHCP server on my LAN.

My LAN uses 172.16.7.xxx for address space. I'm going to be changing the default routing on my Linux guest so I can experiment and work out what I want to do long term on my LAN. To do this, I want my Linux guest to get the address for its NIC from my LAN DHCP server and to be in the same address space as the rest of the LAN. When I check my default gateway on my guest, it gives the IP address of the virtual NIC, in the range 10.xxx.xxx.xxx. I need it to be in the normal range of my LAN and to have the default route set specifically to go through my LAN gateway (which is also the same address of my DHCP server).

When I went through the different types of network interfacing I can use on VirtualBox, it looks it's not possible for the guest's NIC to behave as if it's actually on my LAN. Is that right? If it isn't, how can I get my guest to look like it's directly on my LAN?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Confused about NICs - Need to use LAN DHCP server

Post by mpack »

Bridged mode connects the virtual PC to your LAN, more or less directly. It will be served IP addresses by whatever DHCP server exists on your LAN. It can participate on the LAN like any other PC on the LAN.
ImaginaryTango
Posts: 5
Joined: 25. Apr 2022, 06:53

Re: Confused about NICs - Need to use LAN DHCP server

Post by ImaginaryTango »

Thank you! I tried that - then I remembered having tried that earlier and forgetting to mention this. (That's what happens when one posts rather late at night!)

When I do that, the guest won't boot. I get this message:
Screen Shot 2022-04-25 at 9.33.36 AM.png
Screen Shot 2022-04-25 at 9.33.36 AM.png (50.38 KiB) Viewed 3037 times
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Confused about NICs - Need to use LAN DHCP server

Post by mpack »

That looks like a host error, specifically: not installing or allowing the VirtualBox bridging driver. Unfortunately you (a) posted in "Linux Guests", (b) gave no clue as to the host (you even trimmed the caption bar off the error dialog, just in case the host OS could be inferred that way).
ImaginaryTango
Posts: 5
Joined: 25. Apr 2022, 06:53

Re: Confused about NICs - Need to use LAN DHCP server

Post by ImaginaryTango »

Thanks!

I'm on an iMac host. Should I go on and post in another topic for Mac hosts?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Confused about NICs - Need to use LAN DHCP server

Post by mpack »

No need - I've moved the topic now that I know where to move it.

Unfortunately, you'll need to wait for a Mac user to comment on MacOS permissions issues.
ImaginaryTango
Posts: 5
Joined: 25. Apr 2022, 06:53

Re: Confused about NICs - Need to use LAN DHCP server

Post by ImaginaryTango »

Thanks. I've been searching but haven't found anything that I understand or that helps!
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Confused about NICs - Need to use LAN DHCP server

Post by mpack »

Well, I would certainly start by reinstalling VirtualBox, and make sure that you do not untick any of the driver options: USB and networking.

Note: if all you have on the host is WiFi then I vaguely recall that MacOS has made bridging to this trickier of late.
ImaginaryTango
Posts: 5
Joined: 25. Apr 2022, 06:53

Re: Confused about NICs - Need to use LAN DHCP server

Post by ImaginaryTango »

mpack wrote:Well, I would certainly start by reinstalling VirtualBox, and make sure that you do not untick any of the driver options: USB and networking.

Note: if all you have on the host is WiFi then I vaguely recall that MacOS has made bridging to this trickier of late.
Interesting. When I installed it yesterday, I just used a stock install, no changes at all. Then I created the VMs from my VMWare Fusion files. (Worked for the Linux systems, not so well for the legacy XP system - but that's another issue.) That was it. I didn't mess with settings at all.

I took your suggestion and thought, "Maybe there are settings I didn't notice..." so I deleted VirtualBox and re-installed. This time I clicked the button for options, didn't see any networking or driver options, so I didn't change anything and just went on with the reinstall.

It's working fine now. I'm wondering if there was an option I should have used when I imported the virtual disk from my VMWare VM. I guess that doesn't matter. In the future, if I do something like that, I'll look for options like that. I'm not clear just what the reinstall would have done, but it's working and my Linux guest has an IP address within my LAN address space. I checked with traceroute and the connection is going through the network gateway, so it's all behaving.

Thank you!
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Confused about NICs - Need to use LAN DHCP server

Post by mpack »

Thanks for reporting back, I'm glad it's working for you now. You didn't say if the stuff regarding MacOS issues around bridging to WiFi applies to you, but if so I think you should read up on it (search this forum). Otherwise I fear that issues that disappear for reasons not fully understood can reappear just as easily.
Post Reply