Category Archives: Linux

Setting up VMware Server on Linux

Instructions on how to setup VMware server on linux and access it from a windows machine.

Pre-Setup

Download VMware server rpm for Linux from http://www.vmware.com and register for a free serial number.  The current version is 1.0.3.

Setup access to the server. See Installing Cygwin for Windows XP for instructions on how to setup access to the linux server.

Installation

Log into the linux server

ssh linux01
cd /media/usbdisk/source/vmware/server/linux/1.0.3
su

Install the RPM

rpm -ivh VMware-server-1.0.3-44356.i386.rpm

Configure VMware

As root run:

/usr/bin/vmware-config.pl

Accept the End User License.
Accept the default directory for mime type icon.
Accept the default desktop menu entry files
Accept the default for application's icons
Networking for Virtual Machines: yes
Ethernet network: eth0
NAT networking: yes
Probe for private subnet: yes
Host-only network: yes
Probe for private subnet: yes
Accept default for remote console connections
Accept default direction for virtual machine files
Enter the VMware serial number you received when you downloaded vmware server.

Verify that vmware will startup when the server reboots.  As root run:

/sbin/chkconfig --list vmware
vmware          0:off   1:off   2:on    3:on    4:off   5:on    6:off

Install VMware Console on Windows

Download VMware console for windows from http://www.vmware.com

On the windows workstation install the server:

Double click on VMware-console-1.0.3-44356.exe
Accept the End User Agreement.
Accept the default installation location.

Configure the Console

Double click on the VMware Server Console icon on the windows desktop.

In the Connect to Host dialog box enter the hostname, username and password.

Creating a new linux file system

Creating a ext3 file system on a new USB disk.

Partition Table

# /sbin/fdisk /dev/sdc

The number of cylinders for this disk is set to 60801.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): d
Selected partition 1

Command (m for help): p

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
e   extended
p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-60801, default 1): 1

Last cylinder or +size or +sizeM or +sizeK (1-60801, default 60801): 
Using default value 60801

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
#

Format the new Partition

Formatted as ext3

# /sbin/mkfs -t ext3 -j /dev/sdc1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
61063168 inodes, 122096000 blocks
6104800 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=125829120
3727 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
#

Installing Java on Fedora Core 3 using JDK 1.4.2

Excellent Howto for setting up Tomcat5 from jpackage.org on RedHat Fedora Core3.

http://www.mksearch.mkdoc.org/howto/jpackage-sun-fc3/

But required JDK 1.4.2 to be used in place of 1.5

Downloaded http://mirrors.sunsite.dk/jpackage/1.6/generic/non-free/SRPMS/java-1.4.2-sun-1.4.2.07-1jpp.nosrc.rpm 

rpm -Uvh java-1.4.2-sun-1.4.2.07-1jpp.nosrc.rpm

Download the self extracting version j2dsk-1_4_2_07-linux-i586.bin from http://java.sun.com/products/archive/j2se/1.4.2_07/index.html

Moved it into /usr/src/redhat/SOURCE

cd /usr/src/redhat/SPECS

rpmbuild -ba java-1.4.2-sun.spec

Just need to install java and java-devel

cd /usr/src/redhat/RPMS/i586

rpm -Uvh –nodeps java-1.4.2-sun-1.4.2.07-1jpp.i586.rpm java-1.4.2-sun-devel-1.4.2.07-1jpp.i586.rpm

Need to use the –nodeps flag since the spec generates some dependicies that are only for Solaris.

After installing jta need to install xml-commons-apis before installing tomcat5

yum -y install xml-commons-apis

Then finally

yum -y install tomcat5 tomcat5-admin tomcat5-webapps

Setting up sshd for Public Key Authentication

To create key only authentication the users public key needs to be put on the server in their home directory under .ssh/authorizated_keys.

Create the users private key on their workstation:

# ssh-keygen -t rsa

Send the private key to the server:

# cat .ssh/id_rsa.pub | ssh newmachine “cat >> .ssh/authorized_keys”

Make sure the authorized_keys file it set to the correct permissions.

Login to the server and change the permissions.

chmod 644 .ssh/authorized_keys

Configured sshd to use the key autentication and disable password authentication

# vi /etc/ssh/sshd_config

Make sure the following lines are in the file:

PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
PasswordAuthentication no

Save the file.

Restart sshd

/etc/init.d/sshd restart

Test by connecting from the users workstation. They should be logged in right away without the need for a password. Try to login from the server, there should be an error message.

See http://open.bsdcow.net/tutorials/ssh_pubkey_auth for more information.