Difference between revisions of "HOWTO use VMware to set up virtual networks (Windows)"

From Nsnam
Jump to: navigation, search
Line 120: Line 120:
 
             auto eth1
 
             auto eth1
 
             iface eth1 inet dhcp
 
             iface eth1 inet dhcp
     q.  Edit /etc/hosts and replace instances of "ub710jeos" with "ns-3-test-1";
+
     q.  Edit (vi) /etc/hosts and replace instances of "ub710jeos" with  
     r.  Change the host hame by executing "hostname ns-3-test-1";
+
        "ns-3-test-1";
     q.  Log out of the VM;
+
     r.  Edit (vi) /etc/hostname and replace "ub710jeos" with "ns-3-test-1";
     r.  Press the red square (stop) button on the VMware Server Console to  
+
    s.  Change the host hame by executing "hostname ns-3-test-1";
 +
     t.  Log out of the VM;
 +
     u.  Press the red square (stop) button on the VMware Server Console to  
 
         stop the VM.
 
         stop the VM.
  
Line 148: Line 150:
 
Congratulations, you are now ns-3 emulation ready.
 
Congratulations, you are now ns-3 emulation ready.
  
[[User:Craigdo|Craigdo]] 03:43, 6 August 2008 (EDT)
+
[[User:Craigdo|Craigdo]] 03:49, 6 August 2008 (EDT)

Revision as of 07:49, 6 August 2008

Main Page - Current Development - Developer FAQ - Tools - Related Projects - Project Ideas - Summer Projects

Installation - Troubleshooting - User FAQ - HOWTOs - Samples - Models - Education - Contributed Code - Papers

One of the main points of using simulation software is that you don't have to buy lots of hardware in order to investigate large configurations. We have a realtime emulation package that allows us to connect ns-3 to real networks on real machines. The problem, of course, is that you need lots of real machines to run real programs. Using VMware, we replace "real machines" with "virtual machines" and configure virtual networks of virtual machines instead of having to work with tons of real hardware.

HOWTO use VMware to set up virtual networks (Windows)

1. Get the VMware server software

   a.  You may read in various release notes or documentation that you need 
       Microsoft servers of various kinds.  This is not the case.  You can 
       run VMware server on XP just fine;
   b.  Go to http://www.vmware.com/download/server/ to get the software;
   c.  Select the Download Now button (download as usual);
   d.  Install the software in the usual way;
   e.  Ignore warnings about requiring Microsoft IIS to continue.

2. Request a Serial Number

   a.  Go to http://register.vmware.com/content/registration.html
   b.  Fill out the page abd select "Submit";
   c.  You will be redirected to a page with your new serial number;
   d.  Copy the serial number;
   e.  Run the VMware server;
   f.  Select the menu item Help->Enter Serial Number ...
   g.  Paste in the new serial number.

3. Install a Virtual Machine

   a.  Exit the VMware Server.
   b.  We prefer Ubuntu JeOS (Just enough OS).  You can download the code from
       the VMware "Virtual Appliance Marketplace" by going to
       http://www.vmware.com/appliances/directory/1136 and selecting "Download
       this Appliance" link from the "Download" box to the right of the
       appliance name (Ubuntu 7.10 JeOS v1.031 with VMware drivers (70MB));
   c.  Download the appliance and unzip the file.  You should have a directory
       named "ub710jeos".  Copy this directory to the "c:\Virtual Machines" 
       (VMware) directory.
   d.  Run the VMware server.  If you get a complaint about not having a disk
       in your CD-ROM, just continue;
   e.  Select the "Local Host" radio button and press "OK";
   f.  Select the File->Open menu option and Browse for the  
       "ub710jeos" directory and open the "ub710jeos.vmx" file;

5. Start the new Virtual Machine

   a.  Select the "Start this virtual machine" command on the VMware Server
       Console;
   b.  You will get a dialog box asking about a new UUID.  Select the "Create"
       radio button and press "OK";
   c.  Ubuntu JeOS will start in a "console window."  If you want to type into
       the JeOS VM, you must click your mouse in the console window.  If you 
       want to exit to Windows, press <control>+<alt> and you will pop out of 
       the VM;
   d.  Login as user: root, password root;
   e.  Change the password (passwd)if you are connected to the real world and 
       like your system intact.
   f.  Ping www.google.com to test network connectivity.

5. Freshen the Software Distribution

   a.  apt-get update
   b.  apt-get install
   c.  apt-get install pkg-config libxml2 libxml2-dev
   d.  apt-get install gcc g++ make automake autoconf binutils
   e.  apt-get install openssh-server openssh-client openssl libssl-dev
   f.  apt-get install python-dev mercurial
   g.  exit

6. Log in as User (Appliance comes pre-configured with one user)

   a.  log in as user: user, password user
   b.  Change your password (passwd) if you are connected to the real world and 
       like your system intact

7. Get and Test ns-3-dev

   a.  mkdir repos
   b.  cd repos
   c.  hg clone http://code.nsnam.org/ns-3-dev
   d.  cd ns-3-dev
   e.  ./waf configure -d debug
   f.  ./waf
   g.  ./waf --regression

As an old math professor once said, "I feel joy"!

Now it's time for a breather. You have a configured Ubuntu JeOS Virtual Machine and you've built and tested ns-3 on it. Now might be a good time to copy this VM somewhere safe as your base machine. If you want to clone your machine you can use this copy, or if you manage to wedge the VM, you can use the copy as a checkpoint and restore a working copy without going through all the pain we just suffered through.

8. Checkpoint the VM

   a.  log out of the VM (exit);
   b.  Press the red rectangle (stop) button on the VMware Server Console;
   c.  Open My Computer/Virtual Machines
   d.  Copy "ub710jeos" to "ub710jeos checkpoint"

Now it's time to start creating that test network that was the reason we started this process. We'll use the checkpointed VM we just made and copy it to begin.

9. Create new VM with a Private Network

   a.  Copy "c:\Virtual Machines\ub710jeos checkpoint" to another directory in
       the "Virtual Machines" directory and call it "ns-3-test-1"
   b.  Select the File->Open menu option and Browse for the  
       "ns-3-test-1" directory and open the "ub710jeos.vmx" file;
   e.  Select the "Edit virtual machine settings" command on the VMware Server
       Console;
   d.  Click on the "Options" tab;
   e.  Enter "ns-3-test-1" in the "Virtual machine name" text box;
   f.  Click on the "Hardware" tab;
   g.  Click on the "Add" button.  You will launch the "Add Hardware Wizard";
   h.  Click "Next";
   i.  Click "Ethernet Adapter" and then "Next";
   j.  Click the "Host Only:  A private network shared with the host" radio
       button and then "Next";
   k.  Click "OK";
   l.  Select the "Start this virtual machine" command on the VMware Server
       Console;
   m.  You will get a dialog box asking about a new UUID.  Select the "Create"
       radio button and press "OK";
   n.  Ubuntu JeOS will start in a "console window."
   o.  Log in as root (you changed the password, right?)
   p.  Edit (vi) "/etc/network/interfaces" and add the following lines:
           # The private network interface
           auto eth1
           iface eth1 inet dhcp
   q.  Edit (vi) /etc/hosts and replace instances of "ub710jeos" with 
       "ns-3-test-1";
   r.  Edit (vi) /etc/hostname and replace "ub710jeos" with "ns-3-test-1";
   s.  Change the host hame by executing "hostname ns-3-test-1";
   t.  Log out of the VM;
   u.  Press the red square (stop) button on the VMware Server Console to 
       stop the VM.

Now you have one VM with a private network on it. You can repeat step nine as many times as you want, renaming the VMs ns-test-2, ns-test-3, etc. Go ahead and make a ns-test-2 virtual machine just so we can do something interesting.

11. Start Your Virtual Test Network

   a.  Select the "ns-3-test-1" tab on the VMware Server Console;
   b.  Select the "Start this virtual machine" command on the VMware Server
       Console;
   c.  Ubuntu JeOS will start in a "console window";
   d.  You should see an "ns-3-test-1 login" prompt when it comes up;
   e.  Select the "ns-3-test-2" tab on the VMware Server Console;
   f.  Select the "Start this virtual machine" command on the VMware Server
       Console;
   g.  Ubuntu JeOS will start in a "console window."
   h.  You should see an "ns-3-test-2 login" prompt when it comes up;

Now switch back and forth between the VMs by selecting either the "ns-test-1" or "ns-test-2" tabs on the VMware Server Console.

Congratulations, you are now ns-3 emulation ready.

Craigdo 03:49, 6 August 2008 (EDT)