0

I've tried countless settings, read Virtualbox forums and googled for more hours than I'd like to admit.

What I want to accomplish is simply to be able to ssh into the guest and be able to view websites hosted on the guest. I do not care how I access the guest, whether its a bridged connection, host-only, NAT with port forwarding or anything else.

So what I need to know

Within Virtulabox manager > Preferences > Network > vboxnet0

--What should my 'Adapter' and, if needed, 'DHCP Server' settings be? An example of this would be great.

Within Virtualbox machine > Settings > Network

--What should I have for Settings? Specifically 'Attached to' 'Name' 'Adapter type' 'Promiscuous mode' 'Port Forwarding'

Or if you can link me to a solution that I may not have seen/tried already it would be greatly appreciated.

1 Answer 1

1

You probably have the VMs set up with NAT adapters to give them access to your host's network connection. You can't communicate between the host and the guest using the NAT adapter. You have to set up a host-only network and add a a host-only network adapter to the VM. The host and guest can communicate through this network, and two VMs can also communicate with each other.

  1. As you said, go to Virtualbox manager > File > Preferences > Network and set up a host-only network. Enable the DHCP server. In my case, the host adapter address is 192.168.56.1, the DHCP server address is 192.168.56.100, both masks are 255.255.255.0, and the server address range is 192.168.56.101-192.168.56.254, but I believe these were all filled in by Virtualbox as defaults.
  2. After setting up this network, you should see a virtual interface on your host system with the correct IP address (the one assigned to the adapter).
  3. Now, go to network settings for the VM. Add a new network adapter. Set "attached to" to the "host-only adapter", and the name to the host-only network that you set up earlier.
  4. Start the VM. It should see the host-only adapter in addition to whatever adapters it was using before. If it's a modern operating system, it'll probably query the DHCP server and set up the interface on its own.

You can assign a host-only adapter to the VM in addition to a NAT adapter. I have a windows VM and an Ubuntu Linux VM set up this way. Both VMs have no trouble communicating with each other as well as the Internet.

1
  • These are great instructions @Kenster. While strictly following this I found my real problem. When creating a host-only adapter I had to delete the default 'IPv6 Network Mask Length.' I created a second host-only adapter without deleting the 'IPv6 Network Mask Length.' Here is the screenshot of both of those imgur.com/Cxxkmpe Also the DHCP Server info was not filled in by default. Apr 26, 2013 at 18:47

You must log in to answer this question.

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