0

I am very new to Virtual Box and try to emulate cobber PXE boot network installation in virtual box

Trying to configure VM1 as PXE/DHCP server and make VM2 as client to get the IP from VM1 DHCP server on network boot for network installation.

But keep on getting IP from host machine where virtual box installed. because of that VM2 could not find the pxeboot files that is present in the VM1.

VM1 dhcp status snippet:

Listening on LPF/enp0s3/08:00:27:86:b1:c6/192.168.43.0/24
Aug 09 19:03:23 localhost.localdomain dhcpd[3305]: Sending on   LPF/enp0s3/08:00:27:86:b1:c6/192.168.43.0/24
Aug 09 19:03:23 localhost.localdomain dhcpd[3305]: Sending on   Socket/fallback/fallback-net
Aug 09 19:03:23 localhost.localdomain systemd[1]: Started DHCPv4 Server Daemon.

VM1 dhcp conf file

ddns-update-style interim;

allow booting;
allow bootp;

ignore client-updates;
set vendorclass = option vendor-class-identifier;

option pxe-system-type code 93 = unsigned integer 16;

subnet 192.168.43.0 netmask 255.255.255.0 {
     option routers             192.168.43.1;
     option domain-name-servers 192.168.43.1;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.43.100 192.168.43.254;
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                192.168.43.146;
     class "pxeclients" {
          match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
          if option pxe-system-type = 00:02 {
                  filename "ia64/elilo.efi";
          } else if option pxe-system-type = 00:06 {
                  filename "grub/grub-x86.efi";
          } else if option pxe-system-type = 00:07 {
                  filename "grub/grub-x86_64.efi";
          } else if option pxe-system-type = 00:09 {
                  filename "grub/grub-x86_64.efi";
          } else {
                  filename "pxelinux.0";
          }
     }

}

# group for Cobbler DHCP tag: default

group {
    host centostest.mydomain.com-net0 {
        hardware ethernet 08:00:27:7f:aa:f1;
        fixed-address 192.168.43.120;
        option host-name "centostest.mydomain.com";
        option subnet-mask 255.255.255.0;
        option routers 192.168.43.1;
        filename "/pxelinux.0";
        next-server 192.168.43.146;
    }
}

VM1 adapter setting - server

enter image description here

VM2 Adapter setting - client enter image description here

Upon network boot of VM2, it gets IP 192.168.43.17 instead of 192.168.43.120 as provided in the vm1 dhcp conf file

enter image description here

How to fix this issue?

0

I would recommend setting up a network other than "bridged". DHCP works via broadcast, so any DHCP server on the subnet can respond. To prevent that, you seen your own subnet.

In File > Host Network Manager, you will see the default 'VirtualBox Host-Only Ethernet Adapter'. You can uncheck the "DHCP Server" box to turn of the built in DHCP server. Then, attach your DHCP server VM and your machine you are PXE booting to the Host-Only adapter instead of the bridged one.

  • It worked, thanks – Mohan Aug 10 at 0:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.