1

Could DHCP server set up on Custom Nat Network in VirtualBox? I don't want to use VirtualBox default DHCP server. I want to fully control this service.

1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
    – Community Bot
    Commented Aug 28, 2023 at 9:00

2 Answers 2

1

Not possible - paradox of the chicken and the egg.

The host needs to get its IP address when it boots, which is before starting VirtualBox and booting the VM.

Having two DHCP servers on the same local network is not workable.

3
  • Not entirely true. DHCP can be set to static to circumvent the problem. A host and guest can both have a static ip address and then you can use DHCP inside the server no issues. Also, with a dynamic ip, if you have physical access to the server, you can boot the guest fine, get the dhcp server up, and then renew the host's ip address.
    – LPChip
    Commented Aug 28, 2023 at 11:06
  • @LPChip: Using static IP is an easy solution, but defeats the purpose of using DHCP servers.
    – harrymc
    Commented Aug 28, 2023 at 11:35
  • Having static IP addresses but it works, vs it is impossible is another argument.
    – LPChip
    Commented Aug 28, 2023 at 12:28
0

I'll write my answer too even if its more of a workaround, for those that come to this question and find benefit from this.

I run my virtual server inside VirtualBox and use its DHCP server with no issues.

For this to work, I have done the following:

In VirtualBox, the network connection is set to bridge, so that the VM's network is placed outside of VirtualBox, and NAT is no longer necessary. My router now controls NAT.

The server host and server guest themselves have been given a static ip so that they always have an ip address. After installing the DHCP server role on it, it now acts as the DHCP server, and other network devices can get a lease from it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .