3

How can I access my virtual host like http://copywriters.localhost inside my Windows 10 VirtualBox?

I already set this:

In VM Host File:

10.0.2.2 localhost
10.0.2.2 copywriters.localhost

In my Host PC:

127.0.0.1 copywriters.localhost

I can ping http://copywriters.localhost in VM. But can access on browser.

Melebius
  • 11,121
  • 8
  • 50
  • 77
TRD-Warren
  • 131
  • 1
  • 3
  • Virtualbox treats Host and Guest like two independent systems on a network: localhost ports on system A cannot be seen by applications on system B. Vbox Guest Additions will permit you to share the filesystem on the host, but not ports. – user535733 Oct 09 '18 at 06:51
  • 1
    Don’t replace the default `localhost` with a different address (`10.0.2.2 localhost`)! Can you connect to your host system using the IP address? – Melebius Oct 09 '18 at 07:18
  • @Melebius I can connect with my phpmyadmin `http://10.0.2.2/phpmyadmin` but can't connect using this `http://localhost/phpmyadmin` in my VM – TRD-Warren Oct 09 '18 at 07:42
  • 1
    In this case, the line `10.0.2.2 copywriters.localhost` should be sufficient AFAIK. – Melebius Oct 09 '18 at 07:43
  • `127.0.0.1 copywriters.localhost`is not correct. Assuming it's a bridged network, you need the same `10.0.2.2 copywriters.localhost` rule. – RobotHumans Oct 09 '18 at 12:43
  • 2
    Possible duplicate of [Setting up vhost on VirtualBox with Ubuntu 16.04](https://askubuntu.com/questions/941299/setting-up-vhost-on-virtualbox-with-ubuntu-16-04) – pa4080 Oct 09 '18 at 12:46

0 Answers0