Running LAMP in VirtualBox, can't visit IP address on host pc.

May 29, 2015 2.4k views
Server Optimization

I’m currently running LAMP with gui in VirtualBox. Ive installed phpmyadmin as well. Visiting my IP address and phpmyadmin works in the web browser in the gui in VirtualBox just fine. But i don’t really want a gui with LAMP. I only want the terminal. But i want to be able to use phpmyadmin with my host PC. When i try this it dosen’t work. Why is that? is there something i can do to solve this?

1 Answer

By default a new VirtualBox machine will have it’s network interface set to NAT. If you switch this to a bridged adapter, other computers on your local network will be able to access it and it will reach out to your router for it’s own IP. As long as you haven’t set a static IP address you should be able to power off your VM, change this setting and power back on. Your VM will now have a new IP address on the same subnet as your host system and should be reachable via a browser.

Have another answer? Share your knowledge.