I am using internal network in VM1 and VM2. VM1 is also connected to host machine internet through bridge adapter. VM1 and VM2 are both virtual box machines running ubuntu server.

How can I access VM2 LAMP server (localhost) where Wordpress is installed through virtual box host browser, so that the traffic goes through VM1? I want to access Wordpress on my host machine browser?


I have setup proxy in VM1 so I can control and monitor the network traffic what VM2 creates. Also I have considered docker, but the proxy does not have any instructions how to setup anything similar to what I need.


You'll need to configure both VMs to be able to communicate with your network using bridge adapters. You'll then be able to configure their IP addressing to be in the same subnet so that they can communicate.

You'll then need to configure your WordPress to use a hostname (or an IP) in the WordPress admin so that when you open the site in the other machine the links and resources (CSS, JS etc.) will resolve.

If you're wanting to test real domain names you're going to need to look at creating some virtual hosts for your web server - and don't forget you're going to need to make sure the hosts files point to the server IP to resolve the domain name to the VM IP rather than out to the Internet.

What you're trying to do is quite complicated with the fact you need to change settings on all your VMs so they can correctly communicate with your web server.

My personal recommendation if you're testing/developing? Buy some cheap hosting and register a domain name to host your WordPress.

  • As much as I have understood when I add bridge adapter to VM2 than the traffic is not going through VM1 but straight to host machine. – user3748173 May 24 '17 at 10:55

I ended up using Host-only Atapter and Internal network in VM2. That way I can access the Wordpress website (that is located in VM2) in my host machine browser and Internal network in VM2 ables to guide all the outside connection through proxy in VM1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.