VMware Fusion Tips






ALERT! WARNING: This page is obsolete.






These are some tips which I have found useful when running VMware Fusion in NAT mode.

Configuring NAT to allow mounting external NFS disks

This will allow your VM to mount NFS disks which are available on the network. First, you will need to shutdown all your VMs and quit Fusion. Note that these changes will be lost when you upgrade Fusion so save them in another location so that they can be restored.

# system privileges
sudo -s

# goto the directory
cd /Library/Application\ Support/VMware\ Fusion\vmnet8

# save, change protection, edit, etc for the nat config file.

cp nat.conf nat.conf.`date "+%Y%m%d"`
chmod +w nat.conf
emacs nat.conf

# add the following lines at the end of the file:
#***********************
[privilegedUDP]
autodetect=1

[privilegedTCP]
autodetect=1
#***********************

chmod -w nat.conf

# reboot the VM server
"/Library/Application Support/VMware Fusion/boot.sh" --restart

# exit as superuser
exit

Static IP addresses

To set static IP addresses for your VM, do the following after first shutting down all VMs and quiting Fusion. Note that these changes will be lost when you upgrade Fusion so save them in another location so that they can be restored.

# system privileges
sudo -s

# goto the directory
cd /Library/Application\ Support/VMware\ Fusion\vmnet8

# save, change protection, edit, etc for the dhcp config file.
cp vmnet-dhcpd.conf vmnet-dhcpd.conf.`date "+%Y%m%d"`
chmod +w vmnet-dhcpd.conf

emacs vmnet-dhcpd.conf

# add information to the end of the file about each VM that you want to have a static IP address

#***********************

# you can get the hardware ethernet address of the VM by looking at the 
# *.vmx file inside your VM folder for "ethernet0.generatedAddress"
 host n32-01 {
   hardware ethernet 00:0c:29:c0:98:e7;
   fixed-address 172.16.149.127;
}
  
#***********************

chmod -w vmnet-dhcpd.conf

# reboot the VM server
"/Library/Application Support/VMware Fusion/boot.sh" --restart

# exit as superuser
exit

Now, on your Mac's /etc/host file, append the appropriate entries for the VMs; eg:

172.16.149.127  n32-01

If you also do the same on all your VMs, they will be aware of each other's hostnames.

Now you should be able to login to the VM using the hostname from a Mac terminal session.

Shrink a disk

(This method is obsolete - VMWare Fusion 2.0 has a button that does this in a nice way; however you will still need free space on your hard drive to accommodate the current and shrunk VM disks.)

In most cases, it would probably be easier to create a new disk, copy the contents over and delete the original one to reduce the amount of disk space used by your VMs. There is another method though - to pad it with 0s as described below. Note that to do this, you will need free space on your host machine that is the sum of the current VM disk contents and the VM disk size.

# login as root to your VM and after deleting unwanted stuff, pad it with 0s.
cd <the partition you want to shrink>
cat /dev/zero > zero.fill; sync; sleep 1; sync; rm -f zero.fill
shutdown -h now

Next, run this VM tool (in the example below, /Users/desilva/NO_BACKUP/vmware/atlas-4.5-32-01.vmwarevm/atlas-4.5-32-01-IDE_0-0.vmdk is my VM disk in one of my VMs.)

/Applications/VMware\ Fusion.app/Contents/MacOS/diskTool -k 0 /Users/desilva/NO_BACKUP/vmware/atlas-4.5-32-01.vmwarevm/atlas-4.5-32-01-IDE_0-0.vmdk

At the end of this process, the disk space usage on your host machine should be shrunk to the size actually used.

-- AsokaDeSilva - 27 May 2008

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2026-10-05 - AsokaDeSilva
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback