Give External IP to VB-VM... help?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Hammerfest
Posts: 9
Joined: 10. Apr 2011, 19:35
Primary OS: MS Windows 2008
VBox Version: OSE other
Guest OSses: XP, Vista, 7, Compact

Give External IP to VB-VM... help?

Post by Hammerfest »

I literally spent yesterday and today using Google, and reading over the manual, and reading through the forums on this one... im still coming up at a loss...

I have @ the DC, my core box, Win2k8R2SP1

I installed the latest VB, Installed Win7 on a VM, and am now attempting to assign this VM one of the External(/public) IP Address's I have allocated to me... I removed the allocation from my main adapter and assigned it to the "VirtualBox Host-Only Ethernet Adapter" by going to: File -> Preferences -> Network -> then clocking on the EDIT icon and setting the IP/Subnet to the ones provided to me by the data center.

THEN I proceeded to go into the VM, and change it from NAT, to Host-Only and selected the only adapter (the one I made sure to setup as above), and restart it, then made sure all settings where correct, still nada...

Set to DHCP it wont work (figured this already), set to static to the IP, and it gives me an ip conflict error (which kinda makes sense since I assigned it in the VB preferences area, but I thought it would auto 1=1... so i seem to be missing a major step here...), so I MUST be missing a step or something... 0 sent 0 recieved... "No Internet Access"



So if ANYONE can point me to a manual I haven't already found VIA Google (search terms such as: assign external ip to VirtualBox -- variants: give, set, internal, public, VirtualBox VirtualMachine, VirtualBox Host to Guest, VirtualBox Guest, and quite a few more i really cant remember), or has the answer im looking for to get this gosh darn thing to have the external IP I want to have it have then please let me know.

As a side note, i see that networking issues are VERY common on the web, even here on the forums... I would have thought that this mass stupidity (unsugar coated, myself included in this verbiage) would have prompted a better "video" or "screenshot" manual for the latest MAJOR revision for some of the various major scenarios (mainly NAT, Bridged, and "Host-Only" ) most likely to be used

Side note 2: mainly for game servers, but some for voice and personal web dev stuff, I did try the VRDP, but its SOO god awful slow in the GFX department, I literally wanted to play minecraft again (think each of the blocks in minecraft, well when the screen refresh's when you do something GFX'ie thats what it does to update the screen...

Side Note3: as a user of Virtual PC (since v2005) and the new Windows Virtual PC, I never liked Hyper-V or the other alternatives, so this is my foray outside of my KNOWN zone where it would work perfectly (I am forced away from Windows Virtual PC due to purposeful crippling of its installers for Win2k8 systems...

Thanks for anyone who can assist..
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Give External IP to VB-VM... help?

Post by vbox4me2 »

You need Bridge mode for this to work. No need to restart anything, it'll work strait out of the box.
Hammerfest
Posts: 9
Joined: 10. Apr 2011, 19:35
Primary OS: MS Windows 2008
VBox Version: OSE other
Guest OSses: XP, Vista, 7, Compact

Re: Give External IP to VB-VM... help?

Post by Hammerfest »

Ok, bridge mode...

The next question then is how to i make sure it gets assigned that specific IP... I have 12 of them bound to the NIC...

Switched to bridge mode, doesn't get an ip (expected) and putting the IP info for the IP... still nothing... gives an auto IP and no send/receive
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Give External IP to VB-VM... help?

Post by BillG »

That really does nt have much to do with VirtualBox. Once you set the networking mode to bridged the vm should behave just like an additional machine on your LAN. How does the host get its IP? How would an additional physical server get a specific IP address from your pool?

Why do you have 12 IPs bound to one NIC of the host? How do you expect another machine to use one of them?
Bill
Hammerfest
Posts: 9
Joined: 10. Apr 2011, 19:35
Primary OS: MS Windows 2008
VBox Version: OSE other
Guest OSses: XP, Vista, 7, Compact

Re: Give External IP to VB-VM... help?

Post by Hammerfest »

was my post(s) to wordy?

as I said, its a box in a DC.. DATA CENTER... there is no LAN (per sae), I assign the IP's Statically, and as I said, i expect another "machine" (virtual) to use one of them because I UNASSIGNED it from the main NIC to assign to the host-adapter...

ERGO, I, from what I read I needed to set the "Host-Adapter" state and IP to the IP I desired... but that did not/isnt working...
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Give External IP to VB-VM... help?

Post by BillG »

No, you do not use the host only adapter. You configure the NIC in the vm so that it is bridged to the physical NIC in the host machine (in the settings of the vm which see from the VirtualBox Manager window).
Bridge.PNG
This NIC in the vm is now in the same network as the NIC in the host. If you configure the host manually you should be able to configure the guest in the same way. If you can connect to the host from an external source you should be able to do the same for the guest.
Bill
Hammerfest
Posts: 9
Joined: 10. Apr 2011, 19:35
Primary OS: MS Windows 2008
VBox Version: OSE other
Guest OSses: XP, Vista, 7, Compact

Re: Give External IP to VB-VM... help?

Post by Hammerfest »

Right, set set it to bridged, but I get no connectivity... hence my original existing problem...

I should elaborate, when I have it setup for bridged, put int the IP info, it looks connected, sees that its a network (lets me chose type), but still says "No Internet Access"... I disable it in the Guest, readd it to the Host, works fine (externally accessible), but when I try to add it as the static in the host, I just get that "No Internet Access" message with no actual pointers as to where in the chain the settings are incorrect...
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Give External IP to VB-VM... help?

Post by vbox4me2 »

You do not assign any additional IP's to the Host interface, just one, all other addresses are assigned inside a Guest VM which is using a Bridge connection from the Host. These are fact, no discussion possible here.

If a Guest does not connect you should check the Guest lan driver, the adapter chosen for the Guest within the Guest VM settings and all IP values you assigned to this Guest like mask, gateway, etc... If you have more then 1 Host lan adapter make sure you have chosen the right one to use as Bridge for the Guest.
Hammerfest
Posts: 9
Joined: 10. Apr 2011, 19:35
Primary OS: MS Windows 2008
VBox Version: OSE other
Guest OSses: XP, Vista, 7, Compact

Re: Give External IP to VB-VM... help?

Post by Hammerfest »

vbox4me2 wrote:You do not assign any additional IP's to the Host interface, just one, all other addresses are assigned inside a Guest VM which is using a Bridge connection from the Host. These are fact, no discussion possible here.

If a Guest does not connect you should check the Guest lan driver, the adapter chosen for the Guest within the Guest VM settings and all IP values you assigned to this Guest like mask, gateway, etc... If you have more then 1 Host lan adapter make sure you have chosen the right one to use as Bridge for the Guest.
even you seem to be misreading or misunderstanding what im saying...

for the HOST NIC, I have 12 IP's assigned to it, and use it for various servers on the HOST server ITSELF, for this GUEST OS I REMOVED one IP from the HOST NIC, making now only 11 assigned, in the GUEST I set it to this unassigned ADDRESS, after doing so, it no longer gives me a 169.x address, but uses the static address that I provisioned from the NIC, but still doesnt get internet access... thats what im saying...

I will do some screenshots this weekend of sometime this week if im not too busy and can get to a terminal with remote access...
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Give External IP to VB-VM... help?

Post by BillG »

That is fine, but you would probably be better off posting in a Windows 7 networking forum. It is unlikely that the networking problem has anything to do with VirtualBox.

If you want to post some useful screenshots, post the NIC properties and the IP4 properties from both the server and the Win 7 (as shown here).
NICProperties.PNG
Bill
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Give External IP to VB-VM... help?

Post by vbox4me2 »

Hammerfest wrote:after doing so, it no longer gives me a 169.x address, but uses the static address that I provisioned from the NIC, but still doesnt get internet access... thats what im saying...
I do get you but I don't get exactly what your doing technically, any NIC does not provision IP addresses, you have a block of addresses you can assign but only 1 can be assigned to a NIC at any time unless you have installed tcpip 12 times for this NIC which could explain why a Guest doesn't have internet access, but doubtful as I've never seen the tcp stack installed more then once for a adapter and apart from that there is only the alternate config page so you could have 2 addresses assigned to a nic but only 1 can be active. Or are you using a subnet mask covering the ip block range thinking all within this range are assigned? Or are you bridging the main nic to 11 other virtual nics by using the OS bridge method (which kills Guest Bridge access)?

Think of it like this, you live on mainstreet number 50 but you own numbers 10 to 100, you can only live on 1 address at a time, you can't add the other numbers to number 50 either or the postman will get very confused.
Leak
Posts: 242
Joined: 31. Mar 2009, 13:00
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Debian Testing, Windows XP, Windows Server 2003/2008 R2

Re: Give External IP to VB-VM... help?

Post by Leak »

vbox4me2 wrote:
Hammerfest wrote:after doing so, it no longer gives me a 169.x address, but uses the static address that I provisioned from the NIC, but still doesnt get internet access... thats what im saying...
I do get you but I don't get exactly what your doing technically, any NIC does not provision IP addresses, you have a block of addresses you can assign but only 1 can be assigned to a NIC at any time unless you have installed tcpip 12 times for this NIC[...]
Actually, just about any TCP/IP implementation (be it Windows, Linux or whatever) allows you to assign as many IP addresses to each NIC as you want.

For Windows, look under "Advanced/IP addresses" in the TCP/IPv4 settings, for Linux you just append ":<number>" to the interface's name when setting it up with ifconfig...
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Give External IP to VB-VM... help?

Post by vbox4me2 »

Show me screenshots of a windows lan adapter with multiple tcpip(v4) protocols installed on the same NIC.
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Give External IP to VB-VM... help?

Post by vbox4me2 »

Ah, I stand corrected, http://technet.microsoft.com/en-us/libr ... 57118.aspx
This is called multihoming, learned something new today :lol:

But... this can cause serious problems for a Guest by using VBox Bridge, despite it being a clone of the real NIC it does use the real NIC to some extend, ea. internal filtering and routing to get Guest data to the Guest bridge, though the real NIC can be in a different subnet from the Guest, if there are several subnets on the Host VBox can get confused how to filter/route traffic for the (cloned nic) Guest. A developer can tell us if this is the case if their reading.
CGSmith
Posts: 2
Joined: 16. Aug 2012, 06:33

Re: Give External IP to VB-VM... help?

Post by CGSmith »

I went through a lot of crap to post to this forum. Signing up for Oracle... sigh.

Anyway, Thank the OP. I too was trying to connect a static IP to a virtual box on a dedicated server in a datacenter. My server is actually CentOS 6 running phpVirtualBox and Windows Server 2008 virtualized.

I set to bridged as recommended, entered in my static IP information, then realized I had to set the network interface name to "eth0" which is the bridged connection.

Thanks for the post and help!
Post Reply