This post describes how you can download and install the latest version of VMware Tools to a linux guest from a ESXi 5.0 host. You need SSH access rights to a VMware host to follow this guide.
sftp username@vmhost.tld:/vmimages/tools-isoimages/linux.iso
Type in your password and the download will start
# mount linux.iso /media/cdrom/ -t iso9660 -o loop # scp /media/cdrom/VMwareTools-8.6.5-652272.tar.gz username@vmguest.tld:
# tar xfz VMwareTools-8.6.5-652272.tar.gz # cd vmware-tools-distrib # ./vmware-install.pl
Follow the instructions and finish the installer. A reboot may be required to load the necessary kernel modules.
Your VMware Tools are now installed and should work as it would on a normal VMware Tools installation.
This procedure can also be used on other operating systems. This is a list of all the VMware Tools ISO-images available in the /vmimages/tools-isoimages/ folder on a ESXi 5.0 host
sftp> ls -l -rwx------ 1 root root 12576768 Apr 13 09:17 darwin.iso -rwx------ 1 root root 256 Apr 13 09:17 darwin.iso.sig -rwx------ 1 root root 16021504 Apr 13 09:16 freebsd.iso -rwx------ 1 root root 256 Apr 13 09:18 freebsd.iso.sig -rwx------ 1 root root 65200128 Apr 13 09:15 linux.iso -rwx------ 1 root root 256 Apr 13 09:17 linux.iso.sig -rwx------ 1 root root 1738 Apr 13 09:17 linux_avr_manifest.txt -rwx------ 1 root root 540672 Apr 13 09:17 netware.iso -rwx------ 1 root root 256 Apr 13 09:16 netware.iso.sig -rwx------ 1 root root 13006848 Apr 13 09:17 solaris.iso -rwx------ 1 root root 256 Apr 13 09:16 solaris.iso.sig -rwx------ 1 root root 451 Apr 13 09:17 tools-key.pub -rwx------ 1 root root 13664256 Apr 13 09:18 winPre2k.iso -rwx------ 1 root root 256 Apr 13 09:17 winPre2k.iso.sig -rwx------ 1 root root 49 Apr 13 09:18 winPre2k_avr_manifest.txt -rwx------ 1 root root 62128128 Apr 13 09:17 windows.iso -rwx------ 1 root root 256 Apr 13 09:18 windows.iso.sig -rwx------ 1 root root 1069 Apr 13 09:17 windows_avr_manifest.txt
Tags: esxi5, firewall, sftp, VMware, VMware Tools, vSphere Client
Posted by Hans-Henry Jakobsen
lftp is a file transfer program that allows sophisticated ftp, http and other connections to other hosts. If site is specified then lftp will connect to that site otherwise a connection has to be established with the open command.
Basic usage
Use a different user name than the one you are currently using
Use a different port and different user name
Recursive download/upload
lftp> mirror directory_to_download lftp> mirror -R directory_to_upload
For more lftp options type the following command in a console window
# man lftp
Posted by Hans-Henry Jakobsen
Today I’ve setup a cold backup routine to backup my Zimba installation running on my Debian (Etch) 4.0 server that is in full production now for my private domains. This is a slightly modified backup script for the Open Source Edition of Zimbra from the Zimbra Wiki. Please note that the script does a full backup every time it’s being run!
#!/bin/bash # Zimbra Backup Script # Requires sftp to run # This script is intended to run from the crontab as root # Free to use and free of any warranty! Daniel W. Martin, 9 Sept 2007 # Live sync before stopping Zimbra to minimize sync time with the services down # Comment out the following line if you want to try single cold-sync only rsync -avHK --delete /opt/zimbra/ /backup/zimbra # which is the same as: /opt/zimbra /backup # Including --delete option gets rid of files in the dest folder that don't exist at the src # this prevents logfile/extraneous bloat from building up overtime. # Stop Zimbra Services sudo -u zimbra /opt/zimbra/bin/zmcontrol stop sleep 40 # Sync to backup directory rsync -avHK --delete /opt/zimbra/ /backup/zimbra # Restart Zimbra Services sudo -u zimbra /opt/zimbra/bin/zmcontrol start # Create a txt file in the backup directory that'll contain the current Zimbra # server version. Handy for knowing what version of Zimbra a backup can be restored to. sudo -u zimbra zmcontrol -v > /backup/zimbra/conf/zimbra_version.txt # or examine your /opt/zimbra/.install_history # Create archive of backed-up directory for offsite transfer # cd /backup/zimbra ZimbraVersion=zimbraBackup-zcs-5.0.1_GA_1902.DEBIAN4.0.20080109200914 tar -zcf /backup/$ZimbraVersion-$(date +"%Y-%m-%d").tgz -C /backup/zimbra . # Transfer file to backup server using passwordless sftp scp zimbraBackup-zcs-5.0.1_GA_1902.DEBIAN4.0.20080109200914-$(date +"%Y-%m-%d").tgz username@example.com:/path/to/backupfolder/
I’ve described passwordless ssh/sftp session in a earlier post so I won’t describe the last line of the backup script.
Tags: backup, bash, Debian, sftp, tar., Zimbra
Posted by Hans-Henry Jakobsen
This post describes how you use sftp in batch mode. If you don’t want to type in your password read my SSH without a password post.
Create a file named myCommands.sftp that contains the commands you want to run. My file looks like this
# Change to your desired directory locally lcd /data/Hattori # Change to the desired directory on the remote server cd /backup # Transfer all remote files locally get * # We're done with this session bye
Next you run the sftp session
sftp -b myCommands.sftp example.com
That should be all that is necessary to download your files from the remote server.
This example could easily have been extended with a crontab entry.
Posted by Hans-Henry Jakobsen
This is an alternative way of limiting the SSH access to only SFTP explained in my How to restrict users to SFTP only instead of SSH post.
Edit your /etc/sshd_config file and change your settings like this
Match User username
AllowTcpForwarding no
X11Forwarding no
ForceCommand /usr/libexec/sftp-server -l INFO
Replace username with the user name you would limit the SSH access for.
Posted by Hans-Henry Jakobsen