Vnx-rootfsfedora

Follow this procedure to create a fedora based root filesystem for VNX. The procedure has been tested with Fedora 14.  Create the filesystem disk image: qemu-img create -f qcow2 root_fs_fedora-base.qcow2 5GB 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: wget ftp://ftp.rediris.es/mirror/fedora/14/Fedora/i386/iso/Fedora-14-i386-DVD.iso cp Fedora-14-i386-DVD.iso /almacen/iso Create a libvirt XML definition (root_fs_freebsd.xml) containing the virtual machine description:  Fedora 524288  1    hvm    /usr/bin/kvm     <source file='/almacen/iso/Fedora-14-i386-DVD.iso'/> <target dev='hdb'/> <interface type='network'> <source network='default'/> <graphics type='vnc'/> Note: change "source file=" lines to whatever fits your case (use full paths).

Start the virtual machine with:</li> virsh create root_fs_fedora.xml Access virtual machine console with:</li> virt-viewer Fedora Follow Fedora installation menus to install:</li> <ul> A "minimal" system, if you want a server rootfs without user interface</li> One of the other options (e.g "web server", "desktop system", etc) if you want a system with graphical user interface</li> </ul> Once installation is finished, update the system and install additional packages</li> 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. Install VNX autoconfiguration daemon:</li> <ul> From the host execute:</li> /usr/share/vnx/bin/vnx_update_aced Fedora /usr/share/vnx/aced/vnx-aced-lf-0.1b.tgz From the virtual machine console:</li> ln -s /media/CDROM /media/cdrom perl /media/cdrom/install_vnxdaemon </ul> Delete udev network rules files:</li> rm /etc/udev/rules.d/70-persistent-net.rules Enable login on the first serial line by creating a file named /etc/init/serial-ttyS0.conf with the following content:</li> start on stopped rc RUNLEVEL=[2345] stop on starting runlevel [016] respawn exec /sbin/agetty /dev/ttyS0 9600 vt100-nav Besides, you have to add ttyS0 to /etc/securetty file if you want to login root on that console:</li> echo "ttyS0" >> /etc/securetty If you have chosen a "minimum installation", activate network services (they are disable by default):</li> chkconfig --level 3 network on Optionally:</li> <ul> Install other services, for example, an apache server:</li> yum install httpd update-rc.d -f apache2 remove  # to avoid automatic start Or, if using a "minumum installation", install network utilities:</li> yum install telnet wget openssh-clients <li>If you want automatic login, just edit /etc/gdm/custom.conf and add the following lines:</li> AutomaticLoginEnable=true AutomaticLogin=vnx <li>Disable the firewall. Firewall is enabled by default which could be problematic for testing purpose systems. If desired, disable it graphically in "System|Administration|Firewall" option, or using the following command from the command line:</li> chkconfig iptables off </ul> <li>Clean yum cache and stop the machine with:</li> yum clean all halt </ul>
 * 1) This service maintains a getty on /dev/ttyS0.

Installing additional software
To install additional software or modify your root file system, you just have to start it as described above and make the operations required on the filesystem. /usr/share/vnx/bin/vnx_modify_rootfs root_fs_fedora.xml yum install ... rm /etc/udev/rules.d/70-persistent-net.rules halt
 * Start the virtual machine (directly using virsh or the vnx_modify_rootfs utility):
 * Install the software:
 * Delete udev rules files:
 * Stop the machine with: