Access web server on VirtualBox/Vagrant machine from host browser?


username

I have a Django web server on a VirtualBox/Vagrant machine running Ubuntu.

I have followed this guide to create a Django project : https://docs.djangoproject.com/en/dev/intro/tutorial01/

http://127.0.0.1:8000/I have a web server running inside my guest computer . This is my first time running Django web server. It should be a hello world application.

How can I access this web application from the host browser?

I tried running ifconfig in the client machine to get the IP I should be accessing, and I found a promising IP address in the inet addr.

But I tried typing the following into my host browser without success.http://inetaddrnumbers:8000/

How to access web server from browser?

Kakar

try this.

  1. Open the vagrant file (should be in the directory you specified to create a new vagrant computer).
  2. search config.vm.network. If you don't have a settings file before, you should comment it out.
  3. Change it to look like this config.vm.network "private_network", ip: "55.55.55.5". The IP address here (55.55.55.5) can be any IP address you want.
  4. Now logout from vagrant's computer and reload vagrant's computer with this command vagrant reload.
  5. SSH to the idling machine again and restart the django server via this command python manage.py runserver 0.0.0.0:80. The port address (80) can be 8000 again if desired.
  6. After that, enter the following address in your browser 55.55.55.5and hopefully you will see your web application.

Now, if you want to go a step further, you can edit the hosts file and add the following line

55.55.55.5 mynewdomain.com

Then enter the follow address in the browser,

mynewdomain.com

and you should see your web application. Note that www is not added to the domain name inside the hosts file, so only mynewdomain.com can be accessed. However, you can add it.

Hope this helps. cheers.

Related


Web browser to access server from local machine

Twitter I can access the folder view from the server using nautilus . Now I want to access apache tomcat to access browser view from this server. So please help how to access the browser view of the server. Adrian Challino If you want to access tomcat, you can

Access ubuntu virtual machine host from windows browser

nadermx I have a Virtualbox ubuntu machine running a world class flask application. I tried showing the app on 127.0.0.1:5000 and 0.0.0.0:5000 But when I try to load on windows browser, neither works. When I run ifconfig in the ubuntu virtual machine, I get th

Access ubuntu virtual machine host from windows browser

nadermx I have a Virtualbox ubuntu machine running a world class flask application. I tried showing the app on 127.0.0.1:5000 and 0.0.0.0:5000 But when I try to load on windows browser, neither works. When I run ifconfig in the ubuntu virtual machine, I get th

Access ubuntu virtual machine host from windows browser

nadermx I have a Virtualbox ubuntu machine running a world class flask application. I tried showing the app on 127.0.0.1:5000 and 0.0.0.0:5000 However, when I try to load on Windows browser, neither works out. When I run ifconfig in the ubuntu virtual machine,

Access ubuntu virtual machine host from windows browser

nadermx I have a Virtualbox ubuntu machine running a world class flask application. I tried showing the app on 127.0.0.1:5000 and 0.0.0.0:5000 However, when I try to load on Windows browser, neither works out. When I run ifconfig in the ubuntu virtual machine,

Access the virtual machine from the host

Ubaid Ahmed My host's OS is Windows and I'm using Oracle Virtual box . I have 3 virtual machines: Kali Linux , Metasploitable and Windows 10 . Question 1: I host a website in Metasploitable. If I use NAT network, I can access the site using IP in Kali Linux an

Access the virtual machine from the host

Ubaid Ahmed My host's OS is Windows and I'm using Oracle Virtual box . I have 3 virtual machines: Kali Linux , Metasploitable and Windows 10 . Question 1: I host a website in Metasploitable. If I use NAT network, I can access the site using IP in Kali Linux an

Access the virtual machine from the host

Ubaid Ahmed My host's OS is Windows and I'm using Oracle Virtual box . I have 3 virtual machines: Kali Linux , Metasploitable and Windows 10 . Question 1: I host a website in Metasploitable. If I use NAT network, I can access the site using IP in Kali Linux an

How to access Docker container's web server from host

entropy: I am running under boot2docker 1.3.1. I have a Docker container running a web server via uwsgi --http :8080. If I connect to the container, I can browse the website using lynx http://127.0.0.1:8080so I know the server is running. I run the container w

How to access Docker container's web server from host

entropy I am running under boot2docker 1.3.1. I have a Docker container running a web server via uwsgi --http :8080. If I connect to the container, I can browse the website with lynx http://127.0.0.1:8080so I know the server is running. I run the container wit

How to access Docker container's web server from host

entropy: I am running under boot2docker 1.3.1. I have a Docker container running a web server via uwsgi --http :8080. If I connect to the container, I can browse the website using lynx http://127.0.0.1:8080so I know the server is running. I run the container w

Unable to access web server in Docker swarm from host

Mount I started using Docker on macOS and got stuck trying to complete part 4 of the Getting Started Guide . I created two additional virtual machines ( and ), set up as cluster manager and worker respectively. Then, a stack of 5 Flask web servers was deployed

Unable to access VirtualBox web server on port 9000 from host OS

grssnbchr I have an Ubuntu 12.04 guest VB on a W7 host. On the guest, I am running a web server on port 9000 and the web server is accessible from the guest from above 127.0.0.1:9000. In VirtualBox, I have two network adapters enabled for the guest. I didn't c

How to access Docker container's web server from host

entropy: I am running under boot2docker 1.3.1. I have a Docker container running a web server via uwsgi --http :8080. If I connect to the container, I can browse the website using lynx http://127.0.0.1:8080so I know the server is running. I run the container w

Unable to access web server in Docker swarm from host

Mount I started using Docker on macOS and got stuck trying to complete part 4 of the Getting Started Guide . I created two additional virtual machines ( and ), set up as cluster manager and worker respectively. Then, a stack of 5 Flask web servers was deployed

Unable to access VirtualBox web server on port 9000 from host OS

grssnbchr I have an Ubuntu 12.04 guest VB on a W7 host. On the guest, I am running a web server on port 9000 and the web server is accessible from the guest from above 127.0.0.1:9000. In VirtualBox, I have two network adapters enabled for the guest. I didn't c

Host web browser cannot access Docker container

Gabor Szabo I executed a service in a docker container and exposed the container port 8080to the host port 6000. Order: docker run \ -d \ --rm \ --name keycloak \ -p 6000:8080 \ -e KEYCLOAK_USER=admin \ -e KEYCLOAK_PASSWORD=admin \

Host web browser cannot access Docker container

Gabor Szabo I executed a service in a docker container and exposed the container port 8080to the host port 6000. Order: docker run \ -d \ --rm \ --name keycloak \ -p 6000:8080 \ -e KEYCLOAK_USER=admin \ -e KEYCLOAK_PASSWORD=admin \

Host web browser cannot access Docker container

Gabor Szabo I executed a service in a docker container and exposed the container port 8080to the host port 6000. Order: docker run \ -d \ --rm \ --name keycloak \ -p 6000:8080 \ -e KEYCLOAK_USER=admin \ -e KEYCLOAK_PASSWORD=admin \

Host web browser cannot access Docker container

Gabor Szabo I executed a service in a docker container and exposed the container port 8080to the host port 6000. Order: docker run \ -d \ --rm \ --name keycloak \ -p 6000:8080 \ -e KEYCLOAK_USER=admin \ -e KEYCLOAK_PASSWORD=admin \