See guest on virtualbox from host network

I have RHEL 7.1 developer version installed as a guest on virtualbox running on my windows 8.1 laptop.

I have 2 network adapters set-up, the first the normal NAT which allows me to register with red-hat, install java with yum etc.

I also have defined the following network adapter in virtualbox:

bridged adapter
As I understand it, this type of adapter will allow me to view/gain access to the RHEL guest on virtualbox.

I need help to understand what steps must be done to be able to see linux as part of my windows network.

(background - the end point is to access a jboss EAP server running on the linux guest from the jboss developer studio running on my windows laptop)
TerribleTonyHAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
When you set the Virtual Machine Guest Network to

NAT (network address translated), your Virtual Machine will obtain a Private IP Address from an internal Virtualbox DHCP server - 192.168.x.x, and all network traffic will be Network Address translated from Virtual Machine to the Local Area Network your Host is connected to. If your VM sends an outbound packet, its translated and packets will return to your VM.

However, incoming packets will not reach your VM, unless they originated from your VM, so other devices on your Local Area network which is attached to your host, will not communicate with it.

BRIDGED - your network machine virtual network interface, is bridged or connected directly to the host network interface, and will transmit and receive network packets on the host network, just like your Host computer. You will have to ensure, it has an IP Address, either Statically Allocated and in the same network as your host, or local area network, or you must have a DHCP server, or DHCP running on a router, and it must obtain this IP Address, to communicate on the product network.

If you want other devices on your production network to access your Virtual Machine, I would recommend Bridged Mode.
0
TerribleTonyHAuthor Commented:
Yes, that's why I've gone for the bridged mode as per screenshot.

I would like to know how to see the guest from the host.
0
JohnBusiness Consultant (Owner)Commented:
I would like to know how to see the guest from the host.

Can you ping the guest and get a response?  If so, then you can "see" the guest. From there, you may need to set up Samba on the guest to enable file and print sharing.

Let us know if you cannot ping.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

TerribleTonyHAuthor Commented:
To be clear, what should I be pinging?

I did "ip addr show" and I got the following:

ipaddr.png
I had thought that I should be trying to get the ethernet connection, but it came back with nothing.  When I tried the loop address it worked (I don't know if that's right or wrong):

ping.png
I'm not able to connect to start a PuTTY session using either of the ip addresses.
0
JohnBusiness Consultant (Owner)Commented:
In the guest, open a command prompt and type ifconfig and return .  

What IP address do you get?
0
TerribleTonyHAuthor Commented:
Apparently ifconfig has been deprecated in the version of linux that I'm using (rhel 7.1), typing it comes back with:

bash:  ifconfig   : command not found

 I have to use "ip", the output can be seen from the first screenshot in the last post.
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Ping a device on your network, (preferably not the host!).

do you have a router ?

do you have a router which issues DHCP IP Addresses ?

do you have a default gateway to the internet ?

did you configure the VM with the IP Address, 10.0.2.15 ?
0
JohnBusiness Consultant (Owner)Commented:
What we are looking for is the IP address of the Virtual Machine. This does not need you to Ping or do if from another machine.

Is this 10.0.2.15?  I think it is.   So then I have the same question as Andrew - Did you configure the VM Network card?  

Is the HOST network 10.0.2.x?  It should be for bridged networks.
0
TerribleTonyHAuthor Commented:
Hi John,

I'm assuming that 10.0.2.15 is the IP address of the guest linux session.  

I did not configure any VM Network card that I am aware of.  The installation of virtualbox was fairly simplistic, next, next, finish.

In terms of the host network, I've got the following screenshot from running ipconfig on the command line of my laptop (I redacted some of the data):
ipconfig.png
0
rindiCommented:
Why do you need 2 lan adapters in your guest OS? I'd just use only the bridged adapter and remove the Natted NIC. The guest should then an IP from your LAN's normal DHCP server. If you want the IP to always be the same make a reservation for the Virtual NIC's MAC address in your DHCP server.
0
JohnBusiness Consultant (Owner)Commented:
In a Bridged Connection, there is an issue here if HOST is 192.168.1.x and GUEST is 10.0.2.x.  

As Rindi notes, get rid of the superfluous adapter, use ONE adapter in the guest and it (apparently) should be 192.168.1.x
0
TerribleTonyHAuthor Commented:
I guess to remove the NAT adapter, all I'd have to do is uncheck the NAT adapter here in virtualbox for this guest

nat.png
and then re-launch the guest again?  

If that's the case how can I test then this has worked?

TIA
0
JohnBusiness Consultant (Owner)Commented:
How do you test?  

A virtual machine is a machine like any other. Determine the IP address of the machine from inside the machine.

Then attempt to ping from the HOST to the IP you found above.
0
rindiCommented:
Disable the 2nd adapter, and change the first one to bridged, reboot. As you are in the VirtualBox Manager you can directly check all your settings from within the VM like you have done up to now.
0
TerribleTonyHAuthor Commented:
I unchecked the enable network adapter to the NAT nic and re-launched the guest.  Executing "ip addr show" gave me the following:

ipaddr2.png
From there is seems that the ethernet connection has gone and only the loopback is there.  As per the previous screenshot, executing ipconfig from ms-dos brings back the following:

ipconfig2.png
I don't think that this proves that there is any connectivity as I was able to ping this ip address before (see prev. screenshot). From inside the guest, I executed a yum command as root and came back with nothing:

yum.png
Which would seem to suggest that there is no connectivity from the guest to the outside world (would be grateful to be proved wrong though).
0
TerribleTonyHAuthor Commented:
Just to be clear I posted the above before seeing rindi's last post, I'll try what (s)he suggest and report back.
0
JohnBusiness Consultant (Owner)Commented:
Before we worry about connectivity between guest and host, you need to ensure the guest has a valid IP address and has good internet. At this point there does not seem to be. Do this first and then work on host <-> guest connectivity.
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Do you have a DHCP Server on your LAN?

Or how do devices on your LAN get IP Addresses ?
0
TerribleTonyHAuthor Commented:
It did have good internet connectivity using the NAT nic, as I mentioned in the first post, I was able to register the product with red-hat and using yum I installed a java jdk from the CLI.

Changing the 1st adapter to be bridged:

adapt3.png
And then re-launching the guest vm I got the following for IP addresses (essentially the same as before):

ipaddr3.png
This doesn't seem any different to the previous scenario I posted, the only IP address is the loopback.
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Yes, because with NAT, it uses the internal DHCP server to give your VM an IP Address, and then NAT it with Host!

When using BRIDGED it is just like using a standard PC on your LAN?

So how did you Host Machine get an IP Address allocated ?

did you assign one, e.g. fill in the blanks, or does it get an IP Address from a router or DHCP server ?

When I type DHCP, do you know, what I'm referring to, or is this gibberish to you ?
0
TerribleTonyHAuthor Commented:
gibberish
0
JohnBusiness Consultant (Owner)Commented:
You should try to set up your guest Linux machine to use DHCP and it should get the correct IP address
0
TerribleTonyHAuthor Commented:
OK, so how do I do that?
0
JohnBusiness Consultant (Owner)Commented:
Here is a guide for making Linux use DHCP.

https://www.whoi.edu/CIS/networking/configure/dhcp_linux.html
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Okay, we are going to have to revert here to basics.

and let's forget Virtual Machines at present.

Your hosts OS and physical computer the Windows 8.1 Laptop, how does it connect to the internet ?

WiFI, Wireless 3G/4G, via LAN ?

do you just plug it in to your network ?
0
rindiCommented:
In the settings screenshot of your adapter, the "cable connected" option isn't selected. That way the NIC would act just like a normal NIC without the cable attached...
0
TerribleTonyHAuthor Commented:
Andrew,

It connects to the internet across a wifi router.
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Okay, can you type IPCONFIG /ALL at the command prompt of your Windows 8 Laptop

and paste the output here
0
TerribleTonyHAuthor Commented:
C:\Users\Anthony>ipconfig /all

Windows IP Configuration

   Host Name . . . . . . . . . . . . : JJEC-laptop
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No
   DNS Suffix Search List. . . . . . : lan

Ethernet adapter Ethernet:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Realtek PCIe GBE Family Controller
   Physical Address. . . . . . . . . : 60-**-**-**-4C-E8
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

Wireless LAN adapter Local Area Connection* 3:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft Wi-Fi Direct Virtual Adapter
   Physical Address. . . . . . . . . : **-**-**-48-79-E9
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

Wireless LAN adapter WiFi:

   Connection-specific DNS Suffix  . : lan
   Description . . . . . . . . . . . : Intel(R) Dual Band Wireless-AC 7260
   Physical Address. . . . . . . . . : **-**-**-**-79-E8
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   IPv6 Address. . . . . . . . . . . : ****:****:****:****:****:602:5521:6df7(Pr
eferred)
   Temporary IPv6 Address. . . . . . : ****:****:****:****:****:94e1:524a:76f4(P
referred)
   Link-local IPv6 Address . . . . . : ****:****:****:5521:6df7%3(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.1.7(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : 24 May 2015 16:56:32
   Lease Expires . . . . . . . . . . : 26 May 2015 09:34:35
   Default Gateway . . . . . . . . . : 192.168.1.1
   DHCP Server . . . . . . . . . . . : 192.168.1.1
   DHCPv6 IAID . . . . . . . . . . . : 77637837
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1B-EE-3E-66-60-02-92-24-4C-E8

   DNS Servers . . . . . . . . . . . : fe80::1%3
                                       192.168.1.1
                                       192.168.1.1
   NetBIOS over Tcpip. . . . . . . . : Enabled

Ethernet adapter VirtualBox Host-Only Network:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : VirtualBox Host-Only Ethernet Adapter
   Physical Address. . . . . . . . . : 08-00-27-00-B8-59
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : ****::****:****:6ef9:a057%12(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.56.1(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :
   DHCPv6 IAID . . . . . . . . . . . : 201850919
   DHCPv6 Client DUID. . . . . . . . : **-**-**-**-**-**-3E-66-60-02-92-24-4C-E8
  DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                       fec0:0:0:ffff::2%1
                                       fec0:0:0:ffff::3%1
   NetBIOS over Tcpip. . . . . . . . : Enabled

Tunnel adapter isatap.lan:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : lan
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter Teredo Tunneling Pseudo-Interface:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   IPv6 Address. . . . . . . . . . . : ****:****5:****:****:3e4c:a3f1:6f5e(Pref
erred)
   Link-local IPv6 Address . . . . . : fe80::189a:3e4c:a3f1:6f5e%6(Preferred)
   Default Gateway . . . . . . . . . :
   DHCPv6 IAID . . . . . . . . . . . : ****752
   DHCPv6 Client DUID. . . . . . . . : **-**-**-**-**-**-**-**-**-**-02-92-24-4C-E8

   NetBIOS over Tcpip. . . . . . . . : Disabled

Tunnel adapter isatap.{*******-****-****-****-03311466EFDB}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

C:\Users\Anthony>
hastily redacted
0
rindiCommented:
Have you connected the cable of the virtual network adapter like I suggested?
0
TerribleTonyHAuthor Commented:
Yes, I have, there was no difference in terms of the results "ip addr show" gave back.
0
rindiCommented:
What options do you have when you click on the drop-down box of the "Realtek family adapter"?
0
TerribleTonyHAuthor Commented:
adapt4.png
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Select the Intel(R) Dual Band Wireless-AC 7260 NIC

Does your VM get an IP Address ?

okay, so your router.....has a DHCP server configured to issues LAN IP Addresses of...

 192.168.1.7(Preferred)

Your router and DHCP is 192.168.1.1.

So your BRIDGED Network connection in your VM should obtain an IP Address in the range 192.168.1.x.

However, I have seen compatibility issues with WiFi cards, using Virtualbox, if that is the issue here.

for test purposes, you could manually assign an IP Address to your Linux VM or

IP Address 192.168.1.50
Subnet Mask 255.255.255.0
Default Gateway 192.168.1.1
DNS 192.168.1.1

and then in the VM try to ping 192.168.1.1

does it work ?

if not, WiFi Network Card or Driver issue.
0
rindiCommented:
As mentioned above, select the wireless adapter as your PC isn't connected to the router via the wired NIC.
0
TerribleTonyHAuthor Commented:
ok, how do I manually set the IP address to the VM?
0
TerribleTonyHAuthor Commented:
Setting it to the wireless adapter brings back the following:

warning.png
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
if you shutdown/power off the VM.

and then try to change it.

as for setting the IP Address, in the VM, when you configured the OS, did you leave it at DHCP ?

or did you manually assign an IP Address, e.g. where did the 10.x.x.x address come from which has been assigned to the VM, this needs to be changed?
0
TerribleTonyHAuthor Commented:
You can't change the settings on vbox whilst the guest is running.  I wasn't clear, the previous message was when I booted up the guest vm again, it errored out after that so there is nothing running now.

When installing RHEL I left it to the DHCP to assign the ip address.  Which worked ok for NAT.
0
rindiCommented:
In your host OS (Windows 8.1) open the device manager, then uninstall your wireless adapter. After that click on Scan for hardware changes.. Now restart the PC and go to device manager again. Your uninstalled wireless NIC should be marked with a !. Uninstall it again and scan for hardware changes again. Now the adapter should be there again. Now try it in your VM.
0
TerribleTonyHAuthor Commented:
That worked, logged in this time, typed in ip addr show from the linux guest and got the following:
ipaddr4.png
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Nothing needs to be done in the VM, if it's assigned DHCP, it should pick up and IP Address from the router.
0
TerribleTonyHAuthor Commented:
Where can I get this IP address from? executing ip addr show doesn't show it, or does it?
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
It does not show it, so I suspect you are not picking up an IP Address via DHCP.

hence why I suggested, setting it manually above, to check it you have networking ....
0
rindiCommented:
Try ip -4 addr show, or ifconfig. Your output only seems to show the ip ver 6 address, and not for version 4.

Besides that your router, if you logon on to it's configuration website, should also show what IP's it has rented out to which machines. If you need one of those machines to have always the same IP, there should also be an option where you can reserve this IP to the machine's MAC address.
0
TerribleTonyHAuthor Commented:
Thanks for the help, I'm going on holiday today, so I'll be picking this up in a weeks time.
0
TerribleTonyHAuthor Commented:
Hi all,

I'm back from my holiday, well refreshed and looking forward to another session of screenshotting.

To summarise, I'm trying to get a connection to a red hat linux VM I have running on VirtualBox.  The original NAT adapter works fine for connecting to the internet (for registering the dev version of RHEL with red hat for example).  However I want to be able to connect to Red Hat's EAP server which is installed on the linux guest, and for this I need to use a bridged adapter.  I had an issue originally using the bridged adapter on wireless (VERR_INTNET_FLT_IF_NOT_FOUND) which was sorted by disabling and re-installing the wireless adapter.

Then there was some confusion as to whether my wireless router was assigning an IP address to the VM, the original screen-shot suggested no, however it was suggested to use the ip -4 addr show command, and it seems that there is an IP address assigned in the screenshot below:

ipaddr5.png
However I don't know what are the next steps to establish connectivity with anything on the linux guest from my windows host laptop.  Please can you suggest any ideas.
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
okay, so the IP Address is 192.168.1.6

this is assigned from your router, in bridged mode?
0
TerribleTonyHAuthor Commented:
How can I check this? Would this be connecting to the wireless router and checking some config page for IP address assignments?
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
what IP Address does your host get ?

192.168.1.x ?

Also logging into your router Web Configuration would confirm this DHCP lease
0
rindiCommented:
You could install ssh on the Linux guest, and then connect to it from something else using kitty. Or you could install samba on linux and then use it like a windows file-server.
0
TerribleTonyHAuthor Commented:
Running ipconfig on the windows host brings back the ip address of:

192.168.1.7

I logged onto the wifi router and under the LAN devices area of the home network section, the linux guest isn't listed (the laptop, phones, chromecast etc. are).  The only devices listed are all DHCP "addressed" (for lack of the correct term). none are static.
0
rindiCommented:
Static IP's should never get listed there. But you should be able to reserve an IP for your Guest based on it's MAC address. The DHCP server will then always assign it that same IP. But how that is done you'll have to find out by looking at the router's manual, or by looking at the options you have when you logon to it's configuration site.
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Okay, so we have established that the Host and Virtual Machine are on the same network.

Host IP Address - 192.168.1.7

Virtual Machine IP Address - 192.168.1.6

Okay, so what do you want to do now ?

both computer OS should be able to ping each other.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TerribleTonyHAuthor Commented:
Yes, I can ping the VM from ms-dos!

I'm going to look at installing samba and see if I can access the EAP server as a samba share.
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
That is all that is required know, on the VM.
0
TerribleTonyHAuthor Commented:
The original question was too wide ranging.  I've made some progress.  It makes sense to stop here and ask more specific questions.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Virtualization

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.