[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1263
  • Last Modified:

VirtualBox host-to-guest networking with internet access

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
Thyagaraj03
Asked:
Thyagaraj03
  • 10
  • 6
  • 3
  • +3
4 Solutions
 
paulqnaCommented:
This guy seems to have got it working.
0
 
Thyagaraj03Author Commented:
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
 
gelonidaCommented:
Does your host have multiple network interfaces?

you must bidge the guest network interface with the host network interface, that has internet access
0
Put Machine Learning to Work--Protect Your Clients

Machine learning means Smarter Cybersecurity™ Solutions.
As technology continues to advance, managing and analyzing massive data sets just can’t be accomplished by humans alone. It requires huge amounts of memory and storage, as well as high-speed processing of the cloud.

 
Thyagaraj03Author Commented:
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
 
TobiasHolmCommented:
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
 
gelonidaCommented:
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
 
Thyagaraj03Author Commented:
Yes, I know this I tried selecting bridged as network mode but I could'nt access the internet in the guest
0
 
TobiasHolmCommented:
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
 
crazedsanityCommented:
Is the host connected via wireless?  That can cause some networking issues that might not be readily apparent, depending upon your setup.
0
 
Thyagaraj03Author Commented:
@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
 
TobiasHolmCommented:
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
 
Thyagaraj03Author Commented:
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
 
TobiasHolmCommented:
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
 
gelonidaCommented:
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
 
Thyagaraj03Author Commented:
@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
 
dfkeCommented:
Your isp does not allow you to have concurrent dhcp leases. Use a router for bridge mode access.
0
 
Thyagaraj03Author Commented:
yes using router(office) I can but could not without router at home
0
 
TobiasHolmCommented:
Solution: buy an external router at home capable of NAT.

Regards, Tobias
0
 
Thyagaraj03Author Commented:
Actually my friend has this issue and he could not afford to the router
0
 
TobiasHolmCommented:
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
 
Thyagaraj03Author Commented:
Hi,
Not having much time to check
0
 
Thyagaraj03Author Commented:
It's taking too long giving them a try
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

  • 10
  • 6
  • 3
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now