Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Edit-2013-07-08 - I am using Windows 7, and Virtualbox 4.2.16, with a CentOS 6.4 guest using the Host-Only adapter and a NAT'ed connection. First, I was using the NAT'ed connection, but I wanted to be able to use a SSH client that I could copy and paste into. So I set up the Host-Only adapter as a second connection. After using it with no problems, I restarted the guest OS, and then I could not access the internet through the NAT'ed connection. Once I disabled, and "disconnected" the cable from the Host-Only adapter, I was able to access the internet again. Is there a way to set up a guest OS to use the NAT'ed connection for internet access, and the Host-Only adapter to accept SSH connections, instead of trying to send all traffic through the Host-Only adapter?

This is also happening on other Host OS's as well, not just Windows, but OS X, or even Fedora or Ubuntu.

share|improve this question
    
Would it be an option to setup a firewall rule, and have it only accept ssh connections through the host-only adapter, and push everything else out the NAT'ed device? –  Pred Jul 5 '13 at 16:09
1  
I'm confused -- Host-Only networking is intended for traffic between VMs and their host ONLY (hence the name), it's not supposed to go to the Internet or act like it's part of the existing LAN -- so I'm not sure why you expect it to work like that? –  Ƭᴇcʜιᴇ007 Jul 5 '13 at 16:59
    
I have two interfaces. the original NAT'ed eth0. Then I added in the second interface eth1 as the host-only interface. I was able to SSH into the guest OS using the host-only interface, then download packages and do whatever I needed. Now, I cannot use yum to download new packages, or access the web using the FQDN, www.google.com. –  Pred Jul 5 '13 at 17:12

2 Answers 2

I had the same problem. Solved it by manually setting default gateway to eth0. Add this to /etc/sysconfig/network file:

GATEWAYDEV=eth0
GATEWAY=10.0.2.2

and restart network:

sudo service network restart
share|improve this answer
    
I'll definitely give that a shot. –  Pred Feb 3 at 15:38
up vote 0 down vote accepted

What I did to solve this is include two lines to the interface facing the internet. I added DNS1=x.x.x.x and DNS2=y.y.y.y. Restart networking, and this allows the interface I want to connect to the internet connect using an appropriate DNS server. I used the Google DNS servers and it worked. I can now start up all my interfaces at the same time, and not worry about loosing routes. I can still SSH over my VirtualBox Host-Only Adaptor, but only by IP.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.