There are a few things that you need to do to get the competition VM running on your laptop. First, boot your VM in NAT networking mode. Then proceed with the following instructions. NB: these settings should work with VMware, but the process should be similar if you're using something else.

The Problem

The problem is in two parts: (1) Wordpress assumes that it has been assigned a DNS name (which is not true on a local installation), and (2) your browser needs to know how to resolve that DNS name to your VM.

The Solution

We'll tackle the solution in 3 steps.

Step 1: Figure out what subnet your VMs are on and find a static IP assignment
  1. Find out VM subnet
    ifconfig eth0
    
    Note the IP address that this produces (aaa.bbb.ccc.ddd).
  2. Edit /etc/network/interfaces.static
    sudo nano /etc/network/interfaces.static
    
    and make sure it says the following (aaa.bbb.ccc are the values you got in previous step)
    address aaa.bbb.ccc.3
    netmask 255.255.255.0
    gateway aaa.bbb.ccc.1
    dns-nameservers aaa.bbb.ccc.2
    
  3. Point /etc/network/interfaces to your new configuration file
    sudo rm /etc/network/interfaces
    sudo ln -s /etc/network/interfaces.static /etc/network/interfaces
    
  4. Reboot your VM for changes to take effect
    sudo /sbin/reboot
    
  5. Test the new network configuration by running
    ifconfig eth0
    
    You should see aaa.bbb.ccc.3 as the IP address.
  6. Test external connectivity
    ping www.google.com
    
Step 2: Now that we have a static IP address, let's make sure the guest VM can resolve it.
  1. Edit /etc/hosts file to fix the line that maps ctf-portal.ctf.csail.mit.edu to an IP address
    sudo nano /etc/hosts
    
    make sure the last line reads
    aaa.bbb.ccc.3  ctf-portal.ctf.csail.mit.edu
    
  2. Test with ping
    ping ctf-portal.ctf.csail.mit.edu
    
    this should give you successful pings to aaa.bbb.ccc.3
Step 3: Finally, the guest should know how to resolve ctf-portal.ctf.csail.mit.edu, but your host that has your browser does not.
  1. The solution is similar to above, but OS-dependent. Find the /etc/hosts equivalent on your machine, and insert the same line you used above at the end.
    1. On OS X and Linux, this is /etc/hosts
    2. On Windows, this is %systemroot%\system32\drivers\etc\hosts
  2. Test your modifications by pointing your browser to ctf-portal.ctf.csail.mit.edu. You should see the Wordpress front page if everything worked.
  • No labels