configure vm to use already existing dhcp server in my network

Discussions related to using VirtualBox on Linux hosts.
Post Reply
uidzero
Posts: 2
Joined: 13. Mar 2023, 18:10

configure vm to use already existing dhcp server in my network

Post by uidzero »

Hello,

how do I configure a virtualbox VM to use an existing dhcp server (foreman) on my network.

Does this only work via nat or also bridged?

Could only find the option to create a dhcp server in virtualbox.

the reason behind this is, that I want to use pxe boot for installing the vm

The Linux host is an Oracle Server 8.7
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: configure vm to use already existing dhcp server in my network

Post by scottgus1 »

uidzero wrote:use an existing dhcp server (foreman) on my network.
The only Virtualbox built-in method is to use Bridged. Then the VM will be out on the network like your other PCs.

Virtualbox Networks: In Pictures: Bridged Adapter
uidzero wrote:Does this ... work via nat
NAT behaves like a router between the VM and the rest of the network, so probably not in its default settings.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: configure vm to use already existing dhcp server in my network

Post by mpack »

It is meaningless to talk about using the DHCP server from a different network. That is not how they work: step 1: broadcast to find the DHCP server on this network, step 2: ask it for an IP address in the correct range for said network.

Use bridged to make your VM a participant in said network, then let that networks DHCP do what it does with any new device.

VirtualBox NAT is an isolated subnet with its own DHCP and expected address range. Using a "foreign" IP on that subnet would be unfortunate.
Post Reply