Installing VMWare Server on Ubuntu

Posted by John
on Tuesday, 23 September 2008

First install the pre-requisites;

sudo aptitude install linux-headers-`uname -r` build-essential
sudo aptitude install xinetd

Download VMWare Server .tar.gz file from here.

Remember to signup for a Serial Number, you'll need that during the install

Download the latest vmware-any-any-update patch here,

Now extract VMWare Server and terminal into it's directory, run,

cd vmware-server-distrib
sudo perl vmware-install.pl

When asked Before running VMware Server for the first time, you need to configure it by invoking the following command: "/usr/bin/vmware-config.pl". Do you want this program to invoke the command for you now? [yes] enter *NO* and patch VMWare with that file.

Extract the files within that patch and Terminal into it's directory,

cd vmware-any-any-update115
sudo ./runme.pl

It should prompt you to run vmware-config.pl, this time say YES and continue with the install.

Afterwards start vmware with,

vmware

You might get a load of errors like this,If you get compile errors, do this;

/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4' not found (required by /usr/lib32/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib32/libstdc++.so.6)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4' not found (required by /usr/lib32/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib32/libstdc++.so.6)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4' not found (required by /usr/lib32/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib32/libstdc++.so.6)

That's because one part of the vmware package was compiled with a different version of gcc than the one you're running now, to fix that do:

sudo cp /lib/libgcc_s.so.1 /usr/lib/vmware/lib/libgcc_s.so.1/
sudo cp /usr/lib/libpng12.so.0 /usr/lib/vmware/lib/libpng12.so.0/

Now you should be able to start VMWare Server

(tested and working on Ubuntu Hardy 8.04 64-bit)

Webcam + Ubuntu on DV2000

Posted by John
on Sunday, 11 May 2008

Setting up the built-in webcam on the HP DV2000 laptop isn't that hard, here's a quick run thru...

Dependencies

First install all the dependencies your going to need to build the drivers from source,

sudo aptitude install linux-headers-`uname -r`
sudo aptitude install build-essential subversion

This will install the GCC compiler, linux headers, etc.

Build Driver

Now in Terminal,

svn checkout svn://svn.berlios.de/linux-uvc/linux-uvc/trunk
cd trunk
sudo make
sudo make install

First you pull the Linux-UVC source from Subversion, move to that directory, compile the source the install the binaries.

Check for Webcam

Now check to see if you have any USB video devices (your webcam usually)

sudo lsusb -v

Scroll thru all the entries, one should be the webcam.

Use it

Next up we'll need some tools to use it,

sudo aptitude install ekiga cheese

Cheese is a simple webcam recorder, much like Apple's, allowing you to take a photo from your webcam and apply some neat effects to it real-time, the other is a more convential tool to use it.

Tested & Working on Ubuntu 8.04

Unix Cheat Sheet

Posted by John
on Sunday, 23 March 2008

What a find, one heck of a comprehensive Unix Cheat Sheet!

Thanks goes to Digg.com and embeemb for posting this, great work!

Accessing the Slingbox Remotely

Posted by John
on Monday, 18 February 2008

setup

One of the beauty's about the Slingbox is it's ability to stream video around your WIFI network, and more potentially accessing it remotely via some router changes.

Router Settings

So, first off log into your router with your internet browser...

http://192.168.1.1

Enter your admin username + password and get into the system.

Now first off you need to put the Slingbox into the DMZ (demilitarized zone), basically in front of the firewall so that you can connect to it remotely in cyberspace.

So with a belkin router, click [firewall], then [dmz]

Now add a static ip entry for your slingbox, like...

public ip : 82.23.44.92
static ip : 192.168.1.237

So in the first line of the DMZ screen it will show your router's currently assigned IP address, on the right it will list static ip's assigned to devices within your network that you want out in the open.

Because the Slingbox uses the default IP of 192.168.1.237, we set the first line to : 192.168.1.237 or 237

Hit save, now you need to setup a port for the slingbox.

So click [firewall], then [virtual servers]

Now add an entry for your slingbox's internal port.

lan ip address: 192.168.1.237
protocol type: TCP
lan port: 5001
public port: 5001
enable: tick this

make sure the entries are correct and you've ticked [enable], click [set] and you're done!

Your Slingbox is now available online.

So open your slingbox software, click [get info] and tick [access remotely], enter your router's ip address (from the DMZ screen, public ip or in this case 82.23.44.92) and the port 5001, click [save] and sit back and watch TV from your slingbox anywhere in the world.

Further Note

You can also apply this to other devices such as if you are like me and buy an ICYBOX NAS enclosure with a BitTorrent tool in it, by putting it in the DMZ it then has free access to the internet and you can load up torrent files into it and leave it to download them for you.

Nothing illegal mind, for me it's Fedora 9.

;-)

Take care,

Beginning NGINX

Posted by John
on Wednesday, 06 February 2008

In this series of articles I'll explain how to install and setup the super light and fast NGINX webserver on your Linux box and get it to host rails apps and maybe a little extra.

First off let's install NGINX

To install the latest copy of NGINX you're gonna need to build from source so make sure you install the build-essentials (gcc), to do this run...

sudo aptitude install build-essential

Now you've got the GCC compiler installed you can build from source, so let's download the latest copy of NGINX...

First some dependencies,

sudo aptitude install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev

Now the bad boy himself,

cd ~/sources/
wget http://sysoev.ru/nginx/nginx-0.5.35.tar.gz
tar -zxvf nginx-0.5.35.tar.gz
cd nginx-0.5.35/

now configure the source,

./configure --sbin-path=/usr/local/sbin --with-http_ssl_module

it'll finish with a summary of locations like,

nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/sbin"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"

write these down before you continue, very important!

now build,

make

and install

sudo make install

Running NGINX

As those last summary lines told us, nginx lives in -> /usr/local/sbin/nginx, so let's go start it,

sudo /usr/local/sbin/nginx

now if you navigate to your boxes ip address you should see a fancy 'welcome to nginx' message, wahey! you have it installed.

Final part, startup scripts

Now the next script I'm very thankful for PickledOnion over at Slicehost.com for providing.

First off let's create an init script so we can start it more nicely and NGINX will start on reboot, so...

sudo nano /etc/init.d/nginx

And now copy & paste this init script into nano...

#! /bin/sh

### BEGIN INIT INFO
# Provides:          nginx
# Required-Start:    $all
# Required-Stop:     $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts the nginx web server
# Description:       starts nginx using start-stop-daemon
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/sbin/nginx
NAME=nginx
DESC=nginx

test -x $DAEMON || exit 0

# Include nginx defaults if available
if [ -f /etc/default/nginx ] ; then
        . /etc/default/nginx
fi

set -e

case "$1" in
  start)
        echo -n "Starting $DESC: "
        start-stop-daemon --start --quiet --pidfile /usr/local/nginx/logs/$NAME.pid \
                --exec $DAEMON -- $DAEMON_OPTS
        echo "$NAME."
        ;;
  stop)
        echo -n "Stopping $DESC: "
        start-stop-daemon --stop --quiet --pidfile /usr/local/nginx/logs/$NAME.pid \
                --exec $DAEMON
        echo "$NAME."
        ;;
  restart|force-reload)
        echo -n "Restarting $DESC: "
        start-stop-daemon --stop --quiet --pidfile \
                /usr/local/nginx/logs/$NAME.pid --exec $DAEMON
        sleep 1
        start-stop-daemon --start --quiet --pidfile \
                /usr/local/nginx/logs/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
        echo "$NAME."
        ;;
  reload)
          echo -n "Reloading $DESC configuration: "
          start-stop-daemon --stop --signal HUP --quiet --pidfile     /usr/local/nginx/logs/$NAME.pid \
              --exec $DAEMON 
          echo "$NAME."
          ;;
      *)
            N=/etc/init.d/$NAME
            echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
            exit 1   
            ;;
    esac

    exit 0

Yes it's a monster, I've copied it over to my server so you can grab it at..

Now lets use it with...

sudo chmod +x /etc/init.d/nginx
sudo /usr/sbin/update-rc.d -f nginx defaults

You should now see...

Adding system startup for /etc/init.d/nginx ...
   /etc/rc0.d/K20nginx -> ../init.d/nginx
   /etc/rc1.d/K20nginx -> ../init.d/nginx
   /etc/rc6.d/K20nginx -> ../init.d/nginx
   /etc/rc2.d/S20nginx -> ../init.d/nginx
   /etc/rc3.d/S20nginx -> ../init.d/nginx
   /etc/rc4.d/S20nginx -> ../init.d/nginx
   /etc/rc5.d/S20nginx -> ../init.d/nginx

Now NGINX will startup on reboot and you can run these commands to control it better.

Start

sudo /etc/init.d/nginx start

Stop

sudo /etc/init.d/nginx stop

Restart

sudo /etc/init.d/nginx restart

Next up i'll put together the nginx scripts I use myself which should help you out a lot when hosting your site with this great tool.

Final Note

On a later note you may get times when you change your NGINX .conf scripts restart NGINX and it doesn't seem to have taken your latest config changes, I get this myself sometimes.

What you can do is brute-force kill the NGINX process and restart it with...

ps aux | grep nginx

which will return the process id NGINX is running at, then kill it with...

kill [processid]

and now start NGINX from fresh,

sudo /etc/init.d/nginx start

.Conf Templates

For your info and more so the guys who have working NGINX setups, I've put example config files in my downloads area, with direct links here....