Configure Fedora 12 Virtual Machine on Xen

After installing a Xen VM by following instructions of "Setting Up Stable Xen DomU with Fedora: Unmodified Fedora 12 on top of Xenified Fedora 12 Dom0 with Xen", the following steps summarize the rest configuration of the VM.

1. Configure your VM network connection:
a) change "IPADDR" field and comment "HWADDR" field in ifcfg-eth0
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
# service network restart
b) load your network configuration for boot
# chkconfig network on

2. Congfiure your VM firewall:
# iptables -F
Or # iptables -t nat F
# service iptables save

3. Install essential packages for your VM:
# yum install make
# yum install gcc
# yum install vim
# yum install wget
# yum install openssh-clients

4. In your gateway, configure port forwarding to your VM:
# cp /etc/sysconfig/iptables /etc/sysconfig/iptables_$(date +%y%m%d)
# iptables -t nat -A PREROUTING -d -p tcp -m tcp --dport 'forward_port_no' -j DNAT --to 'vm_ip':22
# service iptables save

5. (Optional) Attach more disk storage to your VM:
# lvcreate -L 'disk-capacity (in MiB)' -n 'virtual-partition' 'phyiscal-partition'

6. (Optional) Create logical partitions for the attached disk after startup:
# fdisk 'physical-partition'

7. (Optional) Mount the attached disk after startup:
# mount 'logical-partition' 'mounted-directory'

8. (Optional) Configure the routing:
# route add default gw 'gateway-ip' dev 'net-interface'
# route add -net 'subnet-ip' netmask 'netmask' dev 'net-interface'