Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've installed Debian inside Virtualbox on Mac OS 10.5. Everything's working great, yay.

I want to set up networking so I can (a) reach the outside internet from inside Debian (Virtualbox), and (b) reach the virtual Debian from my Mac. (I don't need to be able to reach the virtual Debian from anywhere but the Mac.)

I can't seem to figure it out. If I set the Virtualbox networking to "NAT", I can reach the outside world from Debian, but I can't reach Debian from Mac OS. If I set the Virtualbox to "Host Link Adapter", I can reach Debian from Mac OS, but I can't reach the internet from Debian.

I'm sure I've set up the way I want before, and I don't remember doing anything special for that, so I must be missing something simple today.


share|improve this question
A non-solution: I did try "Bridged networking" (I think it was called -- I'm not running VB in English here), and it kind of works. The guest has its own IP address. The downside is that it needs to be bound at (vm) boot-time to an interface, so if you ever switch between wifi and ethernet, it won't work. – Ken Aug 4 '10 at 14:59
up vote 1 down vote accepted

I ended up using NAT, and VBoxManage --natpf1 to map the 2 ports I need access to. Even simpler than setting up 2 network interfaces.

Thanks for the suggestion, though!

share|improve this answer

For what you want, the easiest thing by far is to set up both a NAT adapter and a host link adapter.

share|improve this answer

I've been able to achieve something similar in the past, that is

(a) to network the host and guest os's


(b) to connect the guest os to the internet

without needing to be connected to a router for (a) to work. Unfortunately my guest os was ubuntu server inside an ubuntu desktop host os so I'm afraid my experience might not be a great help. However for what it's worth I found the following pages helpful:

It might be possible to use a similar set up on mac, I hope! :)

I would also agree with Gilles, two adapters is the way to go.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .