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.

In VirtualBox on Windows, I have a guest running Ubuntu Server, with the apache2 and openssh-server services running. The configuration file /etc/network/interfaces gives it a static IP of 10.10.10.2/24, and in the properties of the VM, the network adapter is set to host-only. The VirtualBox Host-Only Ethernet Adapter on the host has the IP 10.10.10.1/24. These addresses aren't in the same range as the host (which is DHCP-assigned in the 192.168.1.0/24 range).

From the host, I can browse to 10.10.10.2 and see Apache's "It works" page, and I can SSH to 10.10.10.2 and log into the guest. All good.

The setup I'm aiming for, though, is this same Ubuntu guest running on an Ubuntu Server host (rather than a Windows host). So I have exported the guest as an appliance, and imported it to VirtualBox on Ubuntu. Because VirtualBox Host-Only Ethernet Adapter is Windows-specific, and on Linux the adapter is called vboxnet0, I used vboxmanage modifyvm <foo> hostonlyadapter1 vboxnet0 to update the guest appropriately. The guest boots headless with no errors, but from the host, I cannot wget 10.10.10.2 or ssh 10.10.10.2. Both commands say "no route to host". ping 10.10.10.2 causes From 10.10.10.1 [...] Destination Host Unreachable.

What extra do I need to do on Ubuntu that must be happening automatically on Windows, so that the host can reach the guest via the host-only network?

share|improve this question

2 Answers 2

From the sounds of it it is an issue with the routing inside the VM host. To fix it you will want to check if bridged networking is on, it should be in the options on the virtual machine.

Here is the docs to get you started: http://www.virtualbox.org/manual/ch06.html#network_bridged

share|improve this answer

My guess is that your ubuntu server does not auto-configure vboxnet0 (that is, the fake network card on the host computer) properly. You can verify this using ifconfig - vboxnet0 should be present and list the correct IP configuration.

If vboxnet0 does not exist, you need to create it (see this description for how to do that).

If it does exist, it may need to be configured manually (by editing /etc/interfaces or whatever other method is recommended for ubuntu).

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.