Virtualbox: How to configure multiple network adaptors

virtualbox

I have a host machine which is connected to the internet via a usb 3g dongle and is not attached to a network. Basically from the client I want to be able to ssh into the client from the host and I also want the client to have internet access.

When I use a host only adapter the host can ping the client, but the client can't access the internet. When I use NAT I can access the internet but the host can't ping the client. I have also tried setting up two adaptors NAT and host only, but it just seems as if adaptor 1 overrides adaptor 2.

Could suggest a solution?

Regards,

Chris

Best Answer

When you create a host network in VirtualBox it is just like you have a separatly networked machine set up on your local computer. This means it has it's own IP - and you can connect to it, but it also means that it is not able to access the internet unless it has some sort of gateway to it. The NAT mechanism on your host machine automatically translates this traffic.

The gateway in this case would be your host PC. You would need to set up a router to route the traffic from the VM to the internet. In Windows this would be "Internet Connection Sharing" but you did not mention what OS you are using, so it depends on this.