No Somos Libres

April 9, 2007

Virtualización de Windows con VMware server

Filed under: GNU/Linux — Adrián @ 8:46 pm

Es necesario tener instalados los headers del kernel, además de gcc y xinedt. Vamos a instalar vmware server para editar las configuraciones de nuestras máquinas virtuales, y/o crear nuevas.
En primer lugar descargamos el vmware server, creamos una carpeta en var/vm y hacemos tar. Ejecutamos el script de instalación .pl
Si tenías instalado VMplayer te dará error y saldrá de la ejecución. Eliminamos VMplayer con

sudo aptitude purge vmware-player

Si sigue dando error basta con eliminar /etc/vmware (si encuentra una carpeta vmware en el arbol de directorios te dará el error). Una vez comenzada la instalación nos hará una serie de preguntas:

In which directory do you want to install the binary files?
[/usr/bin] (Elegimos /usr/bin)

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc] (Es /etc)

What is the directory that contains the init scripts?
[/etc/init.d] (Ese mismo)

In which directory do you want to install the daemon files?
[/usr/sbin] (Idem)

In which directory do you want to install the library files?
[/usr/lib/vmware] (Este instalador es un chico listo)

The path “/usr/lib/vmware” does not exist currently. This program is going to
create it, including needed parent directories. Is this what you want?
[yes] (yes)

In which directory do you want to install the manual files?
[/usr/share/man] (/usr/share/man)

In which directory do you want to install the documentation files?
[/usr/share/doc/vmware] (/usr/share/doc/vmware)

The path “/usr/share/doc/vmware” does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes] yes

The installation of VMware Server 1.0.2 build-39867 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: “/usr/bin/vmware-uninstall.pl”.

BRAAAAVO

Before running VMware Server for the first time, you need to configure it by
invoking the following command: “/usr/bin/vmware-config.pl”. Do you want this
program to invoke the command for you now? [yes] Pues sí.

In which directory do you want to install the mime type icons?
[/usr/share/icons] (No falla una)

What directory contains your desktop menu entry files? These files have a
.desktop file extension. [/usr/share/applications] El mismo.

In which directory do you want to install the application’s icon?
[/usr/share/pixmaps] /usr/share/pixmaps

Parece que es normal que no localice un módulo compilado válido para tu kernel, por tanto te preguntará si quieres que intente compilar uno:

None of the pre-built vmmon modules for VMware Server is suitable for your
running kernel. Do you want this program to try to build the vmmon module for
your system (you need to have a C compiler installed on your system)? [yes]

Le decimos que sí, y le indicamos la ruta a los headers del kernel que hemos descargado antes (normalmente /lib/modules/AQUÍ TU KERNEL/build/includes) El mío ahora mismo es 2.6.17-11-generic, por tanto /lib/modules/2.6.17-11-generic/build/include. Podéis mirar qué kernel tenéis con el comando uname -a. Hay veces que la carpeta includes no se encuentra en /build, mirad donde anda y listo.

What is the location of the directory of C header files that match your running
kernel? [/lib/modules/2.6.17-11-generic/build/include] /lib/modules/2.6.17-11-generic/build/include

No da ningún problema (salvo con arquitecturas extrañas) y te preguntará si quieres red en tus máquinas virtuales. Yo recomendaría decir que sí, ya que facilita el intercambio de archivos entre los dos SO y además te da salida a internet en las máquinas virtuales. Lo normal es una red bridged.
Do you want networking for your virtual machines? (yes/no/help) [yes] yes

Si tienes varias interfaces de red lo detectará y te informará -por ejemplo wifi y ethernet- y te preguntará cuál quieres puentear -bridge- a la máquina virtual. Seleccionad la que utilicéis para conectaros a internet. En mi caso, la wifi, es decir eth1. (Podéis ver vuestras interfaces de red con el comando ifconfig). Algunas preguntillas más:

Do you want to be able to use NAT networking in your virtual machines? (yes/no)
[yes] yesDo you want this program to probe for an unused private subnet? (yes/no/help)
[yes] yes

Probing for an unused private subnet (this can take some time)…
The subnet 192.168.62.0/255.255.255.0 appears to be unused.

The following NAT networks have been defined:
. vmnet8 is a NAT network on private subnet 192.168.62.0.

Do you wish to configure another NAT network? (yes/no) [no] no

Do you want to be able to use host-only networking in your virtual machines?
[yes] yes

Do you want this program to probe for an unused private subnet? (yes/no/help)
[yes] yes

Do you wish to configure another host-only network? (yes/no) [no] no

Ahora compila el módulo de vmnet, con los valores que le dimos antes (si los volviera a pedir, volved a introducirlos).

Please specify a port for remote console connections to use [902] 902

In which directory do you want to keep your virtual machine files?
[/var/lib/vmware/Virtual Machines] Yo las tenía en /home/adrian/vmware

Ahora te pide el serial que hemos obtenido en la web de vmware al registrarnos de forma gratuita. Lo introducimos y listo.
Lo ideal ahora sería poder compartir ficheros entre linux y windows, para que esto sea funcional. Para no complicarme demasiado he optado por montar un servidor ssh/scp en linux e instalar WinSCP en windows para conectar. Esto es sencillo:

    aptitude install openssh-server

El fichero de configuración lo tenéis en /etc/ssh/sshd_config
Por defecto está bien configurado, pero por si acaso os recomiendo que no permitáis el login como root y que activéis el X11Forwarding. En la instalación de WinSCP no vamos a entrar, lo que sí indicaré es que no se puede hacer la conexión a “localhost”, debe hacerse a la ip privada del servidor linux.
Espero que haya servido junto al otro artículo para configurar una buena máquina virtual.

1 Comment »

  1. macho la ayuda genial, ya o habia instalado antes n mi pc, pero ahora renovandola, y reinstalandola no habia caido n la eliminacion del directorio en el /etc.

    Comment by FErArg — April 24, 2007 @ 1:40 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress