How to Access Laravel Application running in a Virtual Server from a Host Machine

Posted on

Introduction

This is an article where the focus is just to show how to access Laravel-based application running in a virtual server. In this context, the access to the Laravel-based application running in a virtual server is from a host machine. So, the virtual server is running in a VirtualBox application. Moreover, the VirtualBox application is available in the host machine.

Steps for Accessing Laravel Application running in a Virtual Server from a Host Machine

Without further explanation, the following are the steps to achieve it :

  1. First of all, just access the VirtualBox application as follows :

    How to Access Laravel Application running in a Virtual Server from a Host Machine
  2. After that, just right click and access the Setting window as follows :

    How to Access Laravel Application running in a Virtual Server from a Host Machine
  3. Access the Network tab as follows :

    How to Access Laravel Application running in a Virtual Server from a Host Machine

    Do not forget to click the Port Forwarding button. The following window box will appear :

    How to Access Laravel Application running in a Virtual Server from a Host Machine

    The above output actually can be different with one another depends on the environment. There are already several port forwarding definition above. So, in this context, just add a new port forwarding to access Laravel-based appplication running in the virtual server using port 8000. Choose port ‘9000’ as the port in the host machine to accept the incoming request for further forwarding request to the port ‘8000’ in the virtual server or guest machine. The following is the image for the port forwarding new definition :

    How to Access Laravel Application running in a Virtual Server from a Host Machine
  4. So, after clicking the OK button and exit from the Settings Window Box of VirtualBox application, just access the Laravel-based application. The following is the default page of the Laravel-based application. Accessing the Laravel-based application is easy just by typing the address of ‘http://localhost:9000’ in the address bar of the Web Browser as follow :

    How to Access Laravel Application running in a Virtual Server from a Host Machine

Leave a Reply