UMGUM.COM (лучше) 

Installation ( Установка VMware Server 2 на операционную систему Linux Debian 5 Lenny. )

13 сентября 2010  (обновлено 31 января 2015)

Эта публикация отнесена в архив. Она неактуальна.

OS: Debian Lenny.

Идём на сайт http://www.vmware.com/ и скачиваем требуемый нам дистрибутив. Отличия в реализации для определённой платформы и формате исполняемого файла.

Выбираем платформу, в моём случае это: "VMware Server 2 for Linux Operating Systems 64-bit version".
Выбираем формат пакета: Binary (.gz)

В моём случае понадобилось скачать следующий дистрибутивный файл:

VMware-server-2.0.2-203138.x86_64.tar.gz

В процессе инсталляции дистрибутива "VMware Server 2" потребуется компиляция модулей ядра, для чего необходимо иметь заголовочные файлы и пакет "build-essential". Точное наименование пакета заголовочных файлов можно узнать с помощью следующей команды:

# echo "linux-headers-"`uname -r`

Пример:

linux-headers-2.6.26-2-amd64

Инсталлируем пакеты:

# aptitude install linux-headers-2.6.26-2-amd64 build-essential psmisc


Неоднократно встречал упоминания о том, что для корректной сборки модулей ядра необходимо прямо указывать в переменной окружения "CC" ту версию компилятора, что использовалась при сборке самого ядра системы.

Узнаём, компилятором какой версии собрано ядро Debian 5 Lenny:

# cat /proc/version

Linux version 2.6.26-2-amd64 (Debian 2.6.26-25) (dannf@debian.org) (gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)) #1 SMP Tue Aug 31 09:11:22 UTC 2010

Видно, что ядро Debian 5 Lenny собрано компилятором "GCC 4.1", соответственно, применяем к переменной требуемое значение:

# export CC=/usr/bin/gcc-4.1

На самом деле принудительное указание версии используемой версии компилятора вовсе не излишне, так как в Debian 5 Lenny присутствует как "GCC 4.1", так и "GCC 4.3", и второй указан как используемый по умолчанию. Проверить это элементарно:

# ls -l /usr/bin | grep "gcc-"

....
lrwxrwxrwx 1 root root          7 2010-09-11 11:41 gcc -> gcc-4.3
-rwxr-xr-x 1 root root     226568 2009-01-18 13:44 gcc-4.1
-rwxr-xr-x 1 root root     239000 2009-01-02 06:16 gcc-4.3
....

Видно, что имя "GCC" является символической ссылкой на "GCC 4.3". Как бы то ни было, нас это уже не смущает.

В связи с использованием в продукте модулей, компилируемых для определённой версии ядра, важно понимать то, что обновлять операционную систему с помощью пакетного менеджера будет не так просто. Через пару-тройку крупных обновлений наши модули потеряют связь с реальностью, если можно так выразиться, и не смогут работать с новым ядром. Придётся их периодически перекомпилировать. В общем - здравствуй ночная работа в выходные дни.

Перед установкой сервера заводим пользователя, который будет использоваться как корневой администратор "VMware Server 2":

# useradd --shell /bin/false --home-dir /var/lib/vmware/machines vmware
# passwd vmware

Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

В качестве "домашней директории пользователя" указываем "/var/lib/vmware/machines", там в дальнейшем будет располагаться "домик" для "VMware".

И так, дистрибутив "VMware Server 2" расположился в директории "/usr/src". Распакуем его и запустим на исполнение инсталлятор:

# tar xvfz VMware-server-2.0.2-203138.x86_64.tar.gz
# cd ./vmware-server-distrib
# chmod ug+x ./vmware-install.pl
# ./vmware-install.pl

Далее я привожу листинг всей процедуры инсталляции, больше для того, чтобы после можно было бы обнаружить возможные ошибки в процессе:

Creating a new VMware Server installer database using the tar4 format.

Installing VMware Server.

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

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

What is the directory that contains the init scripts?
[/etc/init.d]

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

In which directory do you want to install the library files?
[/usr/lib/vmware]

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]

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

In which directory do you want to install the documentation files?
[/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]

The installation of VMware Server 2.0.2 build-203138 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".

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]

После того, как инсталляция "VMware Server 2" будет осуществлена, нам предложат запустить конфигуратор. Можно согласится, а можно и нет. В случае отказа можно будет запустить конфигуратор после, в любое время:

# /usr/bin/vmware-config.pl

Making sure services for VMware Server are stopped.

Stopping VMware autostart virtual machines:
   Virtual machines                                                   failed
Stopping VMware management services:
   VMware Virtual Infrastructure Web Access
   VMware Server Host Agent                                           failed
Stopping VMware services:
   VMware Authentication Daemon                                        done
   Virtual machine monitor                                             done

You must read and accept the End User License Agreement to continue.
Press enter to display it.

На запрос скрипта вводим полученный нами ранее с сайта http://www.vmware.com/ серийный регистрационный номер продукта, примерно такого формата:

XXXXX-XXXXX-XXXXX-XXXXX

Внимательно, очень внимательно читаем пользовательское соглашение.

Далее следует предложение скомпилировать несколько модулей ядра, от которого мы не сможем отказаться:

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]

Нас уведомят об использовании определённой версии компилятора, спросят, там ли лежит то, что нужно:

Using compiler "/usr/bin/gcc-4.1". Use environment variable CC to override.

What is the location of the directory of C header files that match your running
kernel? [/lib/modules/2.6.26-2-amd64/build/include]

Extracting the sources of the vmmon module.

Building the vmmon module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmmon-only'
make -C /lib/modules/2.6.26-2-amd64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.26-2-amd64'
  CC [M]  /tmp/vmware-config0/vmmon-only/linux/driver.o
  CC [M]  /tmp/vmware-config0/vmmon-only/linux/driverLog.o
  CC [M]  /tmp/vmware-config0/vmmon-only/linux/hostif.o
  CC [M]  /tmp/vmware-config0/vmmon-only/common/comport.o
  CC [M]  /tmp/vmware-config0/vmmon-only/common/cpuid.o
  CC [M]  /tmp/vmware-config0/vmmon-only/common/hashFunc.o
  CC [M]  /tmp/vmware-config0/vmmon-only/common/memtrack.o
  CC [M]  /tmp/vmware-config0/vmmon-only/common/phystrack.o
  CC [M]  /tmp/vmware-config0/vmmon-only/common/task.o
  CC [M]  /tmp/vmware-config0/vmmon-only/common/vmx86.o
  CC [M]  /tmp/vmware-config0/vmmon-only/vmcore/moduleloop.o
  LD [M]  /tmp/vmware-config0/vmmon-only/vmmon.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/vmware-config0/vmmon-only/vmmon.mod.o
  LD [M]  /tmp/vmware-config0/vmmon-only/vmmon.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.26-2-amd64'
cp -f vmmon.ko ./../vmmon.o
make: Leaving directory `/tmp/vmware-config0/vmmon-only'
The vmmon module loads perfectly into the running kernel.

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

Extracting the sources of the vmci module.

Building the vmci module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmci-only'
make -C /lib/modules/2.6.26-2-amd64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.26-2-amd64'
  CC [M]  /tmp/vmware-config0/vmci-only/linux/driver.o
  CC [M]  /tmp/vmware-config0/vmci-only/linux/driverLog.o
  CC [M]  /tmp/vmware-config0/vmci-only/linux/vmciKernelIf.o
  CC [M]  /tmp/vmware-config0/vmci-only/common/vmciContext.o
  CC [M]  /tmp/vmware-config0/vmci-only/common/vmciDatagram.o
  CC [M]  /tmp/vmware-config0/vmci-only/common/vmciDriver.o
  CC [M]  /tmp/vmware-config0/vmci-only/common/vmciDs.o
  CC [M]  /tmp/vmware-config0/vmci-only/common/vmciEvent.o
  CC [M]  /tmp/vmware-config0/vmci-only/common/vmciGroup.o
  CC [M]  /tmp/vmware-config0/vmci-only/common/vmciHashtable.o
  CC [M]  /tmp/vmware-config0/vmci-only/common/vmciProcess.o
  CC [M]  /tmp/vmware-config0/vmci-only/common/vmciQueuePair.o
  CC [M]  /tmp/vmware-config0/vmci-only/common/vmciResource.o
  LD [M]  /tmp/vmware-config0/vmci-only/vmci.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/vmware-config0/vmci-only/vmci.mod.o
  LD [M]  /tmp/vmware-config0/vmci-only/vmci.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.26-2-amd64'
cp -f vmci.ko ./../vmci.o
make: Leaving directory `/tmp/vmware-config0/vmci-only'
The vmci module loads perfectly into the running kernel.

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

Extracting the sources of the vsock module.

Building the vsock module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vsock-only'
make -C /lib/modules/2.6.26-2-amd64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.26-2-amd64'
  CC [M]  /tmp/vmware-config0/vsock-only/linux/af_vsock.o
  CC [M]  /tmp/vmware-config0/vsock-only/linux/driverLog.o
  CC [M]  /tmp/vmware-config0/vsock-only/linux/util.o
  CC [M]  /tmp/vmware-config0/vsock-only/linux/vsockAddr.o
  LD [M]  /tmp/vmware-config0/vsock-only/vsock.o
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "VMCIDatagram_CreateHnd" [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
WARNING: "VMCIDatagram_DestroyHnd" [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
WARNING: "VMCI_GetContextID" [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
WARNING: "VMCIDatagram_Send" [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
  CC      /tmp/vmware-config0/vsock-only/vsock.mod.o
  LD [M]  /tmp/vmware-config0/vsock-only/vsock.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.26-2-amd64'
cp -f vsock.ko ./../vsock.o
make: Leaving directory `/tmp/vmware-config0/vsock-only'
Unable to make a vsock module that can be loaded in the running kernel:
insmod: error inserting '/tmp/vmware-config0/vsock.o': -1 Unknown symbol in module
There is probably a slight difference in the kernel configuration between the
set of C header files you specified and your running kernel.  You may want to
rebuild a kernel based on that directory, or specify another directory.

The VM communication interface socket family is used in conjunction with the VM
communication interface to provide a new communication path among guests and
host.  The rest of this software provided by VMware Server is designed to work
independently of this feature.  If you wish to have the VSOCK feature  you can
install the driver by running vmware-config.pl again after making sure that
gcc, binutils, make and the kernel sources for your running kernel are
installed on your machine. These packages are available on your distribution's
installation CD.
[ Press the Enter key to continue.]

Далее спросят о желаемой конфигурации сетевого окружения. Не вижу необходимости городить закрытые сети и прятать их за NAT, с этим вполне справляется соответствующее специализированное оборудование обеспечения работы сети. Потому выбираем самую простую конфигурацию прозрачного моста на произвольном интерфейсе:

Do you want networking for your virtual machines? (yes/no/help) [yes]

Configuring a bridged network for vmnet0.

Please specify a name for this network.
[Bridged]

Your computer has multiple ethernet network interfaces available: eth0, eth1.
Which one do you want to bridge to vmnet0? [eth0]

The following bridged networks have been defined:

. vmnet0 is bridged to eth0

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

Do you want to be able to use NAT networking in your virtual machines? (yes/no)
[yes] no

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

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

Конечно же, для этого тоже нужен модуль ядра. Отказать скрипту в его компиляции мы никак не можем:

Extracting the sources of the vmnet module.

Building the vmnet module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config1/vmnet-only'
make -C /lib/modules/2.6.26-2-amd64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.26-2-amd64'
  CC [M]  /tmp/vmware-config1/vmnet-only/driver.o
  CC [M]  /tmp/vmware-config1/vmnet-only/hub.o
  CC [M]  /tmp/vmware-config1/vmnet-only/userif.o
  CC [M]  /tmp/vmware-config1/vmnet-only/netif.o
  CC [M]  /tmp/vmware-config1/vmnet-only/bridge.o
  CC [M]  /tmp/vmware-config1/vmnet-only/filter.o
  CC [M]  /tmp/vmware-config1/vmnet-only/procfs.o
  CC [M]  /tmp/vmware-config1/vmnet-only/smac_compat.o
  CC [M]  /tmp/vmware-config1/vmnet-only/smac.o
  CC [M]  /tmp/vmware-config1/vmnet-only/vnetEvent.o
  CC [M]  /tmp/vmware-config1/vmnet-only/vnetUserListener.o
  LD [M]  /tmp/vmware-config1/vmnet-only/vmnet.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/vmware-config1/vmnet-only/vmnet.mod.o
  LD [M]  /tmp/vmware-config1/vmnet-only/vmnet.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.26-2-amd64'
cp -f vmnet.ko ./../vmnet.o
make: Leaving directory `/tmp/vmware-config1/vmnet-only'
The vmnet module loads perfectly into the running kernel.

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

Please specify a port for standard http connections to use [8222]

Please specify a port for secure http (https) connections to use [8333]

Считаю, что использовать для администрирования приложения реквизиты одного из рядовых пользователей или администраторов системы - плохо (бяка, брось!). Укажем для этого специального, ранее созданного, пользователя "vmware":

The current administrative user for VMware Server  is ''.  Would you like to
specify a different administrator? [no] yes

Please specify the user whom you wish to be the VMware Server administrator
vmware

Using vmware as the VMware Server administrator.

Далее нас спросят, где мы хотели бы расположить "хранилище виртуальных машин". В принципе, предложение конфигуратора вполне приемлимо; чуть изменим его, дабы исключить пробел из имени. Важно понимать то, что "VMware Server 2" будет использовать этот адрес как свою "домашнюю директорию", выше которой ему не полагается выходить. Из этого следует то, что, если нам понадобится установить операционную систему с ISO образа, то установочный ISO должен будет располагаться именно в указанной директории:

In which directory do you want to keep your virtual machine files?
[/var/lib/vmware/Virtual Machines]  /var/lib/vmware/machines

The path "/var/lib/vmware/machines" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes]

Потом конфигуратор проявит самодеятельность и установит набор "VIX API", который нам не особо то и нужен:

Creating a new VMware VIX API installer database using the tar4 format.

Installing VMware VIX API.

In which directory do you want to install the VMware VIX API binary files?
[/usr/bin]

In which directory do you want to install the VMware VIX API library files?
[/usr/lib/vmware-vix/lib]

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

In which directory do you want to install the VMware VIX API document pages?
[/usr/share/doc/vmware-vix]

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

The installation of VMware VIX API 1.6.2 build-203138 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-vix.pl".

Поздравления терпеливым. Ура! Вот, что значит "сервис под ключ". Практически везде мы просто соглашались с предлагаемым и получили в итоге полностью работоспособный сервис.

Enjoy,

--the VMware team

Starting VMware services:
   Virtual machine monitor                                             done
   Virtual machine communication interface                             done
   Virtual ethernet                                                    done
   Bridged networking on /dev/vmnet0                                   done
   VMware Server Authentication Daemon (background)                    done
   Shared Memory Available                                             done
Starting VMware management services:
   VMware Server Host Agent (background)                               done
   VMware Virtual Infrastructure Web Access
Starting VMware autostart virtual machines:
   Virtual machines                                                    done

The configuration of VMware Server 2.0.2 build-203138 for Linux for this
running kernel completed successfully.

Инсталляция "VMware Server 2 как такового - завершена.

Теперь можно насладится "тормозами" web-интерфейса, построенном на Java HTTP сервере "Tomcat". Используем для этого браузер, обратившись по адресу: "https://ip.address:8333/ui/#" или "http://ip.address:8222/ui/#".


Заметки и комментарии к публикации:


Оставьте свой комментарий ( выразите мнение относительно публикации, поделитесь дополнительными сведениями или укажите на ошибку )