How can Linux VM inside Windows 7 host keep IP address?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
JamesBond007
Posts: 7
Joined: 26. Dec 2016, 21:02

How can Linux VM inside Windows 7 host keep IP address?

Post by JamesBond007 »

How can my Linux VM guest inside Windows 7 host keep its IP address at least while it is running? Do I have to use static addressing?
I'm running an Oracle Linux virtual machine guest inside a Windows 7 host, using Bridged networking so that other computers on the same (home) subnet can see my Linux machine via its IP address without reference to the host. It works fine EXCEPT: after some timeout (the specific duration of which I haven't been able to determine, but somewhere between 5 and 60 minutes), my Linux machine loses its IP address (which it got from the router at 192.168.0.1) and I have to re-connect the (pseudo-"wired") network.
Trouble is, every time I connect my Linux VM to acquire an IP address, the address number is incremented; it never gets the same address twice. I'm up to 192.168.0.31 now, and counting.
I realize that under DHCP, IP addresses are not permanent or guaranteed, but under normal (physical machines) circumstances, each of my PCs usually gets the same address each time, and certainly doesn't lose any address in mid-session once acquired.
The 'Promiscuous mode' setting doesn't seem to matter; same behavior regardless of this.

How can my Linux VM hang on to its IP address at least while it is running? Do I have to use static addressing?

P.S. My question is very similar to this one: www dot virtualbox dot org / ticket / 10963
But that one was never answered and got closed as 'Obsolete'.
Last edited by JamesBond007 on 26. Dec 2016, 21:35, edited 1 time in total.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: How can Linux VM inside Windows 7 host keep IP address?

Post by Perryg »

Do I have to use static addressing?
Yes.
JamesBond007
Posts: 7
Joined: 26. Dec 2016, 21:02

Re: How can Linux VM inside Windows 7 host keep IP address?

Post by JamesBond007 »

Thanks PerryG. I'll run with that then.
JamesBond007
Posts: 7
Joined: 26. Dec 2016, 21:02

Re: How can Linux VM inside Windows 7 host keep IP address?

Post by JamesBond007 »

Static IP address is working. I set it, worked with it, went away for a couple of hours, came back and found it still working.
Just one glitch: now I can't access the internet from the guest VM with the static IP address. The settings I am using are:
Address: 191.168.0.67
Netmask: 255.255.255.0
Gateway: 192.168.01.
What am I missing?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: How can Linux VM inside Windows 7 host keep IP address?

Post by Perryg »

DNS? Can you ping 8.8.8.8?
JamesBond007
Posts: 7
Joined: 26. Dec 2016, 21:02

Re: How can Linux VM inside Windows 7 host keep IP address?

Post by JamesBond007 »

Thanks PerryG. I can now (ping 8.8.8.8 ). I looked up the DNS settings from the Windows Host, found 209.18.47.62 and 209.18.47.61, entered those into the Linux VM network settings, and now it works (after rebooting the whole Linux VM).
I have never had to enter DNS settings manually before. Is that mandatory when using static IP addresses? Are those specific address above special, universal, particular to my ISP, or what? Is anything else going to come back to bite me?
What is 8.8.8.8?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: How can Linux VM inside Windows 7 host keep IP address?

Post by Perryg »

8.8.8.8 is google DNS. Manual entering a DNS resolver on static is normal, but usually one can simply enter the router IP as it probably does DNS for you. No way for me to tell that since I don't know what you have so you either need to try it or look it up in your router manual. Oh and normally when you setup the guest the first time if you select manual to start with the DNS probably will be picked up. Not so much when you change it after the fact.
Post Reply