Problem:
When referencing a WP site using an IP address on a DHCP network, you will loose access if and when the IP address lease is renew via DHCP.
Solution:
add the following code to the end of wp-config.php (after the wp-settings.php include)
// START OF CODE
update_option(‘siteurl’,’http://’.$_SERVER[“SERVER_ADDR”]);
update_option(‘home’,’http://’.$_SERVER[“SERVER_ADDR”]);
// END OF CODE
providing your WP installation is located in the www root.
When you start the Virtual Machine, after logging, issue the ifconfig (for linux) or ipconfig (for windows) to obtain the current IP address. Then go to you browser and enter that IP address. You will always have access to the WP site regardless of any IP assignment. The only prerequisite is to logged into the VM session to obtain the new IP address