Friday, March 12, 2010

802.15.4 NS2 Simulation

The reason to write this topic is many people asked me how to simulate sensor networks. Obviously, authors of 802.15.4/Zigbee protocol developers on NS2 have given a sample examples. But, these examples do not run correctly, and give some kind of unknown error (at least I don't know what errors mean). Therefore, I have decided to test AODV using 802.15.4 MAC/PHY. Thus, if my tests work, I hope you can test your own routing protocols using this source code.

Alright, the TCL file is fairly simple. I briefly explain what means what. We first set simulation environment. We are going to deploy 500 nodes, in 1000x500 sqm area, simulation time is 500 seconds. And we are using 802.15.4 MAC/PHY and interface queue is 100. We also set simulator and files to trace the simulation.

# Generated by Topology Generator for Network Simulator (c) Elmurod Talipov
set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy/802_15_4 ;# network interface type
set val(mac) Mac/802_15_4 ;# MAC type
set val(ifq) Queue/DropTail/PriQueue ;# interface queue type
set val(ll) LL ;# link layer type
set val(ant) Antenna/OmniAntenna ;# antenna model
set val(ifqlen) 100 ;# max packet in ifq
set val(nn) 500 ;# number of mobilenodes
set val(rp) AODV ;# protocol tye
set val(x) 1000 ;# X dimension of topography
set val(y) 500 ;# Y dimension of topography
set val(stop) 500 ;# simulation period
set val(energymodel) EnergyModel ;# Energy Model
set val(initialenergy) 100 ;# value
set ns [new Simulator]
set tracefd [open trace-aodv-802-15-4.tr w]
set namtrace [open nam-aodv-802-15-4.nam w]
$ns trace-all $tracefd
$ns namtrace-all-wireless $namtrace $val(x) $val(y)

Let's set radio transmission range to 40 meters, but this does not mean exactly 40 meters. The code below filters packet with receiving signal strength above "40 meters".

set dist(5m) 7.69113e-06
set dist(9m) 2.37381e-06
set dist(10m) 1.92278e-06
set dist(11m) 1.58908e-06
set dist(12m) 1.33527e-06
set dist(13m) 1.13774e-06
set dist(14m) 9.81011e-07
set dist(15m) 8.54570e-07
set dist(16m) 7.51087e-07
set dist(20m) 4.80696e-07
set dist(25m) 3.07645e-07
set dist(30m) 2.13643e-07
set dist(35m) 1.56962e-07
set dist(40m) 1.20174e-07
Phy/WirelessPhy set CSThresh_ $dist(40m)
Phy/WirelessPhy set RXThresh_ $dist(40m)

And lets set topography as flat, deploy nodes randomly in an area of 1000 x 500 sqm.

# set up topography object
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
create-god $val(nn)
# configure the nodes
$ns node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channel [new $val(chan)] \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF \
-movementTrace OFF \
-energyModel $val(energymodel) \
-initialEnergy $val(initialenergy) \
-rxPower 35.28e-3 \
-txPower 31.32e-3 \
-idlePower 712e-6 \
-sleepPower 144e-9
#-IncomingErrProc MultistateErrorProc \
#-OutgoingErrProc MultistateErrorProc
for {set i 0} {$i < $val(nn) } { incr i } {
set mnode_($i) [$ns node]
}
for {set i 1} {$i < $val(nn) } { incr i } {
$mnode_($i) set X_ [ expr {$val(x) * rand()} ]
$mnode_($i) set Y_ [ expr {$val(y) * rand()} ]
$mnode_($i) set Z_ 0
}

And we are goig to deploy sink node in the center of area, i.e. at [500, 250].

# Position of Sink
$mnode_(0) set X_ [ expr {$val(x)/2} ]
$mnode_(0) set Y_ [ expr {$val(y)/2} ]
$mnode_(0) set Z_ 0.0
$mnode_(0) label "Sink"

The code below is useful how big the nodes are going to be shown in NAM (network animator), thus it does not have meaning in real simulation.

for {set i 0} {$i < $val(nn)} { incr i } {
$ns initial_node_pos $mnode_($i) 10
}

Finally, we have deployed nodes, and remained important thing is establish connection. We are going to use UDP protocol with CBR (constant bit rate, interval (interval_) is set to 2 seconds)

#Setup a UDP connection
set udp [new Agent/UDP]
$ns attach-agent $mnode_(10) $udp
set sink [new Agent/Null]
$ns attach-agent $mnode_(0) $sink
$ns connect $udp $sink
$udp set fid_ 2
#Setup a CBR over UDP connection
set cbr [new Application/Traffic/CBR]
$cbr attach-agent $udp
$cbr set type_ CBR
$cbr set packet_size_ 50
$cbr set rate_ 0.1Mb
$cbr set interval_ 2
#$cbr set random_ false
$ns at 5.0 "$cbr start"
$ns at [expr $val(stop) - 5] "$cbr stop"
# Telling nodes when the simulation ends
for {set i 0} {$i < $val(nn) } { incr i } {
$ns at $val(stop) "$mnode_($i) reset;"
}
# ending nam and the simulation
$ns at $val(stop) "$ns nam-end-wireless $val(stop)"
$ns at $val(stop) "stop"
$ns at [expr $val(stop) + 0.01] "puts \"end simulation\"; $ns halt"
proc stop {} {
global ns tracefd namtrace
$ns flush-trace
close $tracefd
close $namtrace
}
$ns run

We have finished writing sample AODV TCL script, we can run it

ns aodv_802_15_4.tcl

NAM gives me following deployment result.

nam-aodv-802-15-4nam

Download whole source code here : aodv_802_15_4.tcl . If you find any problem with that, leave comment here. If you want to test your own routing protocol simply change $val(rp) AODV with your own.

Adding New Routing Protocol in NS2

Writing routing protocol is fairly easy in NS2, but for beginners it seems very difficult. Therefore, if you are new to NS2 and want to write your own routing protocol, I would strongly recommend to revise AODV source code. Because, I believe AODV source code is straightforward and fairly easy to understand due to the simplicity of the AODV protocol.

Before you begin reading this post, I assume that you have already installed NS2 on Linux. I have used version 2.34, which is current release. If you have not installed yet, DOWNLOAD HERE and INSTALL. Okey, simple requirements to write your own routing protocol

  • NS2 installed
  • You should know how to program in C/C++.
  • Optionally, shell scripting and perl.

Let's start with creating directory of routing protocol. Goto the "$NS_ROOT/ ns-2.34/". Create directory named as wfrp, we call it WSN Flooding-based Routing Protocol in which sink nodes periodically send a beacon message and other nodes construct route towards the sink nodes. Then nodes report to sink node every certain period using UDP protocol. Direct Diffusion may be an example of such protocol, but what we are writing is simpler and has more functionalities.

mkdir wfrp

In the directory we create three files : wrfp.cc, wrfp.h, wrfp_packet.h. Download and put these files in wfrp directory. I will not explain the code here, and if you don't understand just leave comment I will try to answer.

Now, we are going to modify following files. Therefore it is better you backup these files before you start adding new protocol, so that you can easily go back.

  • $NS_ROOT/Makefile
  • $NS_ROOT/queue/priqueue.cc
  • $NS_ROOT/common/packet.h
  • $NS_ROOT/trace/cmu-trace.h
  • $NS_ROOT/trace/cmu-trace.cc
  • $NS_ROOT/tcl/lib/ns-packet.tcl
  • $NS_ROOT/tcl/lib/ns-lib.tcl
  • $NS_ROOT/tcl/lib/ns-agent.tcl
  • $NS_ROOT/tcl/lib/ns-mobilenode.tcl

Let's start with ~/ns-allinone-2.34/ns-2.34/Makefile just add following lien at 269

wfrp/wfrp.o \

Add following lines to ~/ns-allinone-2.34/ns-2.34/queue/priqueue.cc from line 93.

// WFRP patch
case PT_WFRP:

To define new routing protocol packet type we have to modify ~/ns-allinone-2.34/ns-2.34/common/packet.h file. We change PT_NTYPE to 63, and for our protocol PT_WFRP = 62. If you have already installed another routing protocol. Just make sure PT_NTYPE is last, and protocol number is ordered sequentially. From line 85 changes would be :

// WFRP packet
static const packet_t PT_WFRP = 62;
// insert new packet types here
static packet_t PT_NTYPE = 63; // This MUST be the LAST one

We make following code change at line 254 of ~/ns-allinone-2.34/ns-2.34/common/packet.h. The code is used that the packet is routing protocol packet and has high priority.

type == PT_AODV ||
type == PT_WFRP)

And at line 390 of the same file

// WFRP patch
name_[PT_WFRP] = "WFRP";

Now we will make NS2 trace our simulation and write it to *something*.tr, in order to do that we have to modify cmu-trace.h and cmu-trace.cc.

To add trace function we add following line to ~/ns-allinone-2.34/ns-2.34/trace/cmu-trace.h at line 163:

void format_wfrp(Packet *p, int offset);

~/ns-allinone-2.34/ns-2.34/trace/cmu-trace.cc must be added following code at line 1071

// WFRP patch
void
CMUTrace::format_wfrp(Packet *p, int offset)
{
struct hdr_wfrp *wh = HDR_WFRP(p);
struct hdr_wfrp_beacon *wb = HDR_WFRP_BEACON(p);
struct hdr_wfrp_error *we = HDR_WFRP_ERROR(p);
switch(wh->pkt_type) {
case WFRP_BEACON:
if (pt_->tagged()) {
sprintf(pt_->buffer() + offset,
"-wfrp:t %x -wfrp:h %d -wfrp:b %d -wfrp:s %d "
"-wfrp:px %d -wfrp:py %d -wfrp:ts %f "
"-wfrp:c BEACON ",
wb->pkt_type,
wb->beacon_hops,
wb->beacon_id,
wb->beacon_src,
wb->beacon_posx,
wb->beacon_posy,
wb->timestamp);
} else if (newtrace_) {
sprintf(pt_->buffer() + offset,
"-P wfrp -Pt 0x%x -Ph %d -Pb %d -Ps %d -Ppx %d -Ppy %d -Pts %f -Pc BEACON ",
wb->pkt_type,
wb->beacon_hops,
wb->beacon_id,
wb->beacon_src,
wb->beacon_posx,
wb->beacon_posy,
wb->timestamp);
} else {
sprintf(pt_->buffer() + offset,
"[0x%x %d %d [%d %d] [%d %f]] (BEACON)",
wb->pkt_type,
wb->beacon_hops,
wb->beacon_id,
wb->beacon_src,
wb->beacon_posx,
wb->beacon_posy,
wb->timestamp);
}
break;
case WFRP_ERROR:
// TODO: need to add code
break;
default:
#ifdef WIN32
fprintf(stderr,
"CMUTrace::format_wfrp: invalid WFRP packet type\n");
#else
fprintf(stderr,
"%s: invalid WFRP packet type\n", __FUNCTION__);
#endif
abort();
}
}

Now we will modify tcl files to create routing agent. First we define protocol name to use in tcl file. It would done by modifying ~/ns-allinone-2.34/ns-2.34/tcl/lib/ns-packet.tcl @ line 172

# WFRP patch
WFRP

Now we set routing agent by modifying ~/ns-allinone-2.34/ns-2.34/tcl/lib/ns-lib.tcl @ line 633

WFRP {
set ragent [$self create-wfrp-agent $node]
}

From line 860 of the same file following code should be added.

Simulator instproc create-wfrp-agent { node } {
# Create WFRP routing agent
set ragent [new Agent/WFRP [$node node-addr]]
$self at 0.0 "$ragent start"
$node set ragent_ $ragent
return $ragent
}

Now we will set port numbers of routing agent. sport is source port, dport is destination port. Modify ~/ns-allinone-2.34/ns-2.34/tcl/lib/ns-agent.tcl line 202

Agent/WFRP instproc init args {
$self next $args
}
Agent/WFRP set sport_ 0
Agent/WFRP set dport_ 0

Frankly speaking I have no idea why I have to add following things. But I believe it should be done according to some tutorial : ~/ns-allinone-2.34/ns-2.34/tcl/lib/ns-mobilenode.tcl line 201

# Special processing for WFRP
set wfrponly [string first "WFRP" [$agent info class]]
if {$wfrponly != -1 } {
$agent if-queue [$self set ifq_(0)] ;# ifq between LL and MAC
}

We are done. got to ~/ns-allinone-2.34/ns-2.34/ directory and do

make clean
make

When the compile is finished, you can test using wfrp_802_15_4.tcl file as :

ns wfrp_802_15_4.tcl

In this test the NODE 0 is sink node, starts sending beacon 1 second after simulation i started, and NODE 10 is reporting node. It starts sending report over CBR/UDP at 5.0 seconds (after simulation is started). Report interval is 2 seconds.

To remove debugging WFRP, uncomment #define DEBUG (line 36 of wfrp.cc & re-make it).

Method to analyse NS2 Trace file

Today I am going to show a simple perl code to analyze NS2 trace file as an example of AODV routing protocol. As you know when you run simulation, NS2 generates a trace file like sometrace.tr. It will give a lot of information about your simulation result. Not knowing how to analyze this file it is useless to run NS2 simulator. In this topic we will learn how to compute delivery ratio and message overhead.

First go to your home directory and create bin directory there. We will create trace file here so that we can access it from anywhere we want.

cd ~
mkdir bin
cd bin

Download analyze.pl file, which is attached to the post, to the bin directory. I will explain main points of the code. Following code opens a file to write simulation results.

$ofile="simulation_result.csv";
open OUT, ">$ofile" or die "$0 cannot open output file $ofile: $!";

Usually in trace file each line is started with some letter like r, s, D, N. Each of the letters has meaning. For detailed meaning of the letter refer to the NS Manual Page . And following perl code extracts lines which start with "s", which means sent packets. It maybe : control packets (AODV), data packets (cbr). We are only interested in packets those are sent by routers (RTR). If you enable MAC trace, the packets sent or received by MAC layer is also shown.

if (/^s/){
if (/^s.*AODV/) {
$aodvSent++;
if (/^s.*REQUEST/) {
$aodvSendRequest++;
}
elsif (/^s.*REPLY/) {
$aodvSendReply++;
}
}
elsif (/^s.*AGT/) {
$dataSent++;
}
}

REQUEST - AODV Route Request (RREQ) packets
REPLY - AODV Route Reply (RREP) packets;
AGT - Packets those are sent by agent such as cbr, udp, tcp;

And following code counts packet received by each function.

elsif (/^r/){
if (/^r.*AODV/) {
$aodvRecv++;
if (/^r.*REQUEST/) {
$aodvRecvRequest++;
}
elsif (/^r.*REPLY/) {
$aodvRecvReply++;
}
}
elsif (/^r.*AGT/) {
$dataRecv++;
}
}

Finally packets which are dropped are counted using following code :

elsif (/^D/) {
if (/^D.*AODV/) {
if (/^D.*REQUEST/) {
$aodvDropRequest++;
}
elsif (/^D.*REPLY/) {
$aodvDropReply++;
}
}
if (/^D.*RTR/) {
$routerDrop++;
}
}

Now we will analyze example file. In this post I have written about simulating WSN with AODV protocol, download it and do following. ( I am assuming you have already put analyze.pl file into your bin directory). Here is full source code to the analyze file : analyze.pl. More trace analyzer code is available in the this archive.

ns aodv_802_15_4.tcl
cat trace-aodv-802-15-4.tr | analyze.pl

Adding Malicious Node in AODV

How to implement malicious drop in AODV. To write simple code for adding malicious node in AODV ( or in any routing protocol).

First you need to modify aodv.cc and aodv.h files. In aodv.h after

/* The Routing Agent */
class AODV: public Agent {
...
/*
* History management
*/
double PerHopTime(aodv_rt_entry *rt);
...

add following line

bool malicious;

/*
Constructor
*/
AODV::AODV(nsaddr_t id) : Agent(PT_AODV), btimer(this), htimer(this), ntimer(this), rtimer(this), lrtimer(this), rqueue() {
index = id;
seqno = 2;
bid = 1;

add following line

malicious = false;

The above code is needed to initialize, and all nodes are initially not malicious. Then we will write a code to catch which node is set as malicious. In aodv.cc after

if(argc == 2) {
Tcl& tcl = Tcl::instance();

if(strncasecmp(argv[1], "id", 2) == 0) {
tcl.resultf("%d", index);
return TCL_OK;
}

add following line

if(strcmp(argv[1], "hacker") == 0) {
malicious = true;
return TCL_OK;
}

Now we will do some work in TCL to set a malicious node. Using script in my post , we add following line to set node 5 as malicious node.

$ns at 0.0 "[$mnode_(5) set ragent_] hacker"

You may add this line after

for {set i 0} {$i < $val(nn)} { incr i } {
$ns initial_node_pos $mnode_($i) 10
}
...

Alright, we have set malicious node but we did not tell malicious node what to do. As it is known, rt_resolve(Packet *p) function is used to select next hop node when routing data packets. So, we tell malicious node just drop any packet when it receives. To do that after

/*
Route Handling Functions
*/
void
AODV::rt_resolve(Packet *p) {
struct hdr_cmn *ch = HDR_CMN(p);
struct hdr_ip *ih = HDR_IP(p);
aodv_rt_entry *rt;
...

We add a few lines

// if I am malicious node
if (malicious == true ) {
drop(p, DROP_RTR_ROUTE_LOOP);
// DROP_RTR_ROUTE_LOOP is added for no reason.
}

And implementing malicious node is done. I hope the post will be helpful to design your secure routing protocol.

Putting together PDF files

Extracted from linux.com

By Scott Nesbitt

Joining PDFs the Ghostscript way

Ghostscript is a package that enables you to view or print PostScript and PDF files to other formats, or to convert those files to other formats. It's a popular tool among Linux users, but what many people don't know is that Ghostscript is also a powerful tool for combining PDF files.

To use Ghostscript to combine PDF files, type something like the following:

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdffile1.pdf file2.pdf

Unless you're very familiar with Ghostscript, that string of commands won't mean much to you. Here's a quick breakdown:

    \t
  • gs -- starts the Ghostscript program
  • \t
  • -dBATCH -- once Ghostscript processes the PDF files, it should exit. If you don't include this option, Ghostscript will just keep running
  • \t
  • -dNOPAUSE -- forces Ghostscript to process each page without pausing for user interaction
  • \t
  • -q -- stops Ghostscript from displaying messages while it works
  • \t
  • -sDEVICE=pdfwrite -- tells Ghostscript to use its built-in PDF writer to process the files
  • \t
  • -sOutputFile=finished.pdf -- tells Ghostscript to save the combined PDF file with the name that you specified

When using Ghostscript to combine PDF files, you can add any PDF-relatedoption to the command line. For example, you can compress the file, target it to an eBook reader, or encrypt it. See the Ghostscript documentation for more information.

The biggest advantage to Ghostscript is that it's a standard part of many Linux distributions. If you don't have it on your computer, it's easy todownload and install it.

Using Ghostscript has its drawbacks, too. Unless you use Ghostscript's PDF options, the utility produces a barebones merged PDF file, and a large one at that, because by default Ghostscript doesn't compress PDF files. On top of that, some people may find typing long strings of options at the command line to be a bit of a chore.

joinPDF: Quick and simple

If you want a no-muss, no-fuss way of joining two or more PDF files together,look no further than joinPDF. It's a simple but elegant little utility that consists of a script (named joinPDF) and a compiled Java file. To run it, you only need to specify at the command line the name of the output file and the files that you want to combine. To use joinPDF you type something like this:

joinpdf myFile.pdf file1.pdf file2.pdf ...

Depending on how many PDF files you're combining and their sizes, joinPDF onlytakes a few seconds to merge them. JoinPDF compresses the output file it generates; while writing this article, I used with joinPDF to merge various combinations offiles of various sizes, and each time, the resulting PDF file was several kilobytes toseveral tens of kilobytes smaller than the total sizes of the source files.

JoinPDF is a Java utility -- to use it, you needversion 1.4 of the Java Runtime Environment installed. It runs on any Linuxdistribution, or any other operating system that supports Java. In order to use joinPDF out of the box, you have to copy the Java file to the /usr/lib directory -- that's where the joinPDF script expects to find it. If you want to put the Java files somewhere else, like the /usr/local/bin directory, you need to edit the joinPDF script to point to that directory.

The biggest advantage of joinPDF is its simplicity. There are no optionsto remember. Of course, some users might find joinPDF's simplicity to be a detriment. If you want options, joinPDF isn't for you. Also, joinPDF cannot join PDFs if one or more of them is encrypted.

The joinPDF package comes with another script called splitPDF. As its name implies, splitPDF is used to extract pages PDF files. A discussion of splitPDF is beyond the scope of this article, but if you need to pull pages out of your PDF files, you'll find splitPDF useful.

Merging PDF files with pdfmeld

Do you need a lot of features in the software that you use to combine your PDF files? Then consider pdfmeld. Of the three applications discussed in this article, pdfmeld is probably the most powerful and flexible.

To use pdfmeld you type something like this at the command line:

pdfmeld file1.pdf,file2.pdf,... result.pdf [options]

pdfmeld has literally dozens of options -- for a full list, check out the documentation. These options include adding bookmarks to a PDF file, encrypting the PDF file, and adding information like title, author name, and subject. While it sounds complex and difficult to use, pdfmeld really isn't. You'll quickly find that you'll only use a handful of the options regularly, and you can forget about the rest.

pdfmeld doesn't just combine PDF files. You can use it extract pages from a PDF file, rearrange the pages in a file, rotate pages, and even touch up text. In fact, pdfmeld packs many of the features of Adobe Acrobat in a package that weighs in at just over 1 MB.

pdfmeld's range of options are its greatest strength. But they come at a price, albeit a small one -- $9.95. Like joinPDF, pdfmeld automatically compresses the resulting file. It's also very fast: it only took a few seconds to mash three 20-page PDF files together on my old 300MHz Linux box.

I found very little wrong with pdfmeld. One problem that I did encounter, that I didn't see with Ghostscript or joinPDF, was the error message "Page Contents Object has Wrong Type" when I tried to open a merged PDF file in Acrobat Reader. This happens when an empty page contains contents information. This only happened twice, when I added a cover followed by a blank page to a particular document.

Other tools

These three applications aren't your only choices. Some of the other tools available for merging PDF files include pfdtk, Multivalent, and pdcat. I briefly looked at pdftk and Multivalent (pdcat is a commercial product), and found them to be solid applications.

So, which utility comes out on top? Just for its sheer number of features, you should give pdfmeld a serious look. While some people might balk at dropping $9.95 for software that does pretty much the same thing that Ghostscript does, I think the price is well worth it. Of course, being a long-time Ghostscript user I still have a soft spot for it. But typing those long strings of options really wears me down after a while. And joinPDF is perfect if you want to get the job done quickly and easily.

If you're adamant about using only free software, then go with Ghostscript or joinPDF. But if you can afford to drop 10 bucks, you'll find that pdfmeld is a great little application that can handle all of your PDF merging needs and then some.

Scott Nesbitt is a Toronto, Canada-based writer and the Toronto managing editor for the ScalableAir Network.

Monday, March 8, 2010

Linux DHCP client (dhclient) to renew ip address

Linux renew ip command

The -r flag explicitly releases the current lease, and once the lease has been released, the client exits. For example, open terminal and type the command:
$ sudo dhclient -r
Now obtain fresh IP:
$ sudo dhclient

There is no need to restart network service. Above command should work with any Linux distro such as RHEL, Fedora, CentOS, Ubuntu and others. On a related note you can also try out the following commands:
# ifdown eth0
# ifup eth0
# /etc/init.d/network restart

OR
# /etc/init.d/networking restart

Featured Articles:

Saturday, March 6, 2010

How to enable shared folder in virtualbox

Host is window Vista and Ubuntu 8.04 is the guest.

Although Virtual Box provided an option of shared folder, it is not straightforward to use this shared folder. It took me some searches on VirtualBox forum to find it how Ubuntu guest OS can access the shared Folder on WinXP host OS.

1. Add folder(s) to shared folder menu.

It is important to write down the folder names at this step.

2. Boot guest system, open a terminal and type in the following commands

sudo mkdir /mnt/tao_xp

sudo mount.vboxsf TAO /mnt/tao_xp

The shared folder would be accessible now: read & write!

Reference:

[1] http://forums.virtualbox.org/viewtopic.php?t=3201&highlight=share+folder

[2] http://virtualdebian.blogspot.com/2007/12/sharing-folders-with-virtualbox.html

VMware 6.5 For Ubuntu 9.10

VMware workstation 6.5.3 is supported only on Ubuntu Jaunty 9.04 and backwards. With this brief tutorial we’ll have a look on how to install it also on Ubuntu Karmic 9.10. By default the installer would freeze at the “Configuring…” stage, never actually completing.

1) The first step consists in installing the program via terminal and suppressing the warnings otherwise eventually stucking the installer. BitOBear has provided a more in depth explanation of what’s behind the scenes for the installer to stop.

NOTE: I’m considering the 32bit build, if you use the x64 bit build simply replace i386 with x86_64

chmod u+x VMware-Workstation-6.5.3-185404.i386.bundle
while true; do sudo killall -9 vmware-modconfig-console; sleep 1; done

in a separate terminal run:

sudo ./VMware-Workstation-6.5.3-185404.i386.bundle --ignore-errors

when the installer has finished, terminate the previous command (while true…) with a CTRL+C or simply close the terminal window.

vmware-modconfig --console --install-all

BitOBear adds the following tips:

a) Once you have a hung installer session you have to kill the python command that is running the installer. Think of that as a step-0 if it comes up.

b) If the installer still hangs, the kill loop may not be fast enough; start over but leave the ’sleep 1;’ out of the kill loop. It will slow down the install even more, but it is more likely to catch the command in time.

2) The setup step has completed. However you would have to face a few usability issues:

a) The mouse automatically ungrabs outside an area of 640 x 480 (vga resolution)

edit file

/etc/vmware/bootstrap

add at the bottom

VMWARE_USE_SHIPPED_GTK=force

b) If you cannot use any more modifier keys (CTRL ALT SHIFT INS etc.) first check if you have a residual fix from previous setups which is no more needed now. (If this is the first time you install VMware you can skip this step).

Notice, however, that randomly you could still lose modifier keys, typing in any terminal or ALT+F2 field setxkbmap restores them. Furthermore the xkeymap.nokeycodeMap = true is still needed if you are willing to install VMware Workstation 7 beta.

edit file

$HOME/.vmware/config

ensure the following text is not present or commented out with a #

xkeymap.nokeycodeMap = true

as an alternative temporary fix you can simply type

setxkbmap

in any terminal window. This would resume the modifier keys function.