Showing posts with label vmware. Show all posts
Showing posts with label vmware. Show all posts

10 April, 2009

VMware Remote Console -- Command Line

I've been investigating thin-client connectivity to virtual machines with VMware Server 2.0.

While the console available through the web interface is pretty responsive, I've got a need to restrict the VM configuration from the user. I figured there was a means to kick off the console independent of the web interface, but hadn't found it...'til now.


/home/user/.mozilla/firefox/6lk37syc.default/extensions/VMwareVMRC@vmware.com/plugins/vmware-vmrc -X -h localhost:8333 -u vmadmin -p adminpassword "[standard] WinXp/WinXp.vmx"



That'll start a full screen console where VMware Server is running locally. Should apply remotely as well, but does require installation of the VDI on the client (i.e. connect via the web interface at least once).

Cool Beans.

06 April, 2009

VmRun Command

I've been recently tailoring a WinXp virtual machine to accelerate the OS initialization. To measure the impacts I've created a script that repeatedly times the starting of the VM. In particular, I'm measuring how long it takes between initiated startup and the time it takes before I can ping the virtual machine.

The first challenge was to decode the vmware-cmd (now vmrun) syntax. The following is an example of how you can start a virtual machine.


vmrun -T 127.0.0.1 -h 'https://127.0.0.1:8333/sdk' -u vmadmin -p 'vmadminpassword' start "[standard] JltvWinXp/JltvWinXp.vmx"

15 February, 2009

VMWare Server Installation

I've been sucessfully running VmWare Server 2.0 on my Debian 4.0 workstation for the past couple months. Since I had a couple hic-ups during the installation I figure I'll document them here for my own personal use and the use of others.

1.Perform fresh installation of Debian 4.0

2.Change Web Browser Preferences to utilize IceWeasel (necessary for web-enabled UI)

3.Install necessary packages
  • xion:/var/tmp# apt-get install binutils-doc make manpages-dev autoconf automake1.9 libtool flex bison gdb gcc g++ linux-headers-`uname -r`
4.Enable sound card channel
  • xion $ alsamixer (analog F channel)
5.Download VMWare Server 2.0 (http://www.vmware.com/download/server/)
6.Untar server archive
  • xion:/var/tmp# tar -zxvf /media/usb0/VMware-server-2.0.0-122956.x86_64.tar.gz
7.Install VMWare Server
xion:/var/tmp/vmware-server-distrib# ./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.0 build-122956 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]

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.

NOTICE: BY DOWNLOADING AND INSTALLING, COPYING OR OTHERWISE USING THE
SOFTWARE, YOU AGREE TO BE BOUND BY THE TERMS OF THIS VMWARE MASTER END
USER LICENSE AGREEMENT ("EULA"). IF YOU DO NOT AGREE TO THE TERMS OF
THIS EULA, YOU MAY NOT DOWNLOAD, INSTALL, COPY OR USE THE SOFTWARE, AND
YOU MAY RETURN THE UNUSED SOFTWARE TO THE VENDOR FROM WHICH YOU ACQUIRED
IT WITHIN THIRTY (30) DAYS AND REQUEST A REFUND OF THE LICENSE FEE, IF
ANY, ALREADY PAID UPON SHOWING PROOF OF PAYMENT. "YOU" MEANS THE
NATURAL PERSON OR THE ENTITY THAT IS AGREEING TO BE BOUND BY THIS EULA,
THEIR EMPLOYEES AND THIRD PARTY CONTRACTORS THAT PROVIDE SERVICES TO
YOU. YOU SHALL BE LIABLE FOR ANY FAILURE BY SUCH EMPLOYEES AND THIRD
PARTY CONTRACTORS TO COMPLY WITH THE TERMS OF THIS AGREEMENT.

1. DEFINITIONS

1.1 "Designated Administrative Access" means that access to the
standard user interfaces of a given instance of the Software
(designated in this section) that you may grant to a designated
third party (a) for which you have provided advance written notice
to VMware that you are providing outsourced services and (b) for
whose dedicated benefit you have licensed such instance of the
Software. Designated Administrative Access is applicable only
where you are 1) an IT outsourcing company that is providing
outsourced IT services to a client company and 2) applicable only

Do you accept? (yes/no) yes

Thank you.

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". 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.18-6-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.18-6-amd64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.18-6-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
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.18-6-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.18-6-amd64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.18-6-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
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.18-6-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.18-6-amd64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.18-6-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
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.18-6-amd64'
cp -f vsock.ko ./../vsock.o
make: Leaving directory `/tmp/vmware-config0/vsock-only'
The vsock module loads perfectly into the running kernel.

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]

The following bridged networks have been defined:

. vmnet0 is bridged to eth0

All your ethernet interfaces are already bridged.

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

Configuring a NAT network for vmnet8.

Please specify a name for this network. [NAT]

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

Probing for an unused private subnet (this can take some time)...

The subnet 172.16.38.0/255.255.255.0 appears to be unused.

The following NAT networks have been defined:

. vmnet8 is a NAT network on private subnet 172.16.38.0.

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

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

Configuring a host-only network for vmnet1.

Please specify a name for this network.
[HostOnly]

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

Probing for an unused private subnet (this can take some time)...

The subnet 192.168.208.0/255.255.255.0 appears to be unused.

The following host-only networks have been defined:

. vmnet1 is a host-only network on private subnet 192.168.208.0.

Do you wish to configure another host-only network? (yes/no) [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-config0/vmnet-only'
make -C /lib/modules/2.6.18-6-amd64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.18-6-amd64'
CC [M] /tmp/vmware-config0/vmnet-only/driver.o
CC [M] /tmp/vmware-config0/vmnet-only/hub.o
CC [M] /tmp/vmware-config0/vmnet-only/userif.o
CC [M] /tmp/vmware-config0/vmnet-only/netif.o
CC [M] /tmp/vmware-config0/vmnet-only/bridge.o
CC [M] /tmp/vmware-config0/vmnet-only/filter.o
CC [M] /tmp/vmware-config0/vmnet-only/procfs.o
CC [M] /tmp/vmware-config0/vmnet-only/smac_compat.o
CC [M] /tmp/vmware-config0/vmnet-only/smac.o
CC [M] /tmp/vmware-config0/vmnet-only/vnetEvent.o
CC [M] /tmp/vmware-config0/vmnet-only/vnetUserListener.o
LD [M] /tmp/vmware-config0/vmnet-only/vmnet.o
Building modules, stage 2.
MODPOST
CC /tmp/vmware-config0/vmnet-only/vmnet.mod.o
LD [M] /tmp/vmware-config0/vmnet-only/vmnet.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.18-6-amd64'
cp -f vmnet.ko ./../vmnet.o
make: Leaving directory `/tmp/vmware-config0/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]

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

Using root as the VMware Server administrator.

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

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

Please enter your 20-character serial number.

Type XXXXX-XXXXX-XXXXX-XXXXX or 'Enter' to cancel: A8MAJ-FK34X-UCL11-4J3U0

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.0 build-122956 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
VM communication interface socket family: done
Virtual ethernet done
Bridged networking on /dev/vmnet0 done
Host-only networking on /dev/vmnet1 (background) done
DHCP server on /dev/vmnet1 done
Host-only networking on /dev/vmnet8 (background) done
DHCP server on /dev/vmnet8 done
NAT service on /dev/vmnet8 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.0 build-122956 for Linux for this
running kernel completed successfully.

xion:/var/tmp/vmware-server-distrib#


WinXp Setup
1.When configuring a Win VM, configure NIC as bridged device so ip address is on local network, otherwise you won't have visibility to print server
2.Install samba
  • # apt-get install samba
3.xion:/var/tmp# smbpasswd -a user1
4.Configure cdrom to support multimedia demands
  • utilization of ATAPI interface appears too slow to support dvd playback, copy and the like. Configure to use the host device directly

11 January, 2009

Vmware Server 2.0 - VNC Connection

I have VMWare Server 2.0 installed on my Debian machine. I've really been pleased with the performance and flexibility having finally rid myself of a Windows partition (dual-boot) and the need for a Windows-dedicated machine.

While I am impressed with the web-based console interface I have been investigating using VNC as the user interface for work-specific reasons I won't go into. After journeying to the mountain-top of Google I found numerous posting of how to enable the integrated VNC interfacing for VmWare, but found that the referenced posting were a bit vague and in the worst case having typos that resulted in my wondering why it wasn't working. I'll attempt to document how I set up VNC connectivity in detail.

Open the virtual machine and under the Summary tab select Configure VM. You will need to enable VNC connectivity by adding 3 new entries:
  • RemoteDisplay.vnc.enabled = TRUE
  • RemoteDisplay.vnc.password = vncpassword
  • RemoteDisplay.vnc.port = 5900

You can do this through the Advanced tab as follows:







Continue by starting the virtual machine and verifying no errors were detected by examining the Events log. As I hinted earlier, I spent some hours trying to figure out why the VNC connection wasn't working after copying verbatim instructions from a web posting only to find that the web post had a typo. I finally found this by examining the event log.

Now, all you need to do is connect to the VmWare server at the defined port.

I installed xvncviewer on my Debian machine:

# apt-get install xvncviewer
# exit
$ vncviewer 192.168.2.12:5900


Results in:


It's important to understand that you aren't connecting to the VM itself, rather you are connecting to the VmWare Server. Notice that I am running VmWare Server on 192.168.2.12, the same machine I am running vncviewer on, and the VM is configured as 192.168.2.9. The VNC connection is established with 192.168.2.12:5900, the VmWare server ip and port number added for the WinXpTemp VM.

You could extend on this by configuring port 5901 for another VM and so on, connecting uniquely to each VM with by the unique port id.

Happy playing.

10 May, 2008

Adding HardDrive to VMWare WinXp Virtual Machine

Underestimating the persistent storage of a virtual machine (VM) is pretty standard for me. I generally define my VM hard drive pretty conservatively to avoid wasting filesystem space, adding a new hard drive as required. This is the procedure I go through to add a new hard drive to a WinXp VM.

First, create a new virtual hard drive with VMWare. Begin by editing your VM preferences.



Next, add a new hard drive to your VM.





That completes adding the hard drive to the virtual machine, the next steps are required by the guest OS to get WinXp to recognize the new hard drive.

You first need to start up the disk management application.


You then need to open the c:\WINDOWS\system32\compmgmt property file.
Double-click on the Disk Management selection and a wizard will pop up, follow along with the wizard.










After the partion wizard has completed, exit computer management and you should now have a newly created hard drive on your system.
Viola.

09 May, 2008

Cloning a VMWare Virtual Machine

I've become a recent convert to the virtualization technologies that have been recently developed. I'll postpone the accolades of virtualization for future posts. For now, I'll concentrate on a task I find I regularly perform, but had some trouble locating how to do it.

Virtual machines opens the door for creating a VM template, where the guest OS is installed in a pre-defined manner, and task-specific instances of this template can be created and disposed of when the task is completed. For example, evaluation of a 30-day evaluation software installation is a prime example. Repeated installation, followed by un-installation, on a OS takes its toll leaving remnants of the products in unlikely locations. Creating a new VM instance dedicated to product evaluation and later deleting the entire VM once the product evaluation has completed is...in a word...simple.

This requires defining a VM template, simply put a generic OS installation that you'll clone for specific tasks. This is generated simply by creating a VM and installing the guest OS (documented in VMWare references). What isn't documented is how to clone/copy the VM. That will be the focus of the remainder of this post.

Suppose you have a VM template called WinXpBase, located in /VM/WinXpBase/ and you wish to clone this VM as Clone01 at /VM/Clone01/.

Step 1 - Copy the VM:
$ cp -rf /VM/WinXpBase /VM/Clone01

Step 2 - Update the Virtual Disks

$ cd /VM/Clone01
$ vmware-vdiskmanager -n WinXpBase.vmdk Clone01.vmdk

Step 3 - Rename Files Accordingly
$ mv WinXpBase.vmx Clone01.vmx
$ mv WinXpBase.vmsd Clone01.vmsd

Step 4 - Update File Name References in VM Properties
open the Clone01.vmx file in your favorite editor and search-n-replace instances of WinXpBase with Clone01

Step 5 - Add VM to VM List
As root, edit the following files:
/etc/vmware/vm-list
/etc/vmware/vm-list-private
duplicating the lines with WinXpBase, followed by search-n-replace with Clone01.

Fire up the VM Console and power up your new Clone01 VM.

Last Step - Apply New VM Identifier
Upon applying power to your new Clone01 VM, you'll encounter a pop-up similar to:

This is a one-time pop-up, you should select Create and you've just cloned your very own VM.