After restart host, cant connect Internet from virtual machine (DNS Problem)

Discussions related to using VirtualBox on Windows hosts.
ayman
Posts: 12
Joined: 17. Feb 2017, 16:52

Re: After restart host, cant connect Internet from virtual machine (DNS Problem)

Post by ayman »

If you want to connect to the VM and you don't mind changing the IP in PuTTY, that's fine as well. You check the IP in the VM and you use that as the IP in PuTTY.
The IP in the VM never changed, it is still
inet addr:192.168.2.62


I don't mind changing the iP and reconfigure but still does not answer why before when I did ipconfigf /all : find "DNS" in host machine I get
DNS Server 192.168.2.1
and now when I do
while now I get some weird hexidecimal

I will read your post again and try to figure out which IP address to use but ifconfig in clint host (Linux) is giving me same IP address as before
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: After restart host, cant connect Internet from virtual machine (DNS Problem)

Post by socratis »

You do NOT have a DNS problem!!!
Please, STOP mentioning that!!!
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: After restart host, cant connect Internet from virtual machine (DNS Problem)

Post by scottgus1 »

ayman wrote:The IP in the VM never changed, it is still inet addr:192.168.2.62
That is correct. Your guest has a static IP so it will not change. When your guest is not connecting properly you are not connecting to the 192.168.2.### network anymore. You have to change the static IP address of the guest to the network numbers you are getting at the new location where you are attempting to use the guest.

Socratis pointed this out to you before, but you apparently glossed over it. Look at your "ipconfig" from your host OS. The IP address is 192.168.0.11. Your guest IP address is 192.168.2.62. I highlite as Socratis did. See the difference? No match, no connect, no DNS or whatever else you think is the problem. Achieve a match for the first three numbers in the IP address then report if you have further problems.
ayman
Posts: 12
Joined: 17. Feb 2017, 16:52

Re: After restart host, cant connect Internet from virtual machine (DNS Problem)

Post by ayman »

omg, thank you it worked!!!

the PuTTy and the internet <3

You are great Sirs!

for extra measure I also made the dns with a 0 instead of a 2. all working and good.
BillG
Volunteer
Posts: 5105
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: After restart host, cant connect Internet from virtual machine (DNS Problem)

Post by BillG »

The real question for me is why was the OP using a static IP in the first place with bridged networking? If he had left it alone he would not have had a problem when he changed networks.
Bill
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: After restart host, cant connect Internet from virtual machine (DNS Problem)

Post by socratis »

So that he wouldn't change the address in PuTTY?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
ayman
Posts: 12
Joined: 17. Feb 2017, 16:52

Re: After restart host, cant connect Internet from virtual machine (DNS Problem)

Post by ayman »

The real question for me is why was the OP using a static IP in the first place with bridged networking? If he had left it alone he would not have had a problem when he changed networks.
Looking back, I disagree. Whenever I use defaults then change WiFi I believe/think I would get same problem so I would just install everything again

Problem is, I don't know where to start to pickup these network tidbits when I'm working with VMs as I could improve my network knowledge. I'm learning slowly but I would love to come across some nice reference, maybe I should check a Udemy course for virtual box setup in network environment

And i'm using PuTTy
BillG
Volunteer
Posts: 5105
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: After restart host, cant connect Internet from virtual machine (DNS Problem)

Post by BillG »

If you are really interested, the correct way to set up communication between host and guest which will not change when the host changes networks is quite different from your setup. You do not need to use bridged networking at all. socratis has already mentioned this, but here is a detailed description.


You leave the network setting of the guest at the default setting of NAT, so that it shares the host's Internet connection. The guest will have Internet connection whatever network the host uses and you do not need to change anything when you change host networks.

You then enable a second NIC in the vm and set it to host only. This NIC will get its own IP address (probably 192.168.56.1.101). This is the address you use to connect to the guest from the host. The host and guest can communicate on this virtual network whatever physical network the host is connected to (and even if it is not connected to a network at all).

The IP addresses with hexadecimal numbers you are seeing are IPv6 addresses. They are not relevant to this discussion but are well documented if you want to learn about them.
Bill
Post Reply