Tag Archive: server


As you can proberbly tell from my other blog posts I really do like Ubuntu although I also admire CentOS/Redhat but for sheer simplicity and non-bloat installation I do like this awesome distrubution.

Ok so nowadays more and more people have more than one PC or network device at home and therefore it would be benefical to setup a shared storage device (A home file server basically)… So this is what I’m going to run through…

Firstly let me say that this is a very basic file server that can be accessed from pretty much all operating systems… eg. Microsoft Windows, Linux, UNIX, MacOSX and even XBox’s etc….

In this tutorial we’ll setup a single shared folder on a Ubuntu Server, the shared folder will not require any username or password to access it (its a home network after all!) If you wanted to add more security or more advanced features to your File (and even Print) server check out this page from the Ubuntu Server Guide: https://help.ubuntu.com/10.04/serverguide/C/samba-fileprint-security.html

Lets begin…

If you don’t already have Ubuntu Server installed, grab the ISO from the Ubuntu website, burn it to a CD and then install it on an PC. (this is very easy indeed!)

Login to your newly installed server as the ‘root‘ user and now we will install samba as follows:-

apt-get install samba

Thats all there is to it really, so now we can get streight on with configuring Samba….

The main Samba configuration file is located in /etc/samba/smb.conf . The default configuration file has a significant amount of comments in order to document various configuration directives.

Firstly, edit the following key/value pairs in the [global] section of /etc/samba/smb.conf:

workgroup = EXAMPLE

security = user

The securityparameter is farther down in the [global] section, and is commented by default. Also, change EXAMPLE to better match your environment.

Create a new section at the bottom of the file, or uncomment one of the examples, for the directory to be shared:

[shared]
comment = Ubuntu File Server Share
path = /srv/samba/share
browsable = yes
guest ok = yes
read only = no
create mask = 0755

  • comment: a short description of the share. Adjust to fit your needs.
  • path: the path to the directory to share. This example uses /srv/samba/sharename,Technically Samba shares can be placed anywhere on the filesystem as long as the permissions are correct, but adhering to standards is recommended.
  • browsable: enables Windows clients to browse the shared directory using Windows Explorer.
  • guest ok: allows clients to connect to the share without supplying a password.
  • read only: determines if the share is read only or if write privileges are granted. Write privileges are allowed only when the value is no, as is seen in this example. If the value is yes, then access to the share is read only.
  • create mask: determines the permissions new files will have when created.

Now that Samba is configured, the directory needs to be created and the permissions changed. Enter the following:

sudo mkdir -p /srv/samba/share
sudo chown nobody.nogroup /srv/samba/share/

The -p switch tells mkdir to create the entire directory tree if it doesn’t exist. Change the share name to fit your environment.

Finally, restart the samba services to enable the new configuration:

/etc/init.d/samba restart

From a Windows client you should now be able to browse to the Ubuntu file server and see the shared directory. To check that everything is working try creating a directory from Windows.

To create additional shares simply create new [dir] sections in /etc/samba/smb.conf, and restart Samba. Just make sure that the directory you want to share actually exists and the permissions are correct.

I hope this helps, you make find the following links of interest if you want to further build on your new file server:-

  1. The Official Samba ‘Howto’ collection.
  2. The Ubuntu Samba Community Wiki page.

Ok well today I’m going to outline how I managed to install VMWare Server 2 on my Quad core Xeon 3.2GHz rack server running Ubuntu Server 10.04 as the host operating system…

In the past I have used VMWare Server on Microsof t Windows based operating systems but in all truth I would much prefer to run VMWare Server on a smaller footprint, In the past I tried installing VMWare ESXi as a baremetal hypervisor but the server’s hardware was not supported so the next best thing…. I managed to install VMWare Server 2.0.2 on Ubuntu 10.04 which after installation was reporting only 104MB of RAM used which I think it pretty damn good!

So I thought I’d share with you what I did….

You may already be aware that VMWare Server 2 is NOT officially supported on Ubuntu so we have to patch the source before compiling but don’t worry, with the instructions below its all very easy :)

So lets begin….

Firstly you’ll need to obtain (if you don’t already have it) the Ubuntu 10.04 server installation disk from the Ubuntu website, install it and configure it with a static IP address…

Next up, log in to the server (as Root) and follow these simple steps:-

Create a directory in /root named ‘vm’ this will be used to temporarily storing the VMWare package prior to installation:-

mkdir /root/vm
cd /root/vm

To download VMware, you need to register at: https://www.vmware.com/tryvmware/?p=server20&lp=1. They (VMWare) will send you an email. Follow the instructions in the email, and download and save VMware-server-2.0.2-203138.i386.tar.gz in /root/vm and remember to write down the key for VMware Server for Linux (looks like: XXXXX-XXXXX-XXXXX-XXXXX).

Now we need to ‘Untar’ the downloaded package as follows:-

tar -xzf VMware-server-2.0.2-203138.i386.tar.gz

So before we install VMWare Server we must patch it, for now, lets create another and changin into the folder:-

mkdir /root/dev
cd /root/dev

Lets download the patch files using the commands below:-

wget http://ballen.co.uk/scripts/2.6.32-22/00-vmware-2.6.32_functional.diff.txt
wget http://ballen.co.uk/scripts/2.6.32-22/02-vmnet-include.diff.txt.gz
wget http://ballen.co.uk/scripts/2.6.32-22/01-vmware-2.6.32_cosmetic.diff.txt
wget http://ballen.co.uk/scripts/2.6.32-22/vmware-config.pl.diff.txt
wget http://ballen.co.uk/scripts/2.6.32-22/patch-vmware_2.6.3x.sh.txt

Note:- The above files where mirrored on my personal server from: http://nerdbynature.de/bits/2.6.32-22/

Unzip the following file:

gunzip 02-vmnet-include.diff.txt.gz

Change the names of the five files:

mv 00-vmware-2.6.32_functional.diff.txt 00-vmware-2.6.32_functional.diff
mv 01-vmware-2.6.32_cosmetic.diff.txt 01-vmware-2.6.32_cosmetic.diff
mv 02-vmnet-include.diff.txt 02-vmnet-include.diff
mv patch-vmware_2.6.3x.sh.txt patch-vmware_2.6.3x.sh
mv vmware-config.pl.diff.txt vmware-config.pl.diff

Edit the file patch-vmware_2.6.3x.sh:

nano patch-vmware_2.6.3x.sh

Delete everything and replace with:

#!/bin/sh
#
# (C) 2010 lists@nerdbynature.de
#
# 00-vmware-2.6.32_functional.diff
# – based on vmware-server-modules-linux-2.6.32.patch
# – see http://communities.vmware.com/message/1389232#1389232
#
# 01-vmware-2.6.32_cosmetic.diff
# – based on rbihlmeyer’s comments in http://communities.vmware.com/thread/232842
#
# 02-vmnet-include.diff
# – stuff .h and .c files in separate directories, as the other
# modules do it
#
# vmware-config.pl.diff
# – based on http://communities.vmware.com/message/1398525#1398525
#
DIR=/root/dev/
PATCHES=”00-vmware-2.6.32_functional.diff 01-vmware-2.6.32_cosmetic.diff 02-vmnet-include.diff”

# unset me!
# DEBUG=echo

if [ -z "$1" -o ! "`ls "$1"/*tar 2>/dev/null | wc -l`" = 4 ]; then
echo “Usage: `basename $0` [vmware-modules-source directory]”
exit 1
else
SRC=”$1″
fi

cd $SRC
$DEBUG mkdir orig || exit 1
$DEBUG mv *tar orig/

# untar
for t in orig/*.tar; do
$DEBUG tar -xf $t
done

# patch
for p in $PATCHES; do
$DEBUG patch -p1 < “$DIR”/”$p”
done

# tar
for d in *-only; do
$DEBUG tar -cf `echo $d | sed ‘s/-only/.tar/’` $d
done
$DEBUG rm -rf *-only

# vsock.ko needs symbols from vmci
$DEBUG cd ../../../bin || exit 2
if [ -x vmware-config.pl -a -f $DIR/vmware-config.pl.diff ]; then
$DEBUG patch -p0 < $DIR/vmware-config.pl.diff
fi

Save the file (CTRL+O) and quit.

Now we execute the patch process:-

chmod u+x patch-vmware_2.6.3x.sh
./patch-vmware_2.6.3x.sh /root/vm/vmware-server-distrib/lib/modules/source

And then we install VMWare Server:-

cd /root/vm/vmware-server-distrib
./vmware-install.pl

You can press ENTER to accept all default values. Accept the license. Enter the VMware Server key that VMware gave to you. That’s it. If the installation is successful, it ends like this:

Starting VMware management services:
VMware Server Host Agent (background) done
VMware Virtual Infrastructure Web Access
Starting VMware autostart virtual machines:
Virtual machines done

The configuration of VMware Server 2.0.2 build-203138 for Linux for this
running kernel completed successfully.

Housekeeping…
Thank you for using the script!
Patch provided by:
Ramon de Carvalho Valle

http://risesecurity.org

Script author:
Radu Cotescu

http://radu.cotescu.com

And then simply reboot your server using:-

shutdown -r now

Once your server is back online you should be able to access the VMWare Server web interface; type https://{your_server_ip}:8333/ (make sure you use the correct IP address!), then hit ENTER… Click Proceed anyway. – The login would be your server’s root account details eg. root/yourpassword

There is a know issue at the moment with Firefox 3.6 but Mozilla has reportedly stated this issue will be fixed in Firefox 4.0 (Expected out in November 2010) – I personally use Google Crome and have no problems what-so-ever! Internet Explorer should work fine too! – Failing that you can use VMWare’s VIC (Virtual Infrastructure client) to connect to and manage the server.

I would like to note that the patch files where kindly provided by Nerdybynature.com and I take no praise for this work!