Tag Archives: vmware

FreeBSD vmware tools in FreeBSD 8.x

You can install vmware tools under ESX – but I like to edit part of it.

NOTE: if you’re running FreeBSD 9, you need to follow the guide here instead.

To install, connect with your VM Infrastucture Client, edit the CD Drive, select ‘Datastore ISO file’, and Browse.  Open up the ‘vmimages’ folder and select ‘freebsd.iso’.  Make sure to check the ‘Connected’ checkbox before clicking OK.

In freebsd, as root, do the following:

mount /cdrom
cd /tmp
gunzip -c /cdrom/vmware<tab> | tar xvf –
umount /cdrom
cd vmware<tab>

This will start the vmware installer… follow the instructions and select all the defaults.  Once it is complete, you can remove the folder in /tmp/

NOTE: vmtools requires perl to be installed and also “compat6x” port/package if you are using FreeBSD 7 – do this beforehand!

now… edit /usr/local/etc/rc.d/vmware-tools.sh and search for “–background”.  This should be around line 626.  At the end of that line, add:

–halt-command “/sbin/shutdown -p now”

then restart the vmware tools with:

/usr/local/etc/rc.d/vmware-tools.sh restart

This will ensure that, when you use ‘shutdown guest’, the freebsd virtual machine will power off.  Without this update, it will shutdown but not power off.

FreeBSD with ESX

If you run FreeBSD under ESX (unsupported, but works) and you use a type of storage that is susceptable to slowdowns (in my case a SAN with a failed hard drive forced to do RAID5 reconstruction), you may find your FreeBSD virtual machines panic and crash.

This is caused by the SCSI disk timeout being reached on the root device.  You can spot these by looking in your log for SCSI timeout messages.

To get around this, we can increase the number of retries before it fails (hopefully giving the storage device time to catch up).  This is done with the following command:

sysctl kern.cam.da.retry_count=120

You can set this to happen each boot, by editing the file /etc/sysctl.conf and adding: