I'm trying to access a server that runs on the virtualbox machine. It binds to localhost
and want to passthrough the traffic to its external network interface (which is not the lo). The problem is that the server (thirdparty program) cannot bind to a specified address or interface and cannot bind to a broadcast address, only localhost.
Is it possible to forward traffic from e.g. interface enp0s3 to lo and vice-versa in an easy way? The answers I found on the topic is quite complex for my understanding and they don't work for me (like this https://unix.stackexchange.com/questions/558671/how-to-blindly-forward-all-packets-from-one-interface-to-another), just nothing changes I still can't access the server.
I have set-up networking between VM and host with a Bridged adapter and tcpdump
shows packets my host sends to the VM, so the problem boils down to redirecting traffic from esn0s3 to lo in both directions
Maybe there exists a simplier solution?
I don't want to use docker because it's quite hard to make it work with a bunch of services. Just a simple database initiliazation is a complex stuff while I can easily ssh into the machine and run sql commands i need. It's also easier to run that machine because it's one button in the virtualbox instead of tons of docker images or docker-compose configuration that I don't know how to run
The flow i'm going to utilize this is that:
- I start virtualbox machine
- It starts all needed services for me (including this one I'm trying to set up)
- I have all needed services available on the host with vm's ip address (it's ok that it'll be different each time I run the VM)
- VM is running in background