Setting up dom0 as a nfs server

This is a bad idea, using the dom0 as a nfs server does not work as the Oracle VM manager agent will mount the repositories on the dom0. And mounting a nfs partition on itself is not working. I will explain the exact setup later;

 

After setting up OVS, I wanted to install some software in one of my guest (11g database). But I didn't have any access to shares/mounts with all the ISO's and software trees in Dom0 from my guests! The first solution is to actually copy (scp) the software from Dom0 to the guest. This ofcourse works, but is tedious and as again unnecessary.
Why not expose the mountpoints to my guests with NFS! We need to setup Dom0 as an NFS server and the guest as clients.

NFS Server configuration
What to make available through NFS:

create the file: /etc/exports
format: directory client-ip(options)
directory=Which directory to export
client-ip=hostname/range,ip-address/range
(options)
-ro=readonly for client
-rw=read/write for client
-no_root_squash=client as root gets root access to nfs aswell, instead of as nobody
-sync

example
/OVS/remote *.vanesch.nl(rw,sync,no_root_squash)
/mnt/share/software *.vanesch.nl(ro,sync)

How to make NFS available
We need to activate two services: portmapper and nfs(which start several daemons)

service nfs start
service portmap start

Let's make sure these services are started across reboots:
chkconfig --level 35 nfs on
chkconfig --level 35 portmap on
NFS client configuration

What to have availableWe need to edit: /etc/fstab
format: source mountpoint nsf options 0 0
Options: rw,bg,intr,hard,timeo=600,wsize=32768,rsize=32768,nfsvers=3,tcp

I will add both exports from my NFS Server (dom0.vanesch.nl) to this guest:

dom0.vanesch.nl:/OVS/remote /mnt/nfs nfs rw,bg,intr,hard,timeo=600,wsize=32768,rsize=32768,nfsvers=3,tcp 0 0

dom0.vanesch.nl:/mnt/share/software /mnt/software nfs ro,bg,intr,hard,timeo=600,wsize=32768,rsize=32768,nfsvers=3,tcp 0 0

How to make NFS available
Again we need to start the same two services

service nfs start
service portmap start

Let's make sure these services are started across reboots:
chkconfig --level 35 nfs on
chkconfig --level 35 portmap on

One other thing is important! Turn off the firewalls in Dom0 and your guests.

service iptables stop
chkconfig iptables off

Now you can run installations (or mount ISO's) from your NFS shares.