特殊:Badtitle/NS100:VMware/Server

来自Ubuntu中文
Wikibot留言 | 贡献2009年5月14日 (四) 17:58的版本
跳到导航跳到搜索

{{#ifexist: :VMware/Server/zh | | {{#ifexist: VMware/Server/zh | | {{#ifeq: {{#titleparts:VMware/Server|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:VMware/Server|1|-1|}} | zh | | }}

VMware Server is a proprietary virtualization software package made available for no cost from the VMware website. VMware Server allows you to run entire operating systems in a virtual machine, which run on top of Ubuntu. This guide provides instructions on installing, configuring and running VMware Server and VMware Server Console on Ubuntu. VMware server may be used on Desktop and Server editions of Ubuntu.

Installation and Quick Start

Ubuntu 9.04 (VMWare Server 2.0.1 Build 156745)

There is no package yet available. You can download it at http://www.vmware.com/go/getserver

  1. Get a serial number (displayed at the download page link received by email as part of the registration process)
  2. Download the tar.gz file to your home directory
  3. Install required packages
sudo apt-get install build-essential linux-headers-`uname -r`

4.#4 Download the required patch at http://ubuntuforums.org/attachment.php?attachmentid=94477&d=1227872015 and save in your home directory

  1. Unpack, apply patch and run vmware-install.pl
cd ~
tar zxvf VMware-server-2.0.0-122956.i386.tar.gz

cd vmware-server-distrib
sudo patch ./bin/vmware-config.pl ~/vmware-config.pl.patch.txt
sudo ./vmware-install.pl

6.#6 Follow the settings displayed at your screen and don't change default values if not necessary. Be sure to add your normal username as VMware Server administrator

  1. Enter the serial number when prompted
  2. Vmware2 has a web interface. Browse with Firefox to http://localhost:8222.
  3. Log in with your normal username and password

Note: You can also access the web interface via SSL at https://localhost:8333. You will probably need to add this site to your SSL Exception sites on your browser.

Ubuntu 8.10 (VMWare Server 2.0.0 Build 122956)

There is no package yet available. You can download it at http://www.vmware.com/go/getserver

  1. Get a serial number (displayed at the download page link received by email as part of the registration process)
  2. Download the tar.gz file to your home directory
  3. Install required packages
sudo apt-get install build-essential linux-headers-`uname -r`

4.#4 Download the required patch at http://ubuntuforums.org/attachment.php?attachmentid=94477&d=1227872015 and save in your home directory

  1. Unpack, apply patch and run vmware-install.pl
cd ~
tar zxvf VMware-server-2.0.0-122956.i386.tar.gz

cd vmware-server-distrib
sudo patch ./bin/vmware-config.pl ~/vmware-config.pl.patch.txt
sudo ./vmware-install.pl

6.#6 Follow the settings displayed at your screen and don't change default values if not necessary. Be sure to add your normal username as VMware Server administrator

  1. Enter the serial number when prompted
  2. Vmware2 has a web interface. Browse with Firefox to http://localhost:8222.
  3. Log in with your normal username and password

Note: You can also access the web interface via SSL at https://localhost:8333. You will probably need to add this site to your SSL Exception sites on your browser.

Ubuntu 8.04 (VMWare Server 2.0.0 Build 116503)

There is no package yet available. You can download it at http://www.vmware.com/go/getserver

  1. Get a serial number (displayed at the download page link received by email as part of the registration process)
  2. Download the tar.gz file
  3. Install the build package
sudo apt-get install build-essential linux-headers-`uname -r`

4.#4 Unzip and run vmware-install.pl

  1. Follow the settings displayed at your screen and don't change default values if not necessary. Be sure to add your normal username as VMware Server administrator
  2. Enter the serial number when prompted
  3. Vmware2 has a web interface. Browse with Firefox to http://localhost:8222.
  4. Log in with your normal username and password

Note: You can also access the web interface via SSL at https://localhost:8333. You will probably need to add this site to your SSL Exception sites on your browser.

Ubuntu 8.04 (Vmware Server 1.0.6 Stable !)

Note: This will take care of uninstalling any old version of VMWare server you might have, while keeping the virtual machines and their settings intact.

  1. Prep ~. Install the needed tools.
sudo apt-get install build-essential linux-headers-`uname -r` xinetd

2.#2 Download vmware server (be sure to obtain a serial number) Place it in a safe directory ( I use ~/src/VMWare) and extract.

mkdir -p ~/src/VMWare #Download VMWare files here

3.#3 Extract and install VMWare Server.

cd ~/src/VMWare
tar xzf VMware-server-1.0.6-91891.tar.gz

cd ~/src/VMWare/vmware-server-distrib
sudo ./vmware-install.pl
  • Select defaults.
  • Enter your serial # during the installation.

4.#4 Post-install configuration. Last, before running vmware :

sudo cp /lib/libgcc_s.so.1 /usr/lib/vmware/lib/libgcc_s.so.1
sudo cp /usr/lib/libpng12.so.0 /usr/lib/vmware/lib/libpng12.so.0

5.#5 In addition, for 64 bit users only,

sudo apt-get install ia32-libs
sudo ln -s /usr/lib32 /usr/l32
sudo sed -i -e 's:usr/lib/:usr/l32/:g'  /usr/lib32/gtk-2.0/2.10.0/loader-files.d/libgtk2.0-0.loaders
sudo sed -i -e 's:usr/lib/:usr/l32/:g' /usr/lib32/libgdk_pixbuf-2.0.so.0.1200.9

Ubuntu 7.10 (Gutsy Gibbon)

From Ubuntu packages

  1. Get a free serial number by registering your product here.
  2. Add the following line to your /etc/apt/sources.list
 deb http://archive.canonical.com/ubuntu gutsy partner
  1. Install the vmware-server package
  2. Follow the instructions in the installer wizard
  3. At least the 64-bit version of ubuntu-server 7.10 is affected by bug #112937. The fix provided by Walter in the bug report does the trick.

Ugly Source + Patch Method

Note: amd64 users will need to add ia32-libs. This can be found in Synaptic.

sudo apt-get install build-essential linux-headers-`uname -r` xinetd
wget http://download3.vmware.com/software/vmserver/VMware-server-1.0.3-44356.tar.gz
wget http://knihovny.cvut.cz/ftp/pub/vmware/vmware-any-any-update115.tar.gz
tar -xzvf VMware-server-1.0.3-44356.tar.gz
tar -xzvf vmware-any-any-update115.tar.gz
cp vmware-any-any-update115/*.tar vmware-server-distrib/lib/modules/source/
cd vmware-server-distrib/
sudo mkdir -p /etc/vmware/ssl
sudo touch /etc/vmware/ssl/rui.key
sudo touch /etc/vmware/ssl/rui.crt
sudo ./vmware-install.pl

Ubuntu 7.04 (Feisty Fawn)

From Ubuntu packages

  1. Get a serial number by registering (for free) at http://register.vmware.com/content/registration.html
  2. Add the universe, multiverse, and commercial repositories to your Ubuntu 7.04 install Directions.
  3. Uninstall vmware-server if it is already installed according to the section in this document titled "Transitioning from a Source Install."
  4. Install the vmware-server package
  5. Until bug #115295 is fixed, you might need to edit /etc/pam.d/vmware-authd to read as follows:
#%PAM-1.0
auth required pam_unix_auth.so shadow nullok
account required pam_unix_acct.so
  1. Start the remote access console by going to Applications > System Tools > VMWare Server Console in the menus (or run vmware from the command line). From there you will be able to access vmware servers locally or remotely, and create/open VMware virtual machines. Login with your regular username and password.

For troubleshooting see the troubleshooting section in this document.

Installing VMware Tools on an Ubuntu VMware guest system

Installing VMware Tools inside your virtual machines can improve their performance. For information about speeding up your Ubuntu virtual machines see VMware/Tools

Other Topics

Installing from Source

These instructions have not been fully tested and are recommended for advanced users only.

  • Ubuntu 8.04 (Hardy Heron)

Run [1] after the initial install fails when compiling kernel modules. AMD64 users may get this error

/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_***' not found

Install Getlibs and enter the following commands.

getlibs /usr/lib/vmware/bin/vmware
sudo mv /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1 /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1-old
sudo ln -s /usr/lib32/libgcc_s.so.1 /usr/lib/vmware/lib/libgcc_s.so.1/
  • Ubuntu 7.04 (Feisty Fawn)

Run [2]] after the install fails when compiling kernel modules. See [Install VMWare Server To Ubuntu Feisty for other solutions. A more elegant solution here would be much appreciated, as the diff between the current kernel modules provided by vmware and the modules in that .tar.gz is substantial.

  • Ubuntu 6.06 LTS (Dapper Drake)
  • Ubuntu 6.10 (Edgy Eft)
  1. Download the VMware Server Binary (.tar.gz) package for Linux from the VMware website. You will also need to register to receive the free-of-charge serial number which is required during installation.
  2. Enable the universe software channel (see Repositories for instructions).
  3. (Optional) switch from 386 kernel to 686 kernel and reboot
  4. (Optional) If you using Edubuntu as your host OS then you might want to un-install
  • SchoolTool (aptitude remove schooltool) Since it uses 119M in its idle state.
  • LTSP (aptitude remove ltsp-server-standalone) So you can remove DHCPD
  • DHCPD (aptitude remove dhcp3-server) How many DHCP servers do you need ?
  1. Install the following packages:
  • build-essentials
  • linux-headers
  • xinetd

1.

 sudo aptitude install build-essential linux-headers-`uname -r` xinetd

The second package is the linux-headers- package for your currently-installed kernel; the uname -r part will automatically insert your kernel version for you. to install two required packages. If you are using the server edition then you also need to install the following 3 X libraries and their dependencies.

  • libxtst6
  • libxt6
  • libxrender1
sudo aptitude install libxtst6 libxt6 libxrender1
  1. Once you have installed the required packages, you can now begin the VMware installer. Open a Terminal and type the following:
cd <temporary-location-with-disk-space>
tar zxvf /<download-location>/VMware-server-<xxx>.tar.gz
cd vmware-server-distrib/
sudo ./vmware-install.pl

Replace <download-location> with the path of the directory where you saved the archive, and replace <xxx> with the version number of the package you downloaded. The VMware installer program will be started in the Terminal window. 1.#6 Follow the on-screen instructions. You can leave most of the options as their defaults, by pressing the Return key and not typing anything after each question.

  • Ed/K/X/Ubuntu 7.04 (Feisty Fawn)
  1. Download the VMware Server Binary (.tar.gz) package for Linux from the VMware website. Also, register to receive the free serial number which is required for registration.
  2. Install the following packages:
  • vmware-server-kernel-modules
  • xinetd
  • build-essential
  • linux-headers
  1. Once you have installed the required packages, you can now begin the VMware installer. Open a Terminal and type the following:
cd <location>
tar zxvf VMware-server-<xxx>.tar.gz
cd vmware-server-distrib/
sudo ./vmware-install.pl

Replace <location> with the path of the directory where you saved the archive, and replace <xxx> with the version number of the package you downloaded. The VMware installer program will be started in the Terminal window. 1.#4 Follow the on-screen instructions. You can leave most of the options as their defaults, by pressing the Return key and not typing anything after each question. The configuration script will fail, but we'll use a workaround.

  1. Reconfigure step. Make VMware server use feisty's modules:
sudo sed -i -e "s/\/sbin\/insmod -s -f \"\/lib\/modules\/\`uname -r\`\/misc\/\$1.o\"/modprobe -s -f \$1/" /etc/init.d/vmware
sudo sed -i -e "s/sub configure_module {/sub configure_module {\n return 'yes';/" /usr/bin/vmware-config.pl
sudo vmware-config.pl
sudo /etc/init.d/vmware restart

Uninstalling Source Installs

VMware Server installs with the web management console

$ sudo vmware-uninstall-mui.pl

VMware Server installs from source may be removed by running the following command:

$ sudo vmware-uninstall.pl

If you experience problems during the uninstall, remove ~/.vmware and retry the steps above. You may also wish to remove your virtual machines by removing /var/lib/vmware. It is also recommended that you remove

Transitioning from a Source Install

  1. Follow the directions in the "Uninstalling Source Installs" section of this document, but do not remove the /var/lib/vmware directory.
  2. Follow the directions in the "Installation and Quick Start" section.
  3. Move files from /var/lib/vmware to /var/lib/vmware-server and then remove the empty /var/lib/vmware directory.
  4. Reregister your existing virtual machines by running vmware-cmd -s register /var/lib/vmware-server/Virtual\ Machines/machinename/diskname.vmx
  5. Start any needed virtual machines using the management console. It is best to do this from the console instead of restarting because it will detect that you have moved the virtual machines and offer to regenerate the machine's unique identifiers, which you should decline to do.

VMware Server MUI Component Installation (Optional, Source Install Only)

If you would like VMware ESX-style web-access for configuration of your server, you can install the VMware MUI component, available from the VMware website. After having downloaded the package, open a Terminal and run the following commands:

cd <location>
tar zxvf VMware-mui-<xxx>.tar.gz
sudo ./vmware-install.pl

Replace <location> with the path of the directory where you saved the archive, and replace <xxx> with the version number of the package you downloaded. An installer program will be run. Follow the installer's instructions. Once installation has completed, run the following commands in a Terminal:

sudo /etc/init.d/httpd.vmware start
sudo /etc/init.d/httpd.vmware restart
sudo /etc/init.d/httpd.vmware status

The VMware MUI component should now be available at

http://localhost:8222/

which should automatically redirect you to

https://localhost:8333/

Next from the same or a separate client machine login to this page and chose the most appropriate install program from the selection labeled : Download VMware Server Console Use Synaptic/Adept to remove the package. Note: If you receive a "starting httpd.vmware:-ne failed" error at the end of running vmware-config-mui.pl you will need to run the following command. /bin/sh is a symlink to /bin/dash, however we need /bin/bash, not /bin/dash. Therefore we do this, and then run vmware-config-mui.pl again:

sudo ln -s -f /bin/bash /bin/sh
sudo vmware-config-mui.pl

VMware Server Console Installation (Optional, Source Install Only)

By default, the VMware Server Console is installed on the same computer as VMware Server. However, it is possible to install the application on other computers and use it to access your VMware Server remotely. Installers are available for other operating systems, such as Windows. You can download the console package only from [3] and click one which version you require. Within the next page you can download the console only zip file. To download the file:

wget http://download3.vmware.com/software/vmserver/VMware-server-linux-client-1.0.6-91891.zip

If installing the console on Ubuntu, open a Terminal and type the following commands:

cd <location>
tar zxvf VMware-server-console-<xxx>.tar.gz
cd vmware-server-console-distrib/
sudo ./vmware-install.pl

Replace <location> with the path of the directory where you saved the archive, and replace <xxx> with the version number of the package you downloaded. After having run the installer, press Alt + F2, type gksudo vmware and press Run to start the Server Console application. If you are getting an error similar to the following when trying to run the console (probably hardy-specific):

/.../lib/vmware-server-console/bin/vmware-server-console: /.../lib/vmware-server-console/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4' not fou.2)

Use the following command:

cd /usr/lib/vmware-server-console/lib/ && sudo mv libgcc_s.so.1 libgcc_s.so.1.org && sudo mv libpng12.so.0 libpng12.so.0.org

If this fails, you may try copying the 'missing' file from /usr/lib/gcc/i486-linux-gnu/3.4.6/ and replacing the one distributed with the vmware server console. If you get similar error on libpng12.so.0, the file is placed in /usr/lib. You of course have to have the appropriate packages (gcc-3.4, libpng12) installed.

Running Other Operating Systems From Physical Partitions (Optional)

  1. To run regular virtual machines from files, no additional setup is needed. However, to be able to run operating systems from physical partitions, your user needs to be part of the disk group.
  2. Never use this mode unless you have a boot loader such as GRUB installed. Reloading the currently running Ubuntu system from VMware will likely corrupt your partition, so always load different Operating Systems from VMWare.

Additional explanations

Troubleshooting

  • Error: When I try to install VMware Server, I get the following error message:
    A previous installation of a VMware product has been detected.
    If you installed it from the VMware website, please remove it by running vmware-uninstall.pl before proceeding.
    If it was installed through Ubuntu, you must purge (completely remove) the old package.

Solution: First of all, ensure that you "Completely Removed" vmware-player/vmware-server and all its modules. To ensure that, run the following command:

    sudo aptitude purge vmware-server vmware-player vmware-tools-kernel-modules

If you still keep getting the above error, run the following command:

    sudo rm -r /etc/vmware*

Source: [4]

  • Error: If you do not have an eth0 interface, you might be affected by bug #112492
  • Error: When I try to connect with the VMware Server Console, I get the following error message:
    Connection refused.

Solution: VMware should be listening on port 902. To test the connection, use telnet:

       telnet <ip-of-vmware-server> 902

You should see something like the following:

       220 VMware Authentication Daemon Version 1.10: SSL Required, MKSDisplayProtocol:VNC

If not, you might need to (re)install xinetd. Do this with:

       aptitude install xinetd

or (if it's already installed)

       aptitude reinstall xinetd

Then you can run vmware-config-network.pl or reinstall the vmware-server package to kick things into place.

  • Error: When I try to start a VM, I get the following error message:
    Unable to connect to the MKS: You need execute access in order to connect with the VMware Server Console. Access denied for config file: /path/to/config/file.vmx.

Solution: The .vmx file needs to be executable. Make sure that you have permissions to create the file and to make it executable. The filesystem that the file resides on must not be mounted with the noexec flag.

  • Error: When I enter the license key I get the following error message:
    /usr/lib/vmware/bin/vmware-vmx: error while loading shared libraries: libXtst.so.6 (or libXt.so.6): cannot open shared object file: No such file or directory
Please enter your 20-character serial number.

Solution: sudo apt-get install libxtst6 libxt6

Additional Resources