Installing a Fedora VM from Internet

There is a powerful tool shipped with libvirt called virt-install. This tool is inside the python-virtinst package and it allows us to install any GNU/Linux distribution directly from the command line.
For example, the following command will create a VM and install Fedora 17 (32 bits) on it.

virt-install –name f17_i686 –ram 1024 –disk path=/dev/vg_data/f17_i686,size=15 –location=”http://dl.fedoraproject.org/pub/fedora/linux/releases/17/Fedora/i386/os/” –graphics vnc

The arguments are:

name = name of the VM
ram = amount of RAM memory on MB
disk = lthe path and size of the virtual disk
location = the media to install, in this case the F17 URL.
graphics = the graphic card to use

After running this command, we can user virt-manager to continue with the installation process graphically.

How can we automate this task?

There are 2 different ways:

1. Every time you install Fedora, you will find on the /root directory a file called anaconda-ks.cfg. This file can be used to perform an unattended installation equal to the one you have.
You can take that file and modify the parts you need.
2. You can write a kickstart file from scratch.

This kickstart file can be used for any Fedora installation fedora.ks.
You can modify this file and upload it to your own HTTP/FTP/NFS server, leave it on a disk or burn it on a CD.
You can try to install a VM directly using this command:

virt-install --name f17_x86_64 --ram 1024 --disk path=/dev/vg_data/f17_x86_64,size=15 --location="http://dl.fedoraproject.org/pub/fedora/linux/releases/17/Fedora/x86_64/os/" --extra-args "ks=https://mkreder.com/vms/ks/fedora.ks console=ttyS0,9600"
#you should modify the ram and disk arguments as needed

It will install Fedora 17 x86_64 on a VM on a completely unattended way.
The root password for this VM will be “fedora”.

Español

Una herramienta muy util que viene con libvirt es virt-install. Esta herramienta se encuentra en el paquete python-virtinst y nos permite iniciar la instalación de cualquier GNU/Linux desde la linea de comandos. Por ejemplo, el siguiente comando crea una VM y realiza la instalación de Fedora 17 (32 bits):

virt-install --name f17_i686 --ram 1024 --disk path=/dev/vg_data/f17_i686,size=15 --location="http://dl.fedoraproject.org/pub/fedora/linux/releases/17/Fedora/i386/os/" --graphics vnc


Los argumentos son:
name = nombre de nuestra VM
ram = la cantidad de memoria RAM a asignar en MB
disk = la dirección en donde queremos crear el archivo o LV (path) y el tamaño (size)
location = el medio de instalación, en este caso la URL de Fedora 17 32 bits
graphics = el modo gráfico a utilizar

Luego de haber ejecutado virt-install podemos utilizar virt-manager para seguir el proceso de instalación gráfica eligiendo como configurar cada parte de la instalación.

¿Cómo automatizar esta tarea?
Hay 2 formas básicas de automatizar la instalación.
1. Todas las instalaciones de Fedora dejan en /root/ un archivo llamado anaconda-ks.cfg, el mismo sirve para realizar en forma desatendida una instalación idéntica a la que tenemos. También podemos tomar este archivo como ejemplo y modificar las partes que nos interesen.
2. Podemos escribir nuestro propio archivo kickstart desde cero.

Les dejo un archivo básico de kickstart que sirve para cualquier instalación de Fedora fedora.ks.
Este archivo lo podemos subir a un sitio HTTP/FTP/NFS o puede grabarse en algún disco o cdrom.

Para instalar directamente de este archivo sin modificarlo:

virt-install --name f17_x86_64 --ram 1024 --disk path=/dev/vg_data/f17_x86_64,size=15 --location="http://dl.fedoraproject.org/pub/fedora/linux/releases/17/Fedora/x86_64/os/" --extra-args "ks=https://mkreder.com/vms/ks/fedora.ks console=ttyS0,9600"
#modificar los argumentos disk y ram si es necesario

Se instalara Fedora 17 x86_64 en una VM sin ningún tipo de intervención.
La password de root encriptada en el archivo kickstart es “fedora”

Red Hat Linux 6.2

I remember like if it was today the first time I installed Linux in my computer. I was 12 years ago and I bought a magazine, from Spain, that came with the CD of Red Hat 6.1.

I completely destroyed my partition table with Disk Druid, that I don’t know how could recover later. Once the installation was complete,  several days after the issue, I started to fight with my monitor to use 1024 x 768, the only way was using a very low horizontal frequency between 50-60 Hz, but I had to fight with Vertical frequency as well to get it working. Once working as the frequency was low it wasn’t really good for my eyes but it looked nice for screenshots. I used to take lots of screenshots that I have to find some day to post them.

I’m sharing this VM with the world, I’m planning to start uploading VM’s of old Linux distributions, so everyone can see how GNU/Linux was 10 years ago or maybe when it started.

How to install it?

As root:

# wget https://mkreder.com/vms/redhat/6.2/redhat62.xml -O /etc/libvirt/qemu/redhat62.xml
# wget https://mkreder.com/vms/redhat/6.2/redhat62.img.gz -O /var/lib/libvirt/images/redhat62.img.gz
# gzip -d /var/lib/libvirt/images/redhat62.img.gz
# restorecon -R /etc/libvirt/qemu/
# restorecon -R /var/lib/libvirt/images

Español

Me acuerdo como si fuese hoy la primera vez que instale Linux en mi PC. Yo tenia 12 años y había comprado una revista española que venia con el CD de Red Hat Linux 6.1.

Destruí completamente mi tabla de particiones con Disk Druid, todavía no se como hice para recuperarla. Una vez que complete la instalación, después de varios días. Empece a pelearme con mi monitor para que funcione a 1024×768, la único que pude hacer para que funcione fue usar una frecuencia horizontal entre 50-60 Hz, pero aun así tenia que pelearme con la vertical. Una vez que funcionaba, parpadeaba un poco, no era lo mejor para mis ojos, pero podía sacar mejores screenshots, me encantaba coleccionar screenshots. Algún día cuando las encuentre las posteare.

 

Subí esta VM para que cualquiera pueda bajarla y usarla. Quizás empiece a subir VM’s de distros viejas así todos pueden ver como era GNU/Linux 10 años atrás o quizás cuando empezó.

Como la consigo?

Como root:

# wget https://mkreder.com/vms/redhat/6.2/redhat62.xml -O /etc/libvirt/qemu/redhat62.xml
# wget https://mkreder.com/vms/redhat/6.2/redhat62.img.gz -O /var/lib/libvirt/images/redhat62.img.gz
# gzip -d /var/lib/libvirt/images/redhat62.img.gz
# restorecon -R /etc/libvirt/qemu/
# restorecon -R /var/lib/libvirt/images

trying to run old Red Hat version in KVM, failed

Some days ago I felt some nostalgic feelings and I tried to install a red hat 6.2 version into a fedora 14 host.

The installation was painfully slow, but it was completed successfully anyway. The problem is that after booting the new (not really) redhat 6..2, I got a kernel panic with the following message:

Kernel panic: Kernel compiled for Pentium+, requires TSC”

after googling that, I found that one of the solutions would be recompile the old linux kernel with the option “Unsynced TSC support”, I’m to lazy to do that just for fun, I would do it if I have no choice, but I have some doubts, why the kernel in the installation cd is not failing? and, is it because my computer has an AMD processor?

Español

Hace algunos días sentí un poco de nostalgia y trate de instalar redhat 6.2 en mi PC con fedora 14

La instalación fue bastante lenta, pero se completo sin mayores problemas. El problema es que después de bootear la nueva (chiste!) instalación, obtuve un kernel panic con el siguiente mensaje:

“Kernel panic: Kernel compiled for Pentium+, requires TSC”

Después de googlear un rato, encontré que una de las soluciones seria recompilar el kernel del viejo linux, con la opción, “Unsynced TSC Support”, lo haría pero soy demasiado perezoso para hacer eso. Pero me quedan algunas dudas, porque el kernel del cd no fallo? este fallo es porque mi PC tiene procesador AMD? hmmm, no lo sé