Gutsy host 1 and Gutsy host 2 virtual machines have an iso file within /home/user which provides the Ubuntu packages DVD. To use these installable software packages this file has to be mounted in loopback mode as if it were a real DVD as opposed to a file image of one.
We will be examining how to mount this DVD image, how to install packages within it using the Ubuntu packaging system, and how to install filesharing NFS clients and servers to network these 2 virtual machine instances together.
On both client and server as root:
sudo bash
Careful when using root commands ! Always think about whether you need to be administrator or a user to do something and use the minimum permissions needed. The sudo bash command launches a root shell.
mkdir /mnt/cdrom
mount -o loop CDIMAGE.iso /mnt/cdrom
Using a text editor of your choice, Add the following line at the top of /etc/apt/sources.list so the software packaging system tools can find this new software source. You will need root permission to edit this file:
deb file:/mnt/cdrom gutsy main restricted
Then to register this source use the command:
aptitude update
aptitude install nfs-kernel-server
mkdir /home/shared
add line to file /etc/exports:
/home/shared 192.168.0.2(rw,sync)
exportfs -a
Does the NFS server need to be restarted before it picks up the new export ? On Linux services can be restarted using scripts in the /etc/init.d directory without needing a reboot. Create a file under /home/shared and then
chown -R user.user /home/shared
in order to change ownership to user
aptitude install nfs-common
mkdir /mnt/shared
The first time for testing:
mount -t nfs 192.168.0.1:/home/shared /mnt/shared
Then permanently: add line to /etc/fstab
192.168.0.1:/home/shared /mnt/shared nfs rw
/etc/fstab causes entries to be mounted at boot time
Finally test you can add files on the server to the shared area and that these are visible on the client.