mAI
mAI

Reputation: 121

Can't access my flask app running on my virtual machine

I'm running a Ubuntu 18.10 LTS virtual box on my Windows 10 system. In the network configuration I set the network to bridge. After that my virtual machine appears in my local network with the ip 192.168.0.231. A ping from my hosting system to the VM works fine.

I'm then starting a flask app with DEBUG=TRUE, TEST=TRUE, SERVER_NAME=127.0.0.1:5001. On the VM the server starts and is available under localhost:5001.

But from my hosting service I get Could not get any response, when I try to access 192.168.0.231:5001.

Do I have to open some ports on the VM?

Thanks!

Upvotes: 0

Views: 2188

Answers (1)

David Bensoussan
David Bensoussan

Reputation: 3205

You need to:

  • Start the VM with the port forwarded and be sure it is not used on your Host OS
  • use when starting the app --host=0.0.0.0 if you start it with flask run

Upvotes: 0

Related Questions