Score:0

Vagrant VM lost port connection to host machine

bf flag

I'm duplicating my question from superuser, but I want to know why it doesn't work. Let me explain, I have a server on Ubuntu 22 where I have MongoDB running. In this server I created a vagrant vm where Ubuntu run with nginx and a python program. I set the VM like this

Vagrant.configure("2") do |config|

    config.vm.hostname = "nginx"

    config.vm.box = "ubuntu/focal64"

    config.vm.network "public_network", ip:"192.168.1.252",
    bridge: "eno1"
  config.vm.provision "shell",
    run: "always",
    inline: "route add default gw 192.168.1.1"
  config.vm.provision "shell",
    run: "always",
    inline: "ip route del default via 10.0.2.2 || true"


         config.vm.define "nginx-box"

    config.vm.provider "virtualbox" do |vb|
      vb.memory = "1024"
    end

end

When vagrant up everything's work, I can access my database on port 27017 and use it. But after, I will say, 20 min, I got connection refused 111. I try to telnet the port to see if it works, it gave me : Unable to connect to remote host: Connection refused But from my computer per example, I can do it and didn't get refused. Do you have any idea?

I sit in a Tesla and translated this thread with Ai:

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.