Sunday, November 16, 2008

Installing Ubuntu in VMWare

Ubuntu version: 8.10
VMWare Workstation 6

Download Ubuntu from http://www.ubuntu.com/getubuntu/download/
Burn ISO image (i.e. using free open source InfraRecorder from http://infrarecorder.org/)
Install VMWare and create virtual machine (I allocated maximum of 10 Gb in 2 Gb chunks and allowed expansion on demand since I am not expecting high performance)
Power on the created VM and install Linux as usual
Install VMWare Tools on Windows by selecting it from VM menu
Install the Linux VMWare tool package. Refer to: http://www.howtogeek.com/howto/ubuntu/install-vmware-tools-on-ubuntu-edgy-eft/

Problems with network interface
Symptoms: no connection to internet. Ipconfig command does not exist, eth0 interface does not exist (System->Administration->Network Tools shows only loopback interface)

From Windows:
run ipconfig /all to see VM interfaces. For me one was a direct bridge and another one for NAT.

From Ubuntu:
Run ping www.ubuntu.com. This ping test replied for me, so it's not too bad
System-> Preferences->Network Connections: I tried adding wired connection and editing the IP, mask and gateway for interfaces from "ipconfig /all" run above.
I don't know whether this have helped, but after restart, eth0 interface appeared under wired connections. My VM was connected.

VMWare Player
After the VMWare's trial period ends, I will install the pre-packaged version of Ubuntu (VMWare Ubuntu Appliance), which can be run from the free VMWare player.
Ubuntu 8.10 from Sisoracle: http://www.visoracle.com/vm/ubuntu810/
Ubuntu 8.10 from Tuxdistro: http://www.tuxdistro.com/torrents-details.php?id=1339
VMWare Player: http://www.vmware.com/download/player/

File access between Windows and Linux
With VMWare Desktop and installed VMWare tools, copying text and files is as easy as drag and dropping. When using free VMWare Player, tools like Samba and WinSCP will be required. The following guide explains the whole installation process including tricks with VMWare Player, accessing Ubuntu's command line via Puttu from Windows and zipping the VM onto usb key. http://www.tanguay.info/web/tutorial.php?idCode=installUbuntuOnVmware

Installing CVS under Ubuntu 8.10

My experience installing CVS server on Ubuntu 8.10 Desktop
CVS version: 1.12.13
CVSD version: 1.0.15

Quick reference:

##########################################################################
# Installation
##########################################################################
# Install CVS
sudo apt-get install cvs

# Alternative install (RPM to DEB)
# Go to: ftp://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-linux/RPMS/i386/
# Download the latest RPM, save to ~/Desktop/
# Convert to DEB and install
# Summary of instructions from: http://ubuntu.wordpress.com/2005/09/23/installing-using-an-rpm-file/
#sudo apt-get update
#sudo apt-get install alien
#sudo alien -k name-of-rpm-file.rpm
#sudo dpkg -i name-of-deb-file.deb

# To remove CVS
#apt-get remove --purge cvsd

# Install CVS server
sudo apt-get install cvsd

##########################################################################
# Server Setup
##########################################################################
# Create root for repository
sudo cvsd-buildroot /usr/local/cvsroot/

# Create cvs group
groupadd cvs

# Give cvs group the ownership of the repository
sudo chown -R root:cvs /usr/local/cvsroot

# Set permissions so that the files created by the group remain
# in its ownership
# Note: until this command was run I could not execute the init
# due to permission problems
sudo chmod -R g+srw /usr/local/cvsroot/

# Initialize repository (creates empty repository in the root)
# /usr/local/cvsroot/CVSROOT/ admin folder will be created
cvs -d /usr/local/cvsroot init

# Add users to to cvs group.
# Note: to add user using gui, run sudo users-admin or
# access Users and Groups via System->Administration.
# Unclock the changes, modify the group and check desired users
sudo usermod -G cvs lomtik

##########################################################################
# Initial check in, check out, commit and release
# Eg project: ~/work/sample_project/ has file hello.c
##########################################################################
# Add CVSROOT environment variable
# In sh/bash, add the following lines to .profile/.bashrc:
CVSROOT=/usr/local/cvsroot
export CVSROOT
# In csh/tcl, add the following lines to .cshrc/.tcshrc:
#setenv CVSROOT /usr/local/cvsroot

# First check in
# Check in files from the current directory to sample_project folder
# with vendor lomtik and initialtag sample_proj_v_1_0
cd ~/work/sample_project/
# Note new directory: /usr/local/cvsroot/sample_project
cvs import -m "initial check in" sample_project lomtik sample_proj_v_1_0

# Move files from current directory to a temporary folderand check out
# their version from the repository
mv ~/work/sample_project/hello.c ~/work/temp/
cvs checkout sample_project

#
# Modify hello.c
#

# Commit/Check in the changes
cvs commit -m "Added changes to the file" hello.c

# Release the module
# After commit, the changes are synched with the vault. However,
# cvs does not lock the local files. Thus, either manually delete
# files or run release command to let cvs to check whether something
# has been changed since the last commit.
# Note: run from above dir
# Note: -d deletes the file
cd..
cvs release -d hello.c

##########################################################################
# Revisions
# http://ximbiot.com/cvs/manual/cvs-1.11.23/cvs_4.html#SEC44
##########################################################################

##########################################################################
# Notes
##########################################################################
# Repository directories relative to repository look can be found in:
# /etc/cvsd/cvsd.conf
# i.e. Repos /cvsrepo
# Repos /demo

# Things to look at:
# jCVS - GUI
# VC package for emacs

# CVS Space usage:
# 3 x single repository size or
# num_developers x single repository size

# Ideas:
# Setup VM with repository (can use pre-built images)
# Use free VM Player on any system for portability

# Rereferences:
# CVS Manual: http://ximbiot.com/cvs/manual/cvs-1.11.23/cvs_toc.html#SEC_Contents
# Quick Ubuntu, but incomplete: http://www.markcasimer.com/2006/06/12/InstallingCVSOnUbuntu.aspx
# Quick Ubuntu, missing details and group permission setup: http://sanatio.blogspot.com/2005/12/cvs-server-on-ubuntu.html
# Good guide, not for Ubuntu: http://rimuhosting.com/howto/cvs.jsp
# CVS RPMs: ftp://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-linux/RPMS/i386/
# Installing from RPM: http://ubuntu.wordpress.com/2005/09/23/installing-using-an-rpm-file/