Solved

VirtualBox host-to-guest networking with internet access

Posted on 2011-03-20
22
1,220 Views
Last Modified: 2013-11-15
I am using Oracle VirtualBox and I have installed ubuntu server as a guest VM . I have internet connection(dynamic public ip) to my host ubuntu desktop system. I could access the internet in my guest VM only if I select the network mode as 'NAT' in the VirtualBox network settings  but host-guest is not working. If I select 'Bridged' as network mode in VIrtualBox network settings then the host-guest networing is working but no internet access on the guest VM.

Is there any settings recommendations either on host or guest or on both so that I'll have both host-to-guest networking and internet access.
0
Comment
Question by:Thyagaraj03
  • 10
  • 6
  • 3
  • +3
22 Comments
 
LVL 5

Expert Comment

by:paulqna
ID: 35174830
This guy seems to have got it working.
0
 

Author Comment

by:Thyagaraj03
ID: 35174895
My system are not behind firewall/iptables. Here is my network setting of virtualbox

 vbox-preference1
 vbox-preference2
I'm using dhcp either with nat or bridged in the guest VM network settings. I'm expecting the following things,

1. I should have a static ip address(private ip 192.168.x.x) assigned to both host and guest so that I can easily connect to hot to guest and vice-versa
2. On both host(bydefault can access) and guest I should connect to internet
0
 
LVL 16

Expert Comment

by:gelonida
ID: 35175279
Does your host have multiple network interfaces?

you must bidge the guest network interface with the host network interface, that has internet access
0
 

Author Comment

by:Thyagaraj03
ID: 35175301
Yes, I've two NICs installed on my host computer!.
you must bidge the guest network interface with the host network interface, that has internet access
How do I do this?
0
 
LVL 18

Expert Comment

by:TobiasHolm
ID: 35175856
Hi!

>How do I do this?

Select your virtual machine, go to "Settings" and then "Network". There you can select which NIC you should use. See my pic (it's in Swedish though!).

Regards, Tobias
VB-nic.gif
0
 
LVL 16

Accepted Solution

by:
gelonida earned 125 total points
ID: 35176709
What's good to know is also, that you can change the bridging on the fly, while your guest is runnung.

I have to do this occasionally depending whther my host is connected to the internet via WLAN or ethernet.

After changing the bridfging I just ask my guest to refresh the network sedttings (renegotioate dhcp)
0
 

Author Comment

by:Thyagaraj03
ID: 35177668
Yes, I know this I tried selecting bridged as network mode but I could'nt access the internet in the guest
0
 
LVL 18

Expert Comment

by:TobiasHolm
ID: 35178349
When you used bridged network, did you change the network interface in your virtual machine to your NIC that has internet access?

Regards, Tobias
0
 
LVL 9

Expert Comment

by:crazedsanity
ID: 35180503
Is the host connected via wireless?  That can cause some networking issues that might not be readily apparent, depending upon your setup.
0
 

Author Comment

by:Thyagaraj03
ID: 35185847
@TobiasHolm: Graphically when I look at the 'Wired' connection It's not listing anything like eth0 or eth1. It's empty. Then I edited the /etc/network/interfaces for eth0 to obtain from dhcp on my host. In the VM I selected Bridged--->eth0.


@crazedsanity: No i'ts a wired connection with dhcp enabled
0
 
LVL 18

Expert Comment

by:TobiasHolm
ID: 35190659
ok, strange. I have the option to select which NIC I want to use using the menu "Devices / Network" on a running VM. See pic.

Regards, Tobias
VB-nic.gif
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:Thyagaraj03
ID: 35220216
I have selected eth0 but still I could not connect to the internet with bridged. FYI, I have no router, the ISP cable directly connects to the NIC of host.
0
 
LVL 18

Assisted Solution

by:TobiasHolm
TobiasHolm earned 375 total points
ID: 35221005
Ok. Then your ISP might limit the number of computers that can be connected. Here in Sweden the ISP's usually limits the connection to one MAC address.

Your solution: either connect a NAT capable router to your ISP modem or configure VirtualBox to use NAT.

Regards, Tobias
0
 
LVL 16

Expert Comment

by:gelonida
ID: 35224371
Thyagaraj03 I don't know your ISP.

In some countries (with some ISPs)  you can configure the box of the ISP to act either as a NAT router or to act as direct DHCP server with only one external IP address or to act as ADSL modem

It might be worth checking what options you have. bridged mode makes only sense if you have the right to request multiple IP addresses from the DHCP server

0
 

Author Comment

by:Thyagaraj03
ID: 35224508
@gelonida: Yeah you are right, but I don't have any modem or router from ISP. I have taken this connection newly and It has a box(looks like switch/router) outside the home and everyones ethernet cable(RJ-45) is connected to that box and nobody has modem/router with them at their home. I don't if I could hack that box.
0
 
LVL 10

Expert Comment

by:dfke
ID: 35327963
Your isp does not allow you to have concurrent dhcp leases. Use a router for bridge mode access.
0
 

Author Comment

by:Thyagaraj03
ID: 35367444
yes using router(office) I can but could not without router at home
0
 
LVL 18

Assisted Solution

by:TobiasHolm
TobiasHolm earned 375 total points
ID: 35368096
Solution: buy an external router at home capable of NAT.

Regards, Tobias
0
 

Author Comment

by:Thyagaraj03
ID: 35488550
Actually my friend has this issue and he could not afford to the router
0
 
LVL 18

Assisted Solution

by:TobiasHolm
TobiasHolm earned 375 total points
ID: 35489673
Alt solution: Use an old PC as a NAT router. You must have at least two NIC's in the PC though.

Wiki list of router dists: http://en.wikipedia.org/wiki/List_of_router_or_firewall_distributions

m0n0wall is a small router dist: http://m0n0.ch/wall/screenshots.php

Regards, Tobias
0
 

Author Comment

by:Thyagaraj03
ID: 35785141
Hi,
Not having much time to check
0
 

Author Closing Comment

by:Thyagaraj03
ID: 35785168
It's taking too long giving them a try
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

VM backup deduplication is a method of reducing the amount of storage space needed to save VM backups. In most organizations, VMs contain many duplicate copies of data, such as VMs deployed from the same template, VMs with the same OS, or VMs that h…
Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
In this video tutorial I show you the main steps to install and configure  a VMware ESXi6.0 server. The video has my comments as text on the screen and you can pause anytime when needed. Hope this will be helpful. Verify that your hardware and BIO…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now