N
N
Nikita M.2020-11-22 13:14:37
virtual box
Nikita M., 2020-11-22 13:14:37

How to port forward VirtualBox (Ubuntu 18.04)?

Good afternoon, I'm setting up a web server on an Ubuntu 18.04 guest, using VirtualBox for virtualization. I set everything up (photo), started the server and try to connect from the host (at 127.0.0.1:5550) - the connection is reset (ERR_CONNECTION_RESET). How to fix? 5fba39e378437586242280.png

Resolved: the server was launched in development mode on a local IP. I changed the IP to 0.0.0.0, launched the virtual machine network in the "Network Bridge" mode. I connect, everything works. Thanks to all.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Saiputdin Omarov, 2020-11-22
@generalx

5fba3cdc41ed9280499775.jpeg

R
res2001, 2020-11-22
@res2001

You cannot specify the host address 127.0.0.1 - at this address you can receive and transmit packets only to it (even to a virtual machine, because the virtual machine has its own address 127.0.0.1 ).
As a rule, there is no need for port forwarding, just set the connection type correctly in the network adapter settings and you can access the VM by its IP address.
I usually set the connection type to "Virtual host adapter" if the virtual machine needs access only from the host. In this case, by default, the virtual machine is assigned an address from the network 192.168.56.0/24, while on the host it is 192.168.56.1.
Here, all connection types are popularly painted in pictures, choose which one you need: https://www.nakivo.com/blog/virtualbox-network-set...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question