Browsed by
Month: May 2010

Intalling VMware Tools on Linux

Intalling VMware Tools on Linux

Installing VMware Tools on a Linux host is very simple. All you need to do is make sure the headers for your current kernel and GCC are installed. Here is an example of the commands you would run for Debian/Ubuntu:

sudo apt-get install linux-headers-generic gcc
sudo mount /dev/cdrom /media/cdrom
cp /media/cdrom/VMware*.tar.gz /tmp
sudo umount /media/cdrom
cd /tmp
tar xzvf VMware*.gz
cd vmware-tools-distrib/
sudo ./vmware-install.pl

You should now notice your Linux VMs are more responsive and have a few more options.

Linux Swap File

Linux Swap File

For some unexplainable reason it annoyed me that most Linux distros use a swap partition instead of a swap file. Depending on your setup a swap file will be just as fast and will even allow you to suspend to disk. Here is how you do it.

Enter the following lines at the Terminal:

sudo dd if=/dev/zero of=/swap bs=1G count=X
sudo chown root:root /swap
sudo chmod 600 /swap
sudo mkswap /swap
sudo swapon /swap

Replace “X” in the first line with how many gigabytes you want your swap file to be (~1.5 times your amount of RAM is a good rough guess). Now add the line “/swap none swap sw 0 0” to your /etc/fstab file.

If you already have a swap partition you can safely remove the corresponding line from /etc/fstab, sudo swapoff partition, and then remove the swap partition completely with a tool like GParted.

If you get a error from dd indicating you do not have enough RAM you can use sudo dd if=/dev/zero of=/swap bs=1M count=X instead.