VMware

From Indie IT Wiki
Revision as of 12:11, 31 March 2014 by imported>Plittlefield (→‎HOWTO: Uninstall VMware From Ubuntu)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

HOWTO: Transform Your Windows Physical Machines To Virtual Machines

  1. http://blog.zeltser.com/post/15781390680/windows-xp-mode-for-vmware-virtualization
  2. http://www.vmware.com/products/converter/

HOWTO: Uninstall VMware From Ubuntu

sudo service vmware-USBArbitrator stop
sudo service vmware stop
sudo update-rc.d -f vmware-USBArbitrator remove
sudo update-rc.d -f vmware remove
sudo vmware-installer --list-products
sudo vmware-installer --uninstall-product vmware-vix
sudo vmware-installer --uninstall-product vmware-player
sudo rm -rf /etc/vmware/

FIX: VMware Player Fails To Start After Ubuntu Kernel Change Update

sudo vmware-modconfig --console --install-all

Install Gentoo Linux In VMware

Good step-by-step guide, illustrations, VMware Tools iso, etc!

http://www.360doc.com/content/09/0827/00/173787_5299919.shtml

Downloads Locations

https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/5_0

https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/4_0

Good Web Site: Virtuatopia

http://www.virtuatopia.com

VMware Web Site: My VMware

https://my.vmware.com/group/vmware/evalcenter?p=player

Remote Desktop In Linux

rdesktop -u Administrator server.domain.co.uk:port
rdesktop -u Administrator 192.168.0.x

Turn Off Logging

In the file /etc/vmware/config, add the following line:-

logging = "FALSE"

kb.vmware.com/kb/1232

VMware Server 1: Turning Off CDROM Drive Temporarily Via Command Line

If you are seeing lots of these error messages in your log file:-

Jul 04 10:56:09: vmx| CDROM_SG: AIOCallbackSGIO: Unexpected errno: Unknown error 4294967295 (-1)

To fix it, power off the VM, then edit the configuration file:-

e.g. /home/vmware/Virtual Machines/SBS2003/SBS2003.vmx

Change

ide1:0.startConnected = "TRUE"

To

ide1:0.startConnected = "FALSE"

Thanks to this page - http://sanbarrow.com/vmx/vmx-cd-settings.html

VMware Server 1: VMX Configuration File - Full Example

#!/opt/vmware/server/bin/vmware
config.version = "8"
virtualHW.version = "4"
numvcpus = "2"
scsi0.present = "TRUE"
scsi0.virtualDev = "lsilogic"
memsize = "3600"
scsi0:0.present = "TRUE"
scsi0:0.fileName = "SBS2003.vmdk"
scsi0:0.writeThrough = "TRUE"
ide1:0.present = "TRUE"
ide1:0.fileName = "/dev/scd0"
ide1:0.deviceType = "cdrom-raw"
ide1:0.startConnected = "FALSE"
floppy0.present = "FALSE"
floppy0.fileName = "/dev/fd0"
floppy0.startConnected = "FALSE"
Ethernet0.present = "TRUE"
displayName = "SBS2003"
guestOS = "winnetbusiness"
priority.grabbed = "normal"
priority.ungrabbed = "normal"
powerType.powerOff = "hard"
powerType.powerOn = "hard"
powerType.suspend = "hard"
powerType.reset = "hard"
scsi0:0.redo = ""
ethernet0.addressType = "generated"
uuid.location = "56 4d a7 c3 6b 0d 99 8f-03 80 c8 f5 d2 c6 a2 7a"
uuid.bios = "56 4d a7 c3 6b 0d 99 8f-03 80 c8 f5 d2 c6 a2 7a"
ethernet0.generatedAddress = "00:0c:29:c6:a2:7a"
ethernet0.generatedAddressOffset = "0"
tools.syncTime = "FALSE"

VMware Server 1: Starting Or Stopping A Virtual Machine Via Command Line

Checking

vmware-cmd /home/vmware/Virtual\ Machines/SBS2003/SBS2003.vmx getstate
   getstate() = off

Starting

vmware-cmd /home/vmware/Virtual\ Machines/SBS2003/SBS2003.vmx start   
   start() = 1

Stopping

vmware-cmd /home/vmware/Virtual\ Machines/SBS2003/SBS2003.vmx stop   
   stop() = 1

If the above does not stop the virtual machine, that is if you get an error message similar to:

VMControl error -8: Invalid operation for virtual machine's current state: Make sure the VMware Server Tools are running

Try using the following:

/etc/init.d/vmware stop

VMware Server 2: Start Virtual Machine

vmrun -T server -h https://192.168.0.201:8333/sdk -u UserName -p MyPassword start "[standard] WSBS2003/Windows Server 2003 Small Business.vmx" nogui

VMware Server 2: Stop Virtual Machine

vmrun -T server -h https://192.168.0.201:8333/sdk -u UserName -p MyPassword stop "[standard] WSBS2003/Windows Server 2003 Small Business.vmx"

VMware Server 2: List Running Virtual Machines

vmrun -T server -h https://192.168.0.200:8333/sdk -u UserName -p MyPassWord list

VMware Server 2: List Running Processes In Guest

vmrun -T server -h https://192.168.0.200:8333/sdk -u UserName -p MyPassWord -gu Administrator -gp PassW0rd listProcessesInGuest "[ha-datacenter/standard] SBS2003/SBS2003.vmx"
Process list: 41
pid=0, owner=, cmd=[System Process]
pid=4, owner=, cmd=System
pid=348, owner=NT AUTHORITY\SYSTEM, cmd=\SystemRoot\System32\smss.exe
pid=400, owner=, cmd=csrss.exe
pid=424, owner=NT AUTHORITY\SYSTEM, cmd=winlogon.exe
pid=472, owner=NT AUTHORITY\SYSTEM, cmd=C:\WINDOWS\system32\services.exe

VMware Server 2: Take A Screenshot Of Guest

vmrun -T server -h https://192.168.0.200:8333/sdk -u UserName -p MyPassWord -gu Administrator -gp PassW0rd captureScreen "[ha-datacenter/standard] SBS2003/SBS2003.vmx" /tmp/vmrun_screenshot_01.png

VMware Server 2: Installation In Ubuntu Linux

https://help.ubuntu.com/community/VMware/Server

VMware Server 2 to VMware Player 4 : Copying / Moving A Virtual Machine

  • shut down the virtual machine
  • rsync {old server: /path/to/virtual machines/virtual machine} --> {new server: /path/to/virtual machines/}
  • change the .vmx file
#!/opt/vmware/server/bin/vmware

to

#!/usr/bin/vmware

and

memsize = "4096"

(as needed)

and

numvcpus = "2"

(as needed)

  • start up the virtual machine on the new server, and when asked if you want to move or copy, say MOVE.
  • this will keep the same virtual BIOS information, and MAC addresses on the network cards.
  • update VMware Tools

This was slightly tricky in Gentoo because I had to change the settings of the virtual CDROM to be the ISO of the Tools, located at...

$ qlist vmware-tools
/opt/vmware/lib/vmware/isoimages/windows.iso
  • reboot and enjoy!

VMware Player 4: Installation In Ubuntu Linux

sudo apt-get install build-essential linux-headers-`uname -r`
cd Downloads/
chmod +x VMware-Player-4.0.4-744019.x86_64.bundle 
sudo ./VMware-Player-4.0.4-744019.x86_64.bundle 
sudo apt-get install patch
wget http://webupd8.googlecode.com/files/vmware802fixlinux320.tar.gz
tar -xvf vmware802fixlinux320.tar.gz 
nano vmware802fixlinux320.sh
cd vmware802fixlinux320/
sudo ~/vmware802fixlinux320/patch-modules_3.2.0.sh
cd vmware802fixlinux320/
sudo ./patch-modules_3.2.0.sh

VMware Player 4: Starting and Stopping A Virtual Machine Via The Command Line

After installing VMware Player, install the VIX API from the 'My VMware' section of the Downloads web site.

Then, you can have fun with the following commands...

vmrun -T player list
vmrun -T player start "/path/to/machine.vmx"
vmrun -T player start "/path/to/machine.vmx" gui
vmrun -T player start "/path/to/machine.vmx" nogui
vmrun -T player stop "/path/to/machine.vmx"

VMware Player 4: Starting and Stopping A Virtual Machine At Host Boot Up And Shut Down

In Gentoo Linux, create the 2 startup and shutdown scripts in /etc/local.d/...

vmware.domain.co.uk ~ $ ll /etc/local.d/vmware-player.*
-rwxr-xr-x 1 root root 133 2012-07-10 09:20 /etc/local.d/vmware-player.start
-rwxr-xr-x 1 root root 126 2012-07-10 09:21 /etc/local.d/vmware-player.stop

The trick is to make sure you run the command as the user who owns the Virtual Machines. This is done by using the su command with the -c option...

#!/bin/bash
/bin/su - vmware -c "/opt/vmware/bin/vmrun -T player start /home/vmware/Virtual\ Machines/WindowsXP/WindowsXP.vmx nogui"
#!/bin/bash
/bin/su - vmware -c "/opt/vmware/bin/vmrun -T player stop /home/vmware/Virtual\ Machines/WindowsXP/WindowsXP.vmx"

How To Fix Authorisation Problems

Open Applications > Accessories > Terminal

Switch to root user

su -

Copy the good file over the bad file

cp -av authorization.xml /etc/vmware/hostd/

Logout of root user

Close Terminal

How To Fix Database Connection Problems

Stop vmware management

sudo /etc/init.d/vmware-mgmt stop

Edit vmware management

sudo nano /etc/vmware/hostd/authorization.xml

Edit the line that talks about

<NextAceId>11</NextAceId>

Incrament it past the current "root" or administrator account you have. So it now reads

<NextAceId>12</NextAceId>

or to be safe (for many users)

<NextAceId>20</NextAceId>

Delete

<NextRoleId>11</NextRoleId>

Start vmware management

sudo /etc/init.d/vmware-mgmt start

Re-login to VMware Infrastructure Web Access FROM: http://ubuntuforums.org/showthread.php?t=973729

How To Fix Keyboard Problems

If your ARROW, NUMLOCK, HOME or END keys do not work properly in the Windows Virtual Machine, close the Console then edit the file /etc/vmware/config (for VMware Server 2) or the file /etc/vmware-server-console/config (for VMware Server 1) and add the following line at the end...

xkeymap.nokeycodeMap = "TRUE"

...then restart the console and you should be OK now.

How To Fix Mouse Problems

If your mouse does not work properly in the VM, edit the following file...

/home/username/.mozilla/firefox/{profile}/extensions/VMwareVMRC@vmware.com/plugins/lib/wrapper-gtk24.sh

...and add the lines near the top...

VMWARE_USE_SHIPPED_GTK='force'
export VMWARE_USE_SHIPPED_GTK="force"

...then restart firefox and your plugin.

How To Fix NFS / LDAP Password Problems

If you find that users on an LDAP database cannot log into the VMware Web Access pages, you will need to edit the file /etc/pam.d/vmware-authd...

#%PAM-1.0
auth       sufficient  pam_ldap.so
auth       required    pam_unix.so shadow nullok
account    sufficient  pam_ldap.so
account    required    pam_unix.so

...and restart VMware Server.

How To Fix ERROR: vmware failed to start (not properly configured!)

*   VMware Server is installed, but it has not been (correctly) configured
*   for the running kernel.
*   Please ensure that the modules have been compiled for this kernel:
*   emerge --oneshot vmware-modules
*   Also ensure VMware Server has been configured:
*   /opt/vmware/server/bin/vmware-config.pl
* VMware is not properly configured! See above.
* ERROR: vmware failed to start

Solution: delete a file...

rm /etc/vmware/not_configured

...and run the configure script again...

/opt/vmware/server/bin/vmware-config.pl

...OR, just run the service again...

/etc/init.d/vmware start

VMRUN - Error: unable to connect to the host Error: The specified version was not found

VMware Player 5.0.2

This is caused by a misconfiguration of the vmware wrapper text file.

nano /opt/vmware/lib/vmware-vix/vixwrapper-config.txt

# Workstation 9.0.2
ws        15  vmdb  9.0.2 Workstation-9.0.0-and-vSphere-5.1.0
player    15  vmdb  5.0.2 Workstation-8.0.0-and-vSphere-5.0.0
ws-shared 15  none  9.0.2 Workstation-9.0.0-and-vSphere-5.1.0

http://minuteware.net/vmware-player-and-vmware-vix-the-specified-version-was-not-found/

VMRUN - Error: Cannot Shut Down Gentoo Linux Guest

This is another one of those "bizarre but true" fixes! Install the package dhcpcd and create some scripts...

emerge dhcpcd
nano -w /sbin/ifup
    /sbin/ifconfig $1 up
chmod 744 /sbin/ifup	
nano -w /sbin/ifdown
    /sbin/ifconfig $1 down
chmod 744 /sbin/ifdown

Now run the following command, and it will work. Amazing.

vmrun -T player stop /home/paully/vmware/Gentoo\ Server/Gentoo\ Server.vmx soft

http://forums.gentoo.org/viewtopic-t-909720-start-0.html

VMRUN - Error: The specified service provider was not found

See the similar error below, and use the same fix.

If this does not work, and it is the latest VMware Player and VMware VIX, then add the followng line to /etc/vmware/config

vix.config.version = "1"

Here is a full config file for reference.

bindir = "/opt/vmware/bin"
libdir = "/opt/vmware/lib/vmware"
initscriptdir = "/etc/init.d"
authd.fullpath = "/opt/vmware/sbin/vmware-authd"
gksu.rootMethod = "su"
VMCI_CONFED = "yes"
VMBLOCK_CONFED = "yes"
VSOCK_CONFED = "yes"
NETWORKING = "yes"
player.product.version = "4.0.4"
product.buildNumber = "744019"
vmware.fullpath = "/opt/vmware/bin/vmware"
vix.libdir = "/opt/vmware/lib/vmware-vix"
vix.config.version = "1"

VMRUN - Error: Cannot find support libraries; Vix appears to have not been installed

Add the VIX Library path to the config file /etc/vmware/config...

libdir = "/opt/vmware/server/lib"
vix.libdir = "/opt/vmware/lib/vmware-vix/"
(might be vix.libdir = "/opt/vmware/vix/lib")

Then the following command will work...

vmrun -T server -h https://192.168.0.200:8333/sdk -u UserName -p MyPassWord list

To show something like...

Total running VMs: 1
[standard] WSBS2003/Windows Server 2003 Small Business.vmx

VMWare Remote Console and Firefox 3.6

Since I updated to Firefox 3.6 the VMWare plugin for web access to the remote console doesn't work anymore. I can view and restart my machines but but the console is failing with "Cannot access virtual machine console. The request timed out." So here is how to run the remote console by hand...

Find the VMWare plugin in your Firefox folder:

%USERPROFILE%\Anwendungsdaten\Mozilla\Firefox\Profiles\uiu7quov.default\extensions\VMwareVMRC@vmware.com\plugins

You need to change uiu7quov.default to your profile folder.

From here you can connect to your vmware with:

vmware-vmrc.exe -h serverIP:8333 -M machineID

You should know your serverIP but you can find it together with the machineID in the web interface. Just select your VM and click right below "Commands" on "Gerate Virtual Machine Shortcut". The link from the web shortcut contains what you need:

https://serverIP:8333/ui/?wsUrl=http://localhost:8222/sdk&mo=VirtualMachine%7CmachineID&inventory=none&tabs=hide

Taken from - http://pinetik.blogspot.com/2010/04/vmware-remote-console-and-firefox-36.html

ERROR: VMware Server 2: No Virtual Network Adapater - Linux Host / Windows Guest

Network Adapter 1: Not connected: Bridge-0 Not Available

If you have no networking in your guest vm, then following the steps in this page...

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1008367

This led me to spot that vmnet-bridge was not running and so found this page...

http://nst.sourceforge.net/nst/docs/faq/ch13s11.html

This led me to compare with another Linux server running VMware Server 2, Which showed me the command line to use...

server2.company.co.uk ~ $ /bin/ps -ef|grep "vmnet-bridge"
root      7096     1  0  2011 ?    00:00:00 /opt/vmware/server/bin/vmnet-bridge -d /var/run/vmnet-bridge-0.pid -n 0 -i eth1

Which led to this kernel syslog output...

May 13 11:57:46 server1 vmnetBridge: Bridge process created. 
May 13 11:57:46 server1 vmnetBridge: RTM_NEWLINK: name:eth1 index:3 flags:0x00011043 
May 13 11:57:46 server1 vmnetBridge: Started bridge eth1 to virtual network 0. 
May 13 11:57:46 server1 kernel: /dev/vmnet: open called by PID 23763 (vmnet-bridge)
May 13 11:57:46 server1 kernel: /dev/vmnet: hub 0 does not exist, allocating memory.
May 13 11:57:46 server1 kernel: /dev/vmnet: port on hub 0 successfully opened
May 13 11:57:46 server1 kernel: bridge-eth1: up
May 13 11:57:46 server1 kernel: bridge-eth1: attached

Check modules...

server1.company.co.uk ~ $ lsmod  
Module                  Size  Used by
vmnet                  32434  3 
vsock                  17909  0 
vmci                   42704  1 vsock
vmmon                  60533  0 

Check device nodes... (and create /dev/vmnet0 if necessary)

mknod -m 0600 /dev/vmnet0 c 119 0
server1.company.co.uk ~ $ ll /dev/vm*
crw-rw-rw- 1 root vmware  10,  59 2012-05-12 18:46 /dev/vmci
crw-rw---- 1 root vmware  10, 165 2012-05-12 18:46 /dev/vmmon
crw------- 1 root root   119,   0 2012-05-13 11:27 /dev/vmnet0

Check contents of /etc/vmware/netmap.conf...

server1.company.co.uk ~ $ n /etc/vmware/netmap.conf

# This file is automatically generated.
# Hand-editing this file is not recommended.

network0.name = "Bridged-0"
network0.device = "vmnet0"

HOWEVER, AFTER ALL THAT, I STILL COULD NOT FIX IT MANUALLY

So I had to re-run the configuration script...

/opt/vmware/server/bin/vmware-config.pl

Bridged only - named "Bridged" to eth1, no NAT, no Host Only

Which gave me...

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

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

May 13 12:45:36 server1 kernel: /dev/vmmon[25416]: Module vmmon: registered with major=10 minor=165
May 13 12:45:36 server1 kernel: /dev/vmmon[25416]: Initial HV check: anyNotCapable=0 anyUnlocked=1 anyEnabled=1 anyDisabled=0
May 13 12:45:36 server1 kernel: /dev/vmmon[25416]: HV check: anyNotCapable=0 anyUnlocked=1 anyEnabled=1 anyDisabled=0
May 13 12:45:36 server1 kernel: /dev/vmmon[25416]: Module vmmon: initialized
May 13 12:45:36 server1 kernel: /dev/vmci[25429]: VMCI: Driver initialized.
May 13 12:45:36 server1 kernel: /dev/vmci[25429]: Module vmci: registered with major=10 minor=59
May 13 12:45:36 server1 kernel: /dev/vmci[25429]: Module vmci: initialized
May 13 12:45:37 server1 vmnetBridge: Bridge process created.
May 13 12:45:37 server1 vmnetBridge: RTM_NEWLINK: name:eth1 index:3 flags:0x00011043
May 13 12:45:37 server1 vmnetBridge: Started bridge eth1 to virtual network 0.
May 13 12:45:37 server1 kernel: /dev/vmnet: open called by PID 25508 (vmnet-bridge)
May 13 12:45:37 server1 kernel: /dev/vmnet: hub 0 does not exist, allocating memory.
May 13 12:45:37 server1 kernel: /dev/vmnet: port on hub 0 successfully opened
May 13 12:45:37 server1 kernel: bridge-eth1: up
May 13 12:45:37 server1 kernel: bridge-eth1: attached
server1.company.co.uk ~ $ lsmod 
Module                  Size  Used by
vmnet                  32434  3 
vsock                  17909  0 
vmci                   42704  2 vsock
vmmon                  60533  8 
server1.company.co.uk ~ $ ll /dev/vm*
crw-rw-rw- 1 root vmware  10,  59 2012-05-13 12:45 /dev/vmci
crw-rw---- 1 root vmware  10, 165 2012-05-13 12:45 /dev/vmmon
crw------- 1 root root   119,   0 2012-05-13 12:43 /dev/vmnet0
crw------- 1 root root   119,   1 2012-05-13 12:42 /dev/vmnet1
crw------- 1 root root   119,   2 2012-05-13 12:42 /dev/vmnet2
crw------- 1 root root   119,   3 2012-05-13 12:42 /dev/vmnet3
crw------- 1 root root   119,   4 2012-05-13 12:42 /dev/vmnet4
crw------- 1 root root   119,   5 2012-05-13 12:42 /dev/vmnet5
crw------- 1 root root   119,   6 2012-05-13 12:42 /dev/vmnet6
crw------- 1 root root   119,   7 2012-05-13 12:42 /dev/vmnet7
crw------- 1 root root   119,   8 2012-05-13 12:42 /dev/vmnet8
crw------- 1 root root   119,   9 2012-05-13 12:42 /dev/vmnet9
server1.company.co.uk ~ $ ping 192.168.0.210
PING 192.168.0.210 (192.168.0.210) 56(84) bytes of data.
64 bytes from 192.168.0.210: icmp_req=1 ttl=128 time=2.37 ms
64 bytes from 192.168.0.210: icmp_req=2 ttl=128 time=0.170 ms
64 bytes from 192.168.0.210: icmp_req=3 ttl=128 time=0.172 ms

--- 192.168.0.210 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2006ms
rtt min/avg/max/mdev = 0.170/0.905/2.375/1.039 ms

Which Version Of VMware Do I Have ?

vmware -v