Difference between revisions of "Vnx-rootfsfedora"
(→Configuration) |
|||
Line 6: | Line 6: | ||
<ul> | <ul> | ||
<li>Create the filesystem disk image:</li> | <li>Create the filesystem disk image:</li> | ||
− | qemu-img create -f qcow2 | + | qemu-img create -f qcow2 vnx_rootfs_fedora-base.qcow2 5GB |
<li>Get Fedora installation DVD (use the complete DVD; do not use the Live version, as it seems the installation wizard does not include the customization menu). For example:</li> | <li>Get Fedora installation DVD (use the complete DVD; do not use the Live version, as it seems the installation wizard does not include the customization menu). For example:</li> | ||
wget ftp://ftp.rediris.es/mirror/fedora/14/Fedora/i386/iso/Fedora-14-i386-DVD.iso | wget ftp://ftp.rediris.es/mirror/fedora/14/Fedora/i386/iso/Fedora-14-i386-DVD.iso | ||
cp Fedora-14-i386-DVD.iso /almacen/iso | cp Fedora-14-i386-DVD.iso /almacen/iso | ||
− | <li>Create a libvirt XML definition ( | + | <li>Create a libvirt XML definition (rootfs_freebsd.xml) containing the virtual machine description:</li> |
<pre> | <pre> | ||
<domain type='kvm'> | <domain type='kvm'> | ||
Line 30: | Line 30: | ||
<emulator>/usr/bin/kvm</emulator> | <emulator>/usr/bin/kvm</emulator> | ||
<disk type='file' device='disk'> | <disk type='file' device='disk'> | ||
− | <source file='/usr/share/vnx/filesystems/ | + | <source file='/usr/share/vnx/filesystems/vnx_rootfs_fedora-base.qcow2'/> |
<target dev='hda'/> | <target dev='hda'/> | ||
</disk> | </disk> | ||
Line 53: | Line 53: | ||
<li>Start the virtual machine with and access its console with:</li> | <li>Start the virtual machine with and access its console with:</li> | ||
− | virsh create | + | virsh create rootfs_fedora.xml |
virt-viewer Fedora | virt-viewer Fedora | ||
<li>Follow Fedora installation menus to install:</li> | <li>Follow Fedora installation menus to install:</li> | ||
Line 60: | Line 60: | ||
<li>One of the other options (e.g "web server", "desktop system", etc) if you want a system with graphical user interface</li> | <li>One of the other options (e.g "web server", "desktop system", etc) if you want a system with graphical user interface</li> | ||
</ul> | </ul> | ||
− | <li>Once installation is finished, stop the machine, edit | + | <li>Once installation is finished, stop the machine, edit rootfs_fedora.xml file and comment the following line in cdrom disk specification:</li> |
<!--source file='/almacen/iso/Fedora-14-i386-DVD.iso'/--> | <!--source file='/almacen/iso/Fedora-14-i386-DVD.iso'/--> | ||
<li>Start the virtual machine again with:</li> | <li>Start the virtual machine again with:</li> | ||
− | virsh create | + | virsh create rootfs_fedora.xml |
virt-viewer Fedora | virt-viewer Fedora | ||
</ul> | </ul> | ||
Line 105: | Line 105: | ||
chkconfig iptables off | chkconfig iptables off | ||
</ul> | </ul> | ||
− | <li>Create a file /etc/ | + | <li>Create a file /etc/vnx_rootfs_version to store version number and informacion about modification:</li> |
<pre> | <pre> | ||
VER=v0.21 | VER=v0.21 | ||
Line 123: | Line 123: | ||
rm -f /etc/udev/rules.d/70-persistent-net.rules | rm -f /etc/udev/rules.d/70-persistent-net.rules | ||
while true; do | while true; do | ||
− | # Ask for a message to save in /etc/ | + | # Ask for a message to save in /etc/vnx_rootfs_version file |
− | echo "** Save a log message in /etc/ | + | echo "** Save a log message in /etc/vnx_rootfs_version file " |
echo -n "** describing the modifications done? " | echo -n "** describing the modifications done? " | ||
read -n 1 -p "[y/n] " answer | read -n 1 -p "[y/n] " answer | ||
Line 133: | Line 133: | ||
read logmsg | read logmsg | ||
DATE=`date` | DATE=`date` | ||
− | echo "MODDATE=$DATE" >> /etc/ | + | echo "MODDATE=$DATE" >> /etc/vnx_rootfs_version |
− | echo "MODDESC=$logmsg" >> /etc/ | + | echo "MODDESC=$logmsg" >> /etc/vnx_rootfs_version |
break;; | break;; | ||
[Nn]* ) break;; | [Nn]* ) break;; | ||
Line 153: | Line 153: | ||
To install additional software or modify your root filesystem, you just have to start it as described above and make the operations required on the filesystem. | To install additional software or modify your root filesystem, you just have to start it as described above and make the operations required on the filesystem. | ||
* Start the virtual machine (directly using virsh or the vnx_modify_rootfs utility): | * Start the virtual machine (directly using virsh or the vnx_modify_rootfs utility): | ||
− | /usr/share/vnx/bin/vnx_modify_rootfs | + | /usr/share/vnx/bin/vnx_modify_rootfs rootfs_fedora.xml |
* Install the software: | * Install the software: | ||
yum install ... | yum install ... |
Revision as of 13:39, 27 July 2011
How to create a Fedora root filesystem for VNX
Follow this procedure to create a fedora based root filesystem for VNX. The procedure has been tested with Fedora 14.
Basic installation
- Create the filesystem disk image:
qemu-img create -f qcow2 vnx_rootfs_fedora-base.qcow2 5GB
wget ftp://ftp.rediris.es/mirror/fedora/14/Fedora/i386/iso/Fedora-14-i386-DVD.iso cp Fedora-14-i386-DVD.iso /almacen/iso
<domain type='kvm'> <name>Fedora</name> <memory>524288</memory> <vcpu>1</vcpu> <os> <type arch="i686">hvm</type> <boot dev='hd'/> <boot dev='cdrom'/> </os> <features> <pae/> <acpi/> <apic/> </features> <clock sync="localtime"/> <devices> <emulator>/usr/bin/kvm</emulator> <disk type='file' device='disk'> <source file='/usr/share/vnx/filesystems/vnx_rootfs_fedora-base.qcow2'/> <target dev='hda'/> </disk> <disk type='file' device='cdrom'> <source file='/almacen/iso/Fedora-14-i386-DVD.iso'/> <target dev='hdb'/> </disk> <interface type='network'> <source network='default'/> </interface> <serial type="pty"> <target port="1"/> </serial> <console type="pty"> <target port="1"/> </console> <graphics type='vnc'/> </devices> </domain>
Note: change "source file=" lines to whatever fits your case (use full paths).
virsh create rootfs_fedora.xml virt-viewer Fedora
- A "minimal" system, if you want a server rootfs without user interface
- One of the other options (e.g "web server", "desktop system", etc) if you want a system with graphical user interface
virsh create rootfs_fedora.xml virt-viewer Fedora
Configuration
- Update the system and install additional packages
yum update yum install perl perl-XML-DOM acpid udisks
Note: if yum fails, check that the network is working. Maybe you will have to manually execute "dhclient eth0", at least in the case of a minimal installation.
- From the host execute:
/usr/share/vnx/bin/vnx_update_aced Fedora /usr/share/vnx/aced/vnx-aced-lf-0.1b.tgz
ln -s /media/CDROM /media/cdrom udisks --mount /dev/sr0 perl /media/cdrom/install_vnxaced
#This service maintains a getty on /dev/ttyS0. start on stopped rc RUNLEVEL=[2345] stop on starting runlevel [016] respawn exec /sbin/agetty /dev/ttyS0 9600 vt100-nav
echo "ttyS0" >> /etc/securetty
chkconfig --level 3 network on
- Install other services needed, for example, an apache server:
yum install httpd update-rc.d -f apache2 remove # to avoid automatic start
yum install telnet wget openssh-clients
AutomaticLoginEnable=true AutomaticLogin=vnx
chkconfig iptables off
VER=v0.21 OS=Fedora 14 DESC=Basic Fedora 14 root-filesystem without GUI
#!/bin/bash # Clean yum cache yum clean all # Delete /etc/resolv.conf rm -f /etc/resolv.conf # Clean command history rm -f /root/.bash_history # Delete udev net rules files: rm -f /etc/udev/rules.d/70-persistent-net.rules while true; do # Ask for a message to save in /etc/vnx_rootfs_version file echo "** Save a log message in /etc/vnx_rootfs_version file " echo -n "** describing the modifications done? " read -n 1 -p "[y/n] " answer echo "" case $answer in [Yy]* ) echo "** Log message (1 line maximum):" read logmsg DATE=`date` echo "MODDATE=$DATE" >> /etc/vnx_rootfs_version echo "MODDESC=$logmsg" >> /etc/vnx_rootfs_version break;; [Nn]* ) break;; * ) echo "** Error: please answer 'y' or 'n'.";; esac done # Halt the system halt -p
chmod +x /usr/local/bin/vnx_halt
vnx_halt
Installing additional software
To install additional software or modify your root filesystem, you just have to start it as described above and make the operations required on the filesystem.
- Start the virtual machine (directly using virsh or the vnx_modify_rootfs utility):
/usr/share/vnx/bin/vnx_modify_rootfs rootfs_fedora.xml
- Install the software:
yum install ...
- Stop the machine with:
vnx_halt