≡ Menu

vmware server

By default vSphere does not provide client for Linux or OS X. You need to use Windows system to manage your VMware ESX server. However, it does provides vSphere Web Access which allows you to organize and share virtual machines using web browser. If you try to access vSphere Web Access you may get an error which read as follows:

503 Service Unavailable

You can fix this problem as follows.
[click to continue…]

You can easily start / stop / pause or take a snapshot from a shell prompt under a Linux / Windows host using vmrun command. This is useful if you do not want to run web interface for starting and/or stopping VMs.

vmrun commands

vmrun -u USER -h 'https://vmware.server.com:8333/sdk' -p PASSWORD COMMAND [PARAMETERS]
OR
vmrun -u USER -h 'https://vmware.server.com:8333/sdk' -p PASSWORD start "[storage] Path/to/.vmx"

Where,
=> -u USER : VMWare server username

=> -h 'https://vmware.server.com:8333/sdk' : Local or remote server FQDN / IP address

=> -p PASSWORD : VMWare server password

=> COMMAND [PARAMETERS] : Command can be any one of the following:

POWER COMMANDS           PARAMETERS           DESCRIPTION
--------------           ----------           -----------
start                    Path to vmx file     Start a VM
                         [gui|nogui]
stop                     Path to vmx file     Stop a VM
                         [hard|soft]
reset                    Path to vmx file     Reset a VM
                         [hard|soft]
suspend                  Path to vmx file     Suspend a VM
                         [hard|soft]
pause                    Path to vmx file     Pause a VM
unpause                  Path to vmx file     Unpause a VM

Start a VM called CentOS

To start a virtual machine with Vmware server 2.0 on a Linux host, stored on storage called iscsi:
vmrun -T server -h 'https://vms.nixcraft.in:8333/sdk' -u root -p 'secrete' start "[iSCSI] CentOS52_64/CentOS52_64.vmx"
To start a virtual machine with Workstation on a Windows host (open command prompt by visiting Start > Run > cmd > [enter] key):
vmrun -T ws start "c:\My VMs\centos\centos.vmx"

Stop a VM called CentOS

To stop a virtual machine with Vmware server 2.0 on a Linux host, stored on storage called iscsi:
vmrun -T server -h 'https://vms.nixcraft.in:8333/sdk' -u root -p 'secrete' stop "[iSCSI] CentOS52_64/CentOS52_64.vmx"

Reset a VM called Debian

To reset a virtual machine with Vmware server 2.0 on a Linux host, stored on storage called DISK3:
vmrun -T server -h 'https://sun4k.nixcraft.co.in:8333/sdk' -u root -p 'secrete' reset "[DISK3] Debian5/Debian5.vmx"

Update: Vmware sever 2.0 final has been released. Version 2.0 has updated version for Firefox 3.0.x series.

VMWare remote console plugin allows to control VMWare server 2.0RC1. However, when you upgrade Firefox to 3.0.1 it will not work or get disabled by Firefox 3.0.1 due to plug-in compatibility issue. To fix this issue shutdown your Firefox, locate a directory called VMwareVMRC@vmware.com. This hack tested on:
=> Linux running Firefox 3.0.1

=> VMware Remote Console Plug-in version 2.5.0.100265

Open a shell prompt and type the following commands:
$ cd ~/.mozilla/
$ find . -type d -iname "VMwareVMRC@vmware.com"

Sample output:

./firefox/szvrcz3m.default/extensions/VMwareVMRC@vmware.com

Change the directory, enter:
$ cd ./firefox/szvrcz3m.default/extensions/VMwareVMRC@vmware.com
Open install.rdf
$ cp install.rdf ~/install.rdf.bak
$ vi install.rdf

Find line that read as follows:

<em:maxVersion>3.0.0.*</em:maxVersion>

Replace it with:

<em:maxVersion>3.0.1.*</em:maxVersion>

Save and close the file. Open Firefox and plug-in should work without a problem.
(Fig.01: Running VMWare Server Remote Console Plugin under Updated Firefox v3.0.1)

You can easily list all running Virtual machines from a Linux shell prompt without accessing GUI. This is useful to scripts or to get status for any VM.

vmrun is a command line application for controlling various VM operations. Type the following command:
vmrun -T server -h 'https://vmserver.example.com:8333/sdk' -u VMUSERName -p 'yourVMPassword' list
Where,
=> -T server : This is VMWARE server version 2.x

=> -h 'https://vmserver.example.com:8333/sdk' : VMWare server hostname. This can be local or remote server.

=> -u VMUSERName : VMWare server username (usually it is root)

=> -p 'yourVMPassword' : VMWare server password

=> list : List all running vms

List all running VMs

vmrun -T server -h 'https://server.nixcraft.in:8333/sdk' -u root -p 'myPassword' list
Sample output:

Total running VMs: 2
[DISK315k] Debian5/Debian5.vmx
[DISK315k] CentOS52_64/CentOS52_64.vmx

Listing a virtual machine with Workstation on a Windows host (open dos prompt and type the command):
vmrun -T ws list
OR
vmrun -T ws -gu guestUser -gp guestPassword list

How to: Upgrade VMWARE Server under Linux

Build 56528 is a release build of VMware Server 1.0.4. It is a maintenance bug fix release to address security issues. Upgrading VMWare server is a piece of cake under Redhat Enterprise Linux / CentOS Linux version 5.0.

Please note that following instructions are tested on RHEL 4.5, 5.0 and CentOS Linux 5.0 only. You can use tar ball based package to upgrade vmware under Debian Linux.

Find out current VMware server version

First find out current vmware server version, enter:
# vmware -v
Output:

VMware Server 1.0.3 build-44356

You can download the latest version from official site.

Shutdown all VMWARE guest oses / vps

Login to each running VM and bring down (halt) guest operating system. You can also use vmware server console or web based interface for the same purpose.
Stop VMWARE Server:
# /etc/init.d/vmware stop
Output:

Stopping VMware services:
   Virtual machine monitor                                 [  OK  ]
   Bridged networking on /dev/vmnet0                       [  OK  ]
   Virtual ethernet                                        [  OK  ]

Stop VMWARE Webbased interface:
# /etc/init.d/httpd.vmware stop
Output:

   Shutting down http.vmware:                              [  OK  ]

Download VMWARE Server

Use wget the ultimate command line downloader
# cd /tmp
# wget http://download3.vmware.com/software/vmserver/VMware-server-1.0.4-56528.i386.rpm
# wget http://download3.vmware.com/software/vmserver/VMware-mui-1.0.4-56528.tar.gz

Upgrade VMWARE server

Use rpm command to upgrade VMWARE server, enter:
# rpm -Uvh VMware-server-1.0.4-56528.i386.rpm
Output:

Preparing...                ########################################### [100%]
   1:VMware-server          ########################################### [100%]

Reconfigure VMWARE Server

Just reconfigure Vmware server with old values/options:
# vmware-config.pl
Just accept accept the End User License Agreement and press CTRL+C. Now configure server with old values:
# vmware-config.pl -d
Output:

aking sure services for VMware Server are stopped.
Stopping VMware services:
   Virtual machine monitor                                 [  OK  ]
   Bridged networking on /dev/vmnet0                       [  OK  ]
   Virtual ethernet                                        [  OK  ]
Configuring fallback GTK+ 2.4 libraries.
In which directory do you want to install the mime type icons?
[/usr/share/icons]
What directory contains your desktop menu entry files? These files have a
.desktop file extension. [/usr/share/applications]
In which directory do you want to install the application's icon?
[/usr/share/pixmaps]
Trying to find a suitable vmmon module for your running kernel.
...........
...
.....
*** Output truncated ***

Upgrade VMware Server Web-based management interface

The VMware Server Web-based management interface. Install on your VMware Server system to enable control from a Web browser. Untar and install the same:
# tar -zxvf VMware-mui-1.0.4-56528.tar.gz
# cd vmware-mui-distrib/
# perl vmware-install.pl

Just follow on screen instructions to install Web-based management interface. Finally just start all guest oses.

VMware virtualization software is an excllent choice for x86-compatible computers. They have both commercial and free version. I received few email regarding VMWARE on 64 bit Linux. Installing VMWARE server on CentOS 5 or Red hat enterprise Linux 64 bit version is a tricky business. In this small howto I will explain vmware installation on 64 bit Linux server without facing any dependencies problem.

Following instructions are tested on both RHEL 5 and CentOS 5 running 64 bit Intel / AMD hardware and software. My kernel:
$ uname -mrs
Output:

Linux 2.6.18-8.1.6.el5 x86_64

My RHEL 5 release (same kernel for CentOS):
$ cat /etc/redhat-release
Output:

Red Hat Enterprise Linux Server release 5 (Tikanga)

Make sure you have following software installed:

  • Full gcc compiler and development environment
  • Kernel headers and devel packages for current kernel (i.e. kernel-headers and kernel-devel)

[click to continue…]

Vmware server comes with the nifty vmware-cmd utility. It allows an administrator to perform various operations on a virtual machine from Linux command line / shell prompt such as:

=> Stop / Start VM

=> Get VM status

=> Setup variables

=> Powerdown VM and much more

Task: Lists the virtual machines on the local server

You can list all servers and config file, enter:
# vmware-cmd -l
Output:

/nas/vms/Ubuntu/Ubuntu.vmx
/nas/vms/FreeBSD/FreeBSD.vmx
/nas/vms/OpenBSD/OpenBSD.vmx
/nas/vms/Debian4/Debian4.vmx
/nas/vms/CentOS5/CentOS5.vmx

Turn on VM / Power up VPS

Just pas start option to vmware-cmd,
# vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx start

To stop VM/VPS, enter:
# vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx stop

To reset VM/VPS, enter:
# vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx reset

To suspend VM/VPS, enter:
# vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx suspend

Find out if OpenBSD VM is on or off:
# vmware-cmd /disk2.vmware/vms/OpenBSD/OpenBSD.vmx getstate
Output:

getstate() = off

vmware-cmd offers other options, please consult VMWARE documentation for more information.