VMware

Aus MHC-Wiki

Wechseln zu: Navigation, Suche

Getestet mit vmware Server 2

Inhaltsverzeichnis

Ubuntu Keymap Problem

Folgendes in die /etc/vmware/config einfügen damit die genannten Tasten in der Console funktionieren:

xkeymap.keycode.108 = 0x138 # Alt_R
xkeymap.keycode.106 = 0x135 # KP_Divide
xkeymap.keycode.104 = 0x11c # KP_Enter
xkeymap.keycode.111 = 0x148 # Up
xkeymap.keycode.116 = 0x150 # Down
xkeymap.keycode.113 = 0x14b # Left
xkeymap.keycode.114 = 0x14d # Right
xkeymap.keycode.105 = 0x11d # Control_R
xkeymap.keycode.118 = 0x152 # Insert
xkeymap.keycode.119 = 0x153 # Delete
xkeymap.keycode.110 = 0x147 # Home
xkeymap.keycode.115 = 0x14f # End
xkeymap.keycode.112 = 0x149 # Prior
xkeymap.keycode.117 = 0x151 # Next
xkeymap.keycode.78 = 0x46 # Scroll_Lock
xkeymap.keycode.127 = 0x100 # Pause
xkeymap.keycode.133 = 0x15b # Meta_L
xkeymap.keycode.134 = 0x15c # Meta_R
xkeymap.keycode.135 = 0x15d # Menu

SSL Problem Firefox

Zumindest mit dem Firefox gibt es ein Problem mit dem Webmanagement wenn "ssl2" nicht akitv ist. Zu beheben ist das per about:config:

security.enable.ssl2               von false auf true setzen

SHIFT/CTRL/ALT

Benutzt man Windows in der VM dann kommt es oft vor dass SHIFT / CTRL / ALT nicht mehr funktioniert. Das lässt sich beheben wenn man auf der Kommandozeile folgenden Befehl absetzt:

setxkbmap

Danach funktionieren die Tasten wie gewohnt.

Boot Delay

bios.bootDelay = “boot delay in milliseconds”

Setzt man z.B. den Weret 15000 ein hat man 15 Seconds um per F2 in's Bios zu gelangen um z.B. die Bootreihenfolge zu ändern.

Move / Copy

uuid.action = "create"   => copy
uuid.action = "keep"     => move

Wählt man "I copied it" werden die folgenden Einstellungen in der .vmx Datei der VM geändert:

uuid.location
uuid.bios
ethernet0.generatedAddress

Die führt unter anderem dazu, dass die VMs neue Netzwerkkarten bekommen. Bei einem Linux ist es dann eth1 statt eth0 und bei einem Windeos "Langverbindung 2" statt 1.

Performancetuning

Quelle: http://www.fewt.com/2008/06/performance-tuning-vmware-server-on.html

Bewährt:

/etc/vmware/config

mainMem.useNamedFile = FALSE
tmpDirectory="/dev/shm"
prefvmx.useRecommendedLockedMemSize="TRUE"
prefvmx.minVmMemPct="100"


/etc/fstab

noatime


/etc/default/tmpfs

SHM_SIZE=4G

Nicht getestet:

vmx

tools.syncTime = "TRUE"
autostop = "softpoweroff"

mem.ShareScanTotal=0
mem.ShareScanVM=0
mem.ShareScanThreshold=4096
sched.mem.maxmemctl=0
sched.mem.pshare.enable = "FALSE"

mainMem.useNamedFile = "FALSE"
MemTrimRate = "0"
MemAllowAutoScaleDown = "FALSE"

Mehr als 4 Prozessorkerne

vmware Server 2 hat einen Bug der dazuführt, dass maximal 4 Kerne durch die vmware genutzt werden. Die kann durch folgenden Eintrag (hier für 8 Kerne) in der VMX Datei JEDER VM auf dem Server umgangen werden:

processor0.use = "FALSE"
processor1.use = "FALSE"
processor2.use = "FALSE"
processor3.use = "FALSE"
processor4.use = "FALSE"
processor5.use = "FALSE"
processor6.use = "FALSE"
processor7.use = "FALSE"

Details, siehe: http://communities.vmware.com/message/1488938#1488938

Commandline

Mit "vmrun" kann man VMs von der Komandozeile aus verwalten. Folgendes Kommando zeigt eine liste aller laufenden VMs an:

vmrun -T server -h https://server_ip:8333/sdk -u user -p pass list

Folgendes Kommando zeigt eine Liste ALLER registriereten VMs an:

vmrun -T server -h https://server_ip:8333/sdk -u user -p pass listRegisteredVM

So eine Liste könnte z.B. auf Linux so aussehen:

Total registered VMs: 5
[standard] VM/KolabServer/KolabServer.vmx
[standard] VM/WindowsServer/WindowsServer.vmx
...

Will man eine VM bearbeiten ist die Schreibweise wichtig. Sie entspricht der Listenausgabe von oben:

[STROAGE] Pfad/der/vm/im/storage.vmx

Daraus ergibt sich dann um auf Linux eine VM zu starten:

vmrun -T server -h https://server_ip:8333/sdk -u user -p pass start "[standard] VM/WindowsServer/WindowsServer.vmx"

Liste aller "vmrun" Kommandos (Ausgabe der "vmrun" Hilfe):

vmrun version 2.0.1 build-156745

Usage: vmrun [AUTHENTICATION-FLAGS] COMMAND [PARAMETERS]



AUTHENTICATION-FLAGS
--------------------
These must appear before the command and any command parameters.

   -h <hostName>  (not needed for Workstation)
   -P <hostPort>  (not needed for Workstation)
   -T <hostType> (ws|server|server1)
     for example, use '-T server' for Server 2.0
                  use '-T server1' for Server 1.0
   -u <userName in host OS>  (not needed for Workstation)
   -p <password in host OS>  (not needed for Workstation)
   -gu <userName in guest OS>
   -gp <password in guest OS>



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



SNAPSHOT COMMANDS        PARAMETERS           DESCRIPTION
-----------------        ----------           -----------
snapshot                 Path to vmx file     Create a snapshot of a VM
                         Snapshot name

deleteSnapshot           Path to vmx file     Remove a snapshot from a VM
                         Snapshot name

revertToSnapshot         Path to vmx file     Set VM state to a snapshot
                         Snapshot name



RECORD/REPLAY COMMANDS   PARAMETERS           DESCRIPTION
----------------------   ----------           -----------
beginRecording           Path to vmx file     Begin recording a VM
                         Snapshot name

endRecording             Path to vmx file     End recording a VM

beginReplay              Path to vmx file     Begin replaying a VM
                         Snapshot name

endReplay                Path to vmx file     End replaying a VM



GUEST OS COMMANDS        PARAMETERS           DESCRIPTION
-----------------        ----------           -----------
runProgramInGuest        Path to vmx file     Run a program in Guest OS
                         [-noWait]
                         [-activeWindow]
                         [-interactive]
                         Complete-Path-To-Program
                         [Program arguments]

fileExistsInGuest        Path to vmx file     Check if a file exists in Guest OS
                         Path to file in guest

setSharedFolderState     Path to vmx file     Modify a Host-Guest shared folder
                         Share name
                         Host path
                         writable | readonly

addSharedFolder          Path to vmx file     Add a Host-Guest shared folder
                         Share name
                         New host path

removeSharedFolder       Path to vmx file     Remove a Host-Guest shared folder
                         Share name

listProcessesInGuest     Path to vmx file     List running processes in Guest OS

killProcessInGuest       Path to vmx file     Kill a process in Guest OS
                         process id

runScriptInGuest         Path to vmx file     Run a script in Guest OS
                         Interpreter path
                         script_text

deleteFileInGuest        Path to vmx file     Delete a file in Guest OS
                         Path in guest

createDirectoryInGuest   Path to vmx file     Create a directory in Guest OS
                         Directory path in guest

deleteDirectoryInGuest   Path to vmx file     Delete a directory in Guest OS
                         Directory path in guest

listDirectoryInGuest     Path to vmx file     List a directory in Guest OS
                         Directory path in guest

copyFileFromHostToGuest  Path to vmx file     Copy a file from host OS to guest OS
                         Path on host
                         Path in guest

copyFileFromGuestToHost  Path to vmx file     Copy a file from guest OS to host OS
                         Path in guest
                         Path on host

renameFileInGuest        Path to vmx file     Rename a file in Guest OS
                         Original name
                         New name

captureScreen            Path to vmx file     Capture the screen of the VM to a local file
                         Path on host

writeVariable            Path to vmx file     Write a variable in the VM state
                         [runtimeConfig|guestEnv]
                         variable name
                         variable value

readVariable             Path to vmx file     Read a variable in the VM state
                         [runtimeConfig|guestEnv]
                         variable name



VPROBE COMMANDS          PARAMETERS           DESCRIPTION
---------------          ----------           -----------
vprobeVersion            Path to vmx file     List VP version

vprobeLoad               Path to vmx file     Load VP script
                         'VP script text'

vprobeReset              Path to vmx file     Disable all vprobes

vprobeListProbes         Path to vmx file     List probes

vprobeListGlobals        Path to vmx file     List global variables



GENERAL COMMANDS         PARAMETERS           DESCRIPTION
----------------         ----------           -----------
list                                          List all running VMs

upgradevm                Path to vmx file     Upgrade VM file format, virtual hw

installtools             Path to vmx file     Install Tools in Guest

register                 Path to vmx file     Register a VM

unregister               Path to vmx file     Unregister a VM

listRegisteredVM                              List registered VMs

clone                    Path to vmx file     Create a copy of the VM
                         Path to destination vmx file
                         full|linked
                         [Snapshot name]




Examples:


Starting a virtual machine with Workstation on a Windows host
   vmrun -T ws start "c:\my VMs\myVM.vmx"


Stopping a virtual machine with Server on a linux host
   vmrun -T server -h https://myHost.com/sdk -u hostUser -p hostPassword stop "[storage1] vm/myVM.vmx"


Running a program in a virtual machine with Workstation on a Windows host with Windows guest
   vmrun -T ws -gu guestUser -gp guestPassword runProgramInGuest "c:\my VMs\myVM.vmx" "c:\Program Files\myProgram.exe"


Running a program in a virtual machine with Server on a linux host with linux guest
   vmrun -T server -h https://myHost.com/sdk -u hostUser -p hostPassword -gu guestUser -gp guestPassword runProgramInGuest "[storage1] vm/myVM.vmx" /usr/bin/X11/xclock -display :0


Creating a snapshot of a virtual machine with Workstation on a Windows host
   vmrun -T ws snapshot "c:\my VMs\myVM.vmx" mySnapshot


Reverting to a snapshot with Workstation on a Windows host
   vmrun -T ws revertToSnapshot "c:\my VMs\myVM.vmx" mySnapshot


Deleting a snapshot with Workstation on a Windows host
   vmrun -T ws deleteSnapshot "c:\my VMs\myVM.vmx" mySnapshot
Persönliche Werkzeuge
Navigation