How to run Virtualbox on bridged and host-only networks?

Posted by ril44 on Ask Ubuntu See other posts from Ask Ubuntu or by ril44
Published on 2012-03-16T22:56:36Z Indexed on 2012/03/22 5:38 UTC
Read the original article Hit count: 198

Filed under:

I wish to run VirtualBox with my Ubuntu laptop on the home network (so the desktop PC can access it through the router) and also be able to ssh into the VirtualBox from host on the go (different network or with no internet).

Previously, the only network adapter on the VB instance was a 'bridged connection' adapter. This allowed me to access the internet on the guest VB and for the other computers on the LAN + host to access it. However, whenever I took my laptop off the network, I could no longer access the guest from host.

I read that I needed to enable a host-only adapter to access it off the network and a NAT adapter is used to access the internet from guest.

My question is can I run a host-only adapter + a NAT adapter alongside a bridged network adapter in VirtualBox? I am confused what I would put inside /etc/hosts? Would I put both IP's (host-only and bridged) with the same servername in /etc/hosts?

© Ask Ubuntu or respective owner

Related posts about virtualbox