3
2
I have a copy of a debian virtual machine that i got from my friend. He said that all the package that required for a networking are all in there, in that virtual machine which he gave (i.e SSH package, Web server, SQL server, Mail server etc ). I tried that on my own virtual box. It's run like normal, but the problem is i alwasy got the ip of my friend dhcp ip for my virtual machine.
I got this ip for my vm.
address 10.0.2.15
netmask 255.255.255.0
gateway 10.0.2.255
i set my connection virtual machine to NAT, but it didnt change anything, but i cant connect to the internet, but the ip that i get is still the same. While computer ip for my network is (i am using wifi for this case)
address 192.168.8.100
netmask 255.255.255.0
gateway 192.168.8.1
why my virtual machine always got the last ip of my friend ip ? what could go wrong with my configuration ? I have tried to restart the network but it seems it didnt change anything like
Service networking restart/reload
or
/etc/init.d/networking restart/reload
What i expect is my vm got the ip from my network ip for example like this
address 192.168.8.101/105
netmask 255.255.255.0
gateway 192.168.8.1
Note: i can ping 8.8.8.8 through that network (address 10.0.2.15
) from my vm, but i cant ping my vm through my own pc ( from the same network, i tried to ping 10.0.2.15
) but nothing happen
1The difference is that a Bridge connection makes the VM connect to your actual (real) network. The primary router, or primary DHCP server, see's the VM as a real end device and gives the VM networking information just like it would any other device connecting to it. The NAT mode is where VirtualBox creates a virtual network and the VM pulls DHCP information from the virtual network. No other devices can ping a NAT'd VM, but they can a bridged connection. – tfrue – 2017-12-12T02:43:17.883
There are nat and nat networkinf , do these connection same ? – gagantous – 2017-12-12T04:45:01.630
No, they're not the same. – tfrue – 2017-12-12T05:42:54.403
@ChristopherJohnson So whats the difference between these type of connection? – gagantous – 2017-12-12T06:56:49.700
Read through VirtualBox documentation starting with 6.2 and it explains everything you're asking.https://www.virtualbox.org/manual/ch06.html
– tfrue – 2017-12-13T01:16:06.740However, the difference is that with nat network, you setup a "virtual router" that hands out DHCP addresses so virtual machines on the same host can communicate with each other. – tfrue – 2017-12-13T01:17:12.400