Máquinas virtuales: qué son, cómo funcionan y cómo utilizarlas
Virtual
machines: what they are, how they work and how to use them
¿Qué es una máquina virtual?
What is a
virtual machine?
Una vez nos ha quedado claro que una máquina virtual no es
realmente ninguna máquina llena de engranajes con un casco de realidad virtual,
sino un software, entremos más en detalle sobre qué son las máquinas virtuales.
Once it has
become clear that a virtual machine is not really any machine full of gears
with a virtual reality helmet, but a software, let's go into more detail about
what virtual machines are.
Lo primero que debes saber es que hay dos
tipos de máquinas virtuales diferenciadas por su funcionalidad: las de sistema
y las de proceso, si bien la gran mayoría de las veces que oigas hablar de una
máquina virtual casi seguro que se estarán refiriendo a las de sistema.
The first
thing you should know is that there are two types of virtual machines
differentiated by their functionality: the system and the process ones,
although most of the times you hear about a virtual machine almost certainly
they will be referring to those of system.
El ordenador emulado tiene su propia CPU, disco duro, tarjeta de
redes, tarjeta gráfica, memoria, etc. Todos ellos, elementos virtuales
(emulados) que funcionan exactamente igual que el hardware real del equipo en
que se está ejecutando.
The emulated
computer has its own CPU, hard drive, network card, graphics card, memory, etc.
All of them, virtual elements (emulated) that work exactly like the real hardware
of the computer on which it is running.
Máquinas virtuales de sistema
System virtual
machines
Una máquina virtual de sistema es aquella que emula a un ordenador
completo. En palabras llanas, es un software que puede hacerse pasar por otro
dispositivo -como un PC- de tal modo que puedes ejecutar otro sistema operativo
en su interior. Tiene su propio disco duro, memoria, tarjeta gráfica y demás
componentes de hardware, aunque todos ellos son virtuales.
A system
virtual machine is one that emulates a complete computer. In plain words, it is
software that can impersonate another device - such as a PC - so that you can
run another operating system inside. It has its own hard disk, memory, graphics
card and other hardware components, although all of them are virtual.
Que sus componentes sean virtuales no quiere decir necesariamente que no
existan. Por ejemplo, una máquina virtual puede tener unos recursos reservados
de 2 GB de RAM y 20 GB de disco duro, que obviamente salen de algún sitio: del
PC donde está instalada la máquina virtual, también llamado a veces el
hipervisor, el host o el anfitrión. Otros dispositivos podrían realmente ser inexistentes físicamente, como
por ejemplo un CD-ROM que en verdad es el contenido de una imagen ISO en vez de
un lector de CD de verdad.
That its
components are virtual does not necessarily mean that they do not exist. For
example, a virtual machine may have reserved resources of 2 GB of RAM and 20 GB
of hard disk, which obviously leave somewhere: from the PC where the virtual
machine is installed, also sometimes called the hypervisor, the host or the
host. Other devices might actually be physically non-existent, such as a CD-ROM
that really is the content of an ISO image instead of a real CD player.
Todos los recursos que utiliza una máquina virtual son tomados de
los recursos del ordenador original. Imaginemos que, por ejemplo, nuestro PC
tiene 32GB RAM. Si creamos una máquina virtual con 8GB RAM y otra con 4GB de
RAM, nos quedaría la siguiente distribución*:
All the resources that a virtual machine uses are
taken from the resources of the original computer. Imagine that, for example,
our PC has 32GB RAM. If we create a virtual machine with 8GB RAM and another
with 4GB of RAM, we would have the following distribution *:
Para el sistema operativo que se ejecuta dentro de la máquina
virtual toda esta emulación es transparente e invisible. Todo funciona igual a
si se estuviera ejecutando en un PC normal, sin que sepa que en verdad está
metido dentro de una burbuja dentro de otro sistema operativo. De hecho, nada
te impide hacer como en la película Inception / Origen y crear otra máquina
virtual dentro de la anterior máquina virtual.
For the
operating system that runs inside the virtual machine all this emulation is
transparent and invisible. Everything works the same as if it were running on a
normal PC, without knowing that it is really stuck inside a bubble inside
another operating system. In fact, nothing prevents you from doing as in the
Inception / Source movie and creating another virtual machine inside the
previous virtual machine.
En su burbuja, la máquina virtual no puede acceder al resto de
datos de la máquina anfitrión a pesar de estar físicamente funcionando en la
misma, están aisladas. No obstante, las principales aplicaciones de máquinas
virtuales como VirtualBox o VMWare disponen de atajos y herramientas para
facilitar la tarea de pasar archivos de una máquina a otra.
In its bubble,
the virtual machine cannot access the rest of the data of the host machine even
though it is physically functioning in it, they are isolated. However, the main
applications of virtual machines such as VirtualBox or VMWare have shortcuts
and tools to facilitate the task of transferring files from one machine to
another.
Para funcionar, una máquina virtual mapea los dispositivos
virtuales que ofrece a su invitado con los dispositivos reales presentes en la
máquina física. Por ejemplo, la máquina puede estar emulando una tarjeta de
sonido Sound Blaster de 16 bit, aunque en verdad está conectada con la tarjeta
de sonido interna de la placa base de tu PC portátil que es Realtek.
To function, a
virtual machine maps the virtual devices it offers its guest with the actual
devices present in the physical machine. For example, the machine may be emulating
a 16-bit Sound Blaster sound card, although it is actually connected to the
internal sound card of the motherboard of your laptop that is Realtek.
La virtualización puede ser por software o con apoyo mediante el
hardware, en cuyo caso se obtiene un mejor rendimiento. Desde 2005 es común que
los procesadores cuenten con tecnología de virtualización por hardware, aunque
no siempre está activada por defecto en la BIOS.
Virtualization can be by software or with hardware
support, in which case you get better performance. Since 2005 it is common for
processors to
have hardware
virtualization technology, although it is not always enabled by default in the
BIOS.
¿Y las máquinas virtuales de procesos?
And the
virtual process machines?
Todo lo anterior aplicaría a las máquinas virtuales de sistemas
(más comúnmente utilizadas), pero también tenemos las máquinas virtuales de
procesos. Éstas, en vez de emular un equipo completo, ejecutan procesos
concretos, como por ejemplo una aplicación basada en .NET o en Java para, entre
otras cosas, conseguir que su funcionamiento sea siempre el mismo,
independientemente de la plataforma en la que se ejecute (Mac, Windows, Linux).
All of the
above would apply to system virtual machines (more commonly used), but we also have
process virtual machines. These, instead of emulating a complete computer,
execute specific processes, such as an application based on .NET or Java to,
among other things, ensure that its operation is always the same, regardless of
the platform on which it runs (Mac, Windows, Linux).
¿Qué sentido tiene crear máquinas virtuales?
What is the
point of creating virtual machines?
Una máquina virtual puede crearse por diferentes motivos. La
mayoría de las veces se hace para probar sistemas operativos nuevos o
actualizaciones de los ya existentes, ejecutar programas antiguos, ver cómo
funciona una misma aplicación en distintos sistemas o abrir archivos
aparentemente maliciosos. El principal objetivo es poder hacer pruebas de
manera segura. Al estar aisladas del resto del equipo, si algo falla, no
afectará al ordenador que la ejecuta.
A virtual
machine can be created for different reasons. Most of the time it is done to
test new operating systems or update updates, run old programs, see how an
incorrect application works on different systems or open apparently malicious
files. The main objective is to be able to test safely. Being limited to the
rest of the team, if something fails, it will not affect the computer that
challenges it.
Máquinas virtuales de proceso
Virtual
process machines
Una máquina virtual de proceso es menos ambiciosa que una de
sistema. En vez de emular un PC por completo, ejecuta un proceso concreto, como
una aplicación, en su entorno de ejecución. Suena algo esotérico, pero lo usas
cada vez que ejecutas una aplicación basada en Java o basada en .NET Framework.
A virtual
process machine is less ambitious than a system one. Instead of emulating a PC
completely, it executes a specific process, such as an application, in its
execution environment. It sounds somewhat esoteric, but you use it every time
you run a Java-based or .NET Framework-based application.
Esto es de utilidad a la hora de desarrollar aplicaciones para
varias plataformas, pues en vez de tener que programar específicamente para
cada sistema, el entorno de ejecución (es decir, la máquina virtual) es el que
se encarga de lidiar con el sistema operativo.
This is useful
when developing applications for several platforms, because instead of having
to program specifically for each system, the execution environment (that is,
the virtual machine) is responsible for dealing with the operating system.
Para qué se usan las máquinas virtuales
What virtual machines are used for
Todo esto está muy bien, pero ¿para qué querría
alguien crear un PC virtual dentro de su PC? Aunque así de entrada pudiera
parecer una idea algo trivial, la verdad es que las máquinas virtuales tienen
una gran variedad de utilidades tanto en el entorno profesional como en el del consumidor final. Estos
son los principales usos:
All this is fine, but why would someone want to
create a virtual PC inside their PC? Although this may seem like a trivial idea
at the outset, the truth is that virtual machines have a wide variety of
utilities both in the professional environment and in the final consumer. These
are the main uses:
Todos estos usos vienen con una pega principal: el rendimiento.
Como es de esperar, si el hardware de tu PC se usa para mover dos sistemas
operativos a la vez en vez de uno, el rendimiento se resiente. Además, aunque
cada vez las aplicaciones para crear máquinas virtuales son más eficientes y el
hardware más potente, emular un sistema siempre requiere un esfuerzo extra que
no es necesario si el software se pudiera comunicar directamente con el
hardware, sin intermediarios.
performance suffers. In addition, although
applications to create virtual machines are becoming more efficient and
hardware more powerful, emulating a system always requires an extra effort that
is not necessary if the software could communicate directly with the hardware,
without intermediaries.
Cómo se usa una máquina virtual
How a virtual machine is used
Para usar una máquina virtual lo primero que necesitas es instalar
una aplicación en tu PC capaz de crearla o al menos reproducirla. Hay varias
aplicaciones muy conocidas capaz de hacer esto, aunque las más famosas son VMWare,
VirtualBox, QEMU y Parallels.
To use a virtual machine, the first thing you
need is to install an application on your PC capable of creating it or at least
playing it. There are several well-known applications capable of doing this,
although the most famous are VMWare, VirtualBox, QEMU and Parallels.
La importancia de una máquina virtual para asegurar el
funcionamiento de software antiguo es tanta que Microsoft ha lanzado durante
estos años varios programas para Windows con este fin. Es el caso del Virtual
PC, Windows XP Mode o el nuevo HyperV.
The importance of a virtual machine to ensure
the operation of old software is so much that Microsoft has launched several
programs for Windows for this purpose during these years. This is the case of
the Virtual PC, Windows XP Mode or the new HyperV.
Por su naturaleza de código abierto, gran compatibilidad con
multitud de sistemas operativos anfitriones e invitados, nosotros nos vamos a
centrar en VirtualBox, pero probablemente obtendrás resultados similares con el
resto de programas.
Due to its open source nature, great
compatibility with many host and guest operating systems, we are going to focus
on VirtualBox, but you will probably get similar results with the rest of the
programs.











Comentarios
Publicar un comentario