Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Wiki Markup
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.

...



h5. 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.

...



h5. The Solution

...



We'll tackle the solution in 3 steps.

...



h6. Step 1:  Figure out what subnet your VMs are on and find a static IP assignment

...



# Find out VM subnet

...


\\
{code}
ifconfig eth0

...

{code}
Note the IP address that this produces ({{aaa.bbb.ccc.ddd}}).

...


# Edit {{/etc/network/interfaces.static

...

}}
\\
{code}
sudo nano /etc/network/interfaces.static

...

{code}
and make sure it says the following ({{aaa.bbb.ccc}} are the values you got in previous step)

...


\\
{code}
address aaa.bbb.ccc.3
netmask 255.255.255.0
gateway aaa.bbb.ccc.1
dns-nameservers aaa.bbb.ccc.2

...

{code}
# Point {{/etc/network/interfaces}} to your new configuration file

...


\\
{code}
sudo rm /etc/network/interfaces
sudo ln -s /etc/network/interfaces.static /etc/network/interfaces

...

{code}
# Reboot your VM for changes to take effect
\\
{code}
sudo /sbin/reboot

...

{code}
# Test the new network configuration by running
\\
{code}
ifconfig eth0

...

{code}
You should see {{aaa.bbb.ccc.3}} as the IP address.

...


# Test external connectivity

...


\\
{code}
ping www.google.com

...


{code}

h6. Step 2: Now that we have a static IP address, let's make sure the guest VM can resolve it.

...



# Edit {{/etc/hosts}} file to fix the line that maps {{ctf-portal.ctf.csail.mit.edu}} to an IP address

...


\\
{code}
sudo nano /etc/hosts

...

{code}
make sure the last line reads

...


\\
{code}
aaa.bbb.ccc.3  ctf-portal.ctf.csail.mit.edu

...

{code}
# Test with ping
\\
{code}
ping ctf-portal.ctf.csail.mit.edu
{code}

...

this should give you successful pings to {{aaa.bbb.ccc.3

...

}}

h6. 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.

...



# 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.

...


## On OS X and Linux, this is {{/etc/hosts

...

}}
## On Windows, this is {{%systemroot%\system32\drivers\etc\hosts

...

}}
# Test your modifications by pointing your browser to {{ctf-portal.ctf.csail.mit.edu}}. You should see the Wordpress front page if everything worked.