Posts

Showing posts with the label vmware

VMware ESXi 5 - VNC to a guest

One of the more annoying things is that by default one have to use the vSphere client to access the console of a guest. Some people have decided to modify the firewall on the host to get direct access to the guest, but there is a simpler way to accomplish this. enable ssh key authentication on the host add the following to the guest configuration (needed no matter what) RemoteDisplay.vnc.enabled = "true" RemoteDisplay.vnc.port = "<port number for the vnc server>" configure your vnc client to use ssh, for example with Chicken of the VNC : Host: <your vmware esxi host> Port: the port number specified for the guest [X] Tunnel over SSH SSH Host: root@<your vmware esxi host>

VMware ESXi 5 - ssh key authentication

One of the big mysteries about VMware ESXi is how to enable ssh key authentication, as there are many solution. From making a .tgz file and store it in /bootbank, to more elaborate solutions where one modifies one of the .tgz files. The easiest way is simply to copy your .pub file to /etc/ssh/keys-root/authorized_keys and presto it will work for the root user.

WMware ESXI - suspend all guests

I have an VMware ESXI 5 which I used for testing things, but I don't want it to run all the time, and using the vSphere Client to stop all the VM's and then stop the ESXI server is a bit too much effort. So I figured out how to do it from the commandline using 'vim-cmd'. #/bin/sh VMS=`vim-cmd vmsvc/getallvms | grep -v Vmid | awk '{print $1}'` for VM in $VMS ; do      PWR=`vim-cmd vmsvc/power.getstate $VM | grep -v "Retrieved runtime info"`      if [ "$PWR" == "Powered on" ] ; then           name=`vim-cmd vmsvc/get.config $VM | grep -i "name =" | awk '{print $3}' | head -1 | cut -d """ -f2`           echo "Powered on: $name"           echo "Suspending: $name" ...