Accessing ubuntu virtual machine host from windows browser

nadermx

I have a virtualbox ubuntu machine running a hellow world flask app.

I tried having the app display on 127.0.0.1:5000 and 0.0.0.0:5000

But both when I try to load up on my windows browser don't resolve.

When I run ifconfig in ubuntu virtual machine I get this:

ifconfig -a
eth0      Link encap:Ethernet  HWaddr 08:00:27:6f:2c:93  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe6f:2c93/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:657 errors:0 dropped:0 overruns:0 frame:0
          TX packets:559 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:61322 (61.3 KB)  TX bytes:73104 (73.1 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

And when on my windows machine I run ip config I get this:

ipconfig

Windows IP Configuration


Ethernet adapter Local Area Connection:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Local Area Connection* 4:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Bluetooth Network Connection:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Local Area Connection* 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::2140:c809:4677:98bc%3
   IPv4 Address. . . . . . . . . . . : 10.32.16.32
   Subnet Mask . . . . . . . . . . . : 255.0.0.0
   Default Gateway . . . . . . . . . : 10.128.128.128

Ethernet adapter VirtualBox Host-Only Network:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::3568:3fc7:1697:a475%10
   IPv4 Address. . . . . . . . . . . : 192.168.56.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Tunnel adapter isatap.{2543650F-5CEA-40B8-B085-A54A628D3DCE}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter isatap.{8A555006-09A6-4A20-986D-F59F5741DCCE}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

But for some reason when I go to 192.168.56.1 in my windows browswer it loads a white page. If I go to 192.168.56.1:5000 it says it can not connect.

In my virtual box I have it "attached to: NAT" and port forwarding rules show

ssh TCP 127.0.0.1 host port 2222 guest ip is empty and guest port is 22

My flask app shows

 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
 * Restarting with stat

Also tried with

 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
Dieselist

answer to your question you can find in VirtualBox documentation: https://www.virtualbox.org/manual/ch06.html 6.3.1. Configuring port forwarding with NAT

You can just forward port 5000 from guest OS (Ubuntu) to host one. On the host side you can use the same port number (if it's not occupied by someone else, sure)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Accessing ubuntu virtual machine host from windows browser

From Dev

Accessing Virtual Box Machines from Host Machine

From Dev

Browsing website hosted in the virtual machine from host machine's browser

From Dev

Accessing a web server on a Mac Virtual Machine from the Mac Host and Network

From Dev

libcurl work perfect on ubuntu virtual machine but can not resolve host on windows

From Dev

Displaying windows from a Windows virtual machine on a Linux host window manager

From Dev

How to enable copy paste from between host machine and virtual machine in vmware, virtual machine is ubuntu

From Dev

Accessing localhost from virtual machine

From Dev

Error Empty Response when accessing apache virtual host from another machine on local network

From Dev

Accessing apache2 residing inside Docker container from Host machine web browser

From Dev

How to copy text from Host machine and paste it into nano editor in Ubuntu Server Virtual Machine

From Dev

Ubuntu on Windows 8 - Virtual Machine

From Dev

scp from ubuntu virtual machine under Windows 7: connect refused

From Dev

Accessing VirtualBox localhost from host machine

From Dev

Accessing localhost from windows browser

From Dev

Find Hostname of Host from inside a virtual machine?

From Dev

Windows Virtual Machine from .VHD

From Dev

Connect to virtual machine's mysql database from host, windows 7, debian

From Dev

Virtual Machine with Bridged Adapter to Centos not accepting ssh from host machine

From Dev

Connect to a virtual machine from host as if it was another network machine

From Dev

Run Windows 7 partition as virtual machine in Ubuntu

From Dev

Sharing a virtual machine between Ubuntu and Windows

From Dev

Can a virtual machine created in Windows run on Ubuntu?

From Dev

Oracle virtual machine (Ubuntu) on windows 7

From Dev

Windows 7 running on a Virtual Machine on Ubuntu 18.10

From Dev

Accessing Ubuntu guest (VirtualBox) node.js server from Windows host

From Dev

Host Website On Virtual Machine

From Dev

Java: Accessing Windows files from Linux machine

From Dev

What is the "Virtual Machine Host" option during the installation of Ubuntu 16.04?

Related Related

  1. 1

    Accessing ubuntu virtual machine host from windows browser

  2. 2

    Accessing Virtual Box Machines from Host Machine

  3. 3

    Browsing website hosted in the virtual machine from host machine's browser

  4. 4

    Accessing a web server on a Mac Virtual Machine from the Mac Host and Network

  5. 5

    libcurl work perfect on ubuntu virtual machine but can not resolve host on windows

  6. 6

    Displaying windows from a Windows virtual machine on a Linux host window manager

  7. 7

    How to enable copy paste from between host machine and virtual machine in vmware, virtual machine is ubuntu

  8. 8

    Accessing localhost from virtual machine

  9. 9

    Error Empty Response when accessing apache virtual host from another machine on local network

  10. 10

    Accessing apache2 residing inside Docker container from Host machine web browser

  11. 11

    How to copy text from Host machine and paste it into nano editor in Ubuntu Server Virtual Machine

  12. 12

    Ubuntu on Windows 8 - Virtual Machine

  13. 13

    scp from ubuntu virtual machine under Windows 7: connect refused

  14. 14

    Accessing VirtualBox localhost from host machine

  15. 15

    Accessing localhost from windows browser

  16. 16

    Find Hostname of Host from inside a virtual machine?

  17. 17

    Windows Virtual Machine from .VHD

  18. 18

    Connect to virtual machine's mysql database from host, windows 7, debian

  19. 19

    Virtual Machine with Bridged Adapter to Centos not accepting ssh from host machine

  20. 20

    Connect to a virtual machine from host as if it was another network machine

  21. 21

    Run Windows 7 partition as virtual machine in Ubuntu

  22. 22

    Sharing a virtual machine between Ubuntu and Windows

  23. 23

    Can a virtual machine created in Windows run on Ubuntu?

  24. 24

    Oracle virtual machine (Ubuntu) on windows 7

  25. 25

    Windows 7 running on a Virtual Machine on Ubuntu 18.10

  26. 26

    Accessing Ubuntu guest (VirtualBox) node.js server from Windows host

  27. 27

    Host Website On Virtual Machine

  28. 28

    Java: Accessing Windows files from Linux machine

  29. 29

    What is the "Virtual Machine Host" option during the installation of Ubuntu 16.04?

HotTag

Archive