getting IP via DHCP in VirtualBox

px1

New Member
Credits
0
Hi all,

I am an absolute Linux beginner, and need some assistance.

I have Centos7 core running in VirtualBox, and I want to set it up so that I get an IP address from our DHCP server. I have 2 adapters in my VirtualBox settings, first one is set to NAT, and second one is set to Host-Only.

When I run ip add show command, I see 3 results

1) lo - loopback. What is this?

2) enpos3 - This will be for my NAT, and I see inet 10.0.2.15.24 brd 10.0.0.2.255


3) enp0s8 192.168.56.101/24 brd 192.168.56.255

So I think 2) is my NAT adapter settings, and 3) is my Host-Only settings, the first result is the IP address and 2nd is subnet mask? Is that correct?

I am sure this means I am getting an address from my local machine. How can I get one from the DHCP server instead? Or I am I on the wrong track?

Many thanks everyone
 


Credits
0
Hey px1 and Welcome :)
Weil i think 2 Looks like an Host only Adapter and 3 like the nat ( only because nat Looks at VMware in Range 192.168.x.x)
NAT is the adress translation from an private ip to the ip of the host you run Virtual Box. You Need something like a Host Bridge if you Wang to Optain your own dhcp adress for this vm.

Greetings
Scoobi
 

Jarret B

Active Member
Staff member
Credits
1,989
Under File -> Preferences -> Network you can add a network and set the network IP address you want to connect to and select DHCP enabled. Under the settings for your Virtual Machine change your network adapter from NAT to NAT Network and select your network name you just created.

Hope this helps.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Staff online


Top