Score:0

How to setup a server on virtualbox machine's localhost to be reachable in the host system?

lb flag
IC_

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:

  1. I start virtualbox machine
  2. It starts all needed services for me (including this one I'm trying to set up)
  3. 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)
  4. VM is running in background
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.