Difference between revisions of "Vnx-rootfsfedora"
(→Configuration) |
|||
(14 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Title|How to create a KVM Fedora root filesystem for VNX}} | {{Title|How to create a KVM Fedora root filesystem for VNX}} | ||
− | Follow this procedure to create a KVM Fedora based root filesystem for VNX. The procedure has been tested with Fedora 16 and 14. | + | Follow this procedure to create a KVM Fedora based root filesystem for VNX. The procedure has been tested with Fedora 24, 20, 18, 16 and 14. |
== Basic installation == | == Basic installation == | ||
<ul> | <ul> | ||
<li>Create the filesystem disk image:</li> | <li>Create the filesystem disk image:</li> | ||
− | qemu-img create -f qcow2 vnx_rootfs_kvm_fedora.qcow2 | + | qemu-img create -f qcow2 vnx_rootfs_kvm_fedora.qcow2 20G |
<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/16/Fedora/i386/iso/Fedora-16-i386-DVD.iso | wget ftp://ftp.rediris.es/mirror/fedora/16/Fedora/i386/iso/Fedora-16-i386-DVD.iso | ||
Line 12: | Line 12: | ||
<li>Create the virtual machine with:</li> | <li>Create the virtual machine with:</li> | ||
vnx --create-rootfs vnx_rootfs_kvm_fedora.qcow2 --install-media /almacen/iso/Fedora-16-i386-DVD.iso --mem 768M | vnx --create-rootfs vnx_rootfs_kvm_fedora.qcow2 --install-media /almacen/iso/Fedora-16-i386-DVD.iso --mem 768M | ||
+ | Note: add '''"--arch x86_64"''' option for 64 bits virtual machines | ||
<li>Follow the Fedora installation assistant. At some point, you will have to choose among different system profiles: desktop, web server, minimal, etc.</li> | <li>Follow the Fedora installation assistant. At some point, you will have to choose among different system profiles: desktop, web server, minimal, etc.</li> | ||
<li>Enable login on the first serial line:</li> | <li>Enable login on the first serial line:</li> | ||
<ul> | <ul> | ||
− | <li>Fedora 18:</li> | + | <li>Fedora 18, 20 and 24:</li> |
<ul> | <ul> | ||
<li>Edit /etc/default/grub and add:</li> | <li>Edit /etc/default/grub and add:</li> | ||
<pre> | <pre> | ||
− | GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8" | + | GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0" |
GRUB_TERMINAL="serial" | GRUB_TERMINAL="serial" | ||
GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" | GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1" | ||
Line 47: | Line 48: | ||
vnx --modify-rootfs vnx_rootfs_kvm_fedora.qcow2 --update-aced --mem 768M | vnx --modify-rootfs vnx_rootfs_kvm_fedora.qcow2 --update-aced --mem 768M | ||
Note: ignore the errors "timeout waiting for response on VM socket". 768M are needed if you are installing a root filesystem with desktop interface | Note: ignore the errors "timeout waiting for response on VM socket". 768M are needed if you are installing a root filesystem with desktop interface | ||
+ | Note: add '''"--arch x86_64"''' option for 64 bits virtual machines | ||
<li>Access the system through the text console to easy the copy-paste of commands:</li> | <li>Access the system through the text console to easy the copy-paste of commands:</li> | ||
virsh console vnx_rootfs_kvm_fedora.qcow2 | virsh console vnx_rootfs_kvm_fedora.qcow2 | ||
Line 54: | Line 56: | ||
<li>Update the system and install additional packages</li> | <li>Update the system and install additional packages</li> | ||
yum update | yum update | ||
− | yum install perl perl-XML-LibXML acpid udisks | + | yum install perl perl-XML-LibXML perl-NetAddr-IP acpid udisks perl-Sys-Syslog xterm |
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. | 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. | ||
<li>Install VNX autoconfiguration daemon:</li> | <li>Install VNX autoconfiguration daemon:</li> | ||
mount /dev/sdb /mnt/ | mount /dev/sdb /mnt/ | ||
perl /mnt/vnxaced-lf/install_vnxaced | perl /mnt/vnxaced-lf/install_vnxaced | ||
+ | <li>Disable Network Manager to avoid problems with autoconfiguration daemon</li> | ||
+ | systemctl stop NetworkManager.service | ||
+ | systemctl disable NetworkManager.service | ||
+ | systemctl enable network.service | ||
<!--ul> | <!--ul> | ||
<li>From the host execute:</li> | <li>From the host execute:</li> | ||
Line 90: | Line 96: | ||
and executing: | and executing: | ||
grub2-mkconfig -o /boot/grub2/grub.cfg | grub2-mkconfig -o /boot/grub2/grub.cfg | ||
+ | <li>Disable screensaver if using a GUI.</li> | ||
</ul> | </ul> | ||
<li>Create a file /etc/vnx_rootfs_version to store version number and informacion about modification. For example:</li> | <li>Create a file /etc/vnx_rootfs_version to store version number and informacion about modification. For example:</li> | ||
<pre> | <pre> | ||
− | VER=v0. | + | VER=v0.25 |
− | OS=Fedora | + | OS=Fedora 18 |
− | DESC=Basic Fedora | + | DESC=Basic Fedora 18 root-filesystem without GUI |
</pre> | </pre> | ||
<li>Finally, stop the virtual machine with:</li> | <li>Finally, stop the virtual machine with:</li> |
Latest revision as of 00:07, 3 November 2016
How to create a KVM Fedora root filesystem for VNX
Follow this procedure to create a KVM Fedora based root filesystem for VNX. The procedure has been tested with Fedora 24, 20, 18, 16 and 14.
Contents
Basic installation
- Create the filesystem disk image:
qemu-img create -f qcow2 vnx_rootfs_kvm_fedora.qcow2 20G
wget ftp://ftp.rediris.es/mirror/fedora/16/Fedora/i386/iso/Fedora-16-i386-DVD.iso cp Fedora-16-i386-DVD.iso /almacen/iso
vnx --create-rootfs vnx_rootfs_kvm_fedora.qcow2 --install-media /almacen/iso/Fedora-16-i386-DVD.iso --mem 768M
Note: add "--arch x86_64" option for 64 bits virtual machines
- Fedora 18, 20 and 24:
- Edit /etc/default/grub and add:
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0" GRUB_TERMINAL="serial" GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"
grub2-mkconfig -o /boot/grub2/grub.cfg
ln -s /usr/lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@ttyS0.service
#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
And add ttyS0 to /etc/securetty file if you want to login root on that console:
echo "ttyS0" >> /etc/securetty
rm /etc/udev/rules.d/70-persistent-net.rules halt -p
Configuration
- Restart the system with the following command:
vnx --modify-rootfs vnx_rootfs_kvm_fedora.qcow2 --update-aced --mem 768M
Note: ignore the errors "timeout waiting for response on VM socket". 768M are needed if you are installing a root filesystem with desktop interface Note: add "--arch x86_64" option for 64 bits virtual machines
virsh console vnx_rootfs_kvm_fedora.qcow2
dhclient eth0
Note: use "ip link show" to know which network interface to use.
yum update yum install perl perl-XML-LibXML perl-NetAddr-IP acpid udisks perl-Sys-Syslog xterm
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.
mount /dev/sdb /mnt/ perl /mnt/vnxaced-lf/install_vnxaced
systemctl stop NetworkManager.service systemctl disable NetworkManager.service systemctl enable network.service
chkconfig --level 3 network on
- Install other services needed, for example, an apache server:
yum install httpd chkconfig httpd off # if you want to avoid automatic start of apache server
yum install telnet wget openssh-clients
AutomaticLoginEnable=true AutomaticLogin=vnx
# Fedora 18 chkconfig firewalld off
# Fedora 16 & 14 chkconfig iptables off chkconfig ip6tables off
GRUB_TIMEOUT=0
and executing:
grub2-mkconfig -o /boot/grub2/grub.cfg
VER=v0.25 OS=Fedora 18 DESC=Basic Fedora 18 root-filesystem without GUI
vnx_haltvnx_halt deletes some caches and log files and optionally lets you write a short message to /etc/vnx_rootfs_version file describing the latest modifications done.
Installing additional software
To install additional software or to modify your root file system, you just have to:
- Start a virtual machine from it:
vnx --modify-rootfs vnx_rootfs_kvm_fedora.qcow2
dhclient eth1
Note: use "ip link show" to know which network interface to use.
vnx_halt
Updating VNXACED
You can automatically update the VNXACE daemon with the following command:
vnx --modify-rootfs vnx_rootfs_kvm_fedora.qcow2 --update-aced -y
If VNXACE daemon is not updated automatically, you can do it manually by accessing the virtual machine console and type:
mount /dev/sdb /mnt/ perl /mnt/vnxaced-lf/install_vnxaced