1

I have a virtual Ubuntu on real Windows machine, where VirtualBox is a hypervisor.

Virtual machine network is connected to host using Host-only adapter. Thing is - I can't change it for various reasons, but I would like to be able to access virtual Ubuntu from outside.

I was trying to install my own DHCP server and point VirtualBox host-only adapter to that server, but it didn't work.

How can I forward for example port 22 to real world on Windows?

  • simply put. you cannot while using a Host-Only network connection. theres just no getting around it. you can use either Bridged or NAT (then you have to forward ports) but not with host-only. – Frank Thomas Oct 6 '15 at 16:15
1

Host-only means just that... there is no connection to the outside world at all. If you truly cannot switch to another adapter type, there is no way to make this happen short of configuring your Windows box as a router (which seems way out of scope).

The best option (without knowledge of your reasons against changing) is to switch to a bridged adapter, which will allow full access from outside machines.

  • I really can't switch to other adapter type, but I can use linux instead of Windows – John Dow Oct 6 '15 at 16:09
  • Changing the host type doesn't matter. the issue is the HostOnly adapter, and nothing else. – Frank Thomas Oct 6 '15 at 20:02
  • Well, if I can access this IP on host machine, there should be a way to forward it to outside world – John Dow Oct 7 '15 at 9:59
  • You would think that, but you are wrong. from the vbox documentation, HO adapters do not link to the hosts actual network adapter, and instead create a type of loopback adapter: "This can be used to create a network containing the host and a set of virtual machines, without the need for the host's physical network interface. Instead, a virtual network interface (similar to a loopback interface) is created on the host, providing connectivity among virtual machines and the host." from virtualbox.org/manual/ch06.html – Frank Thomas Oct 7 '15 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.