Setup ubuntu on VMWare Fusion 4

This is how to set up a ubuntu dev box on VMWare Fusion 4.02.

1. Add new Linux 64 machine, then edit the config with more memory and cpu

2. After installing Ubuntu, install the necessary software

sudo apt-get install vim ssh git-core build-essential lamp-server^ phpmyadmin

3. Now add new group dev, put main user and www-data to the group, update umask

4. Mount VMWare Tools cd in top menu “Virtual Machine -> Install WMWare Tools”. It will ask you to download the iso if you haven’t got it locally. (Also, if you run into problem mounting the iso, try re-enable CD/DVD and select the linux.iso in drop down list – it will appear after you downloaded it)

5. Now mount the cd and install it in Linux

sudo mkdir /mnt/cdrom; sudo mount /dev/cdrom /mnt/cdrom;
sudo cp /mnt/cdrom/VMwareTools-xxxxxxxxx[tab to find this] ~/
cd
tar -xzvf VMwareTools-xxxxxxxxx[tab to find this]
cd vmwarexxxxxxxx[tab]
./vmware-install.pl
## Now just answer the question and let it compile

5a. If you run into unable to find header path when doing ./vmware-install.pl

apt-get install linux-headers-$(uname -r)

6. Shutdown, turn on “Sharing” and add your local folder on Mac

7. After reboot a /mnt/hgfs will appear, however not in correct ownership. http://communities.vmware.com/thread/328819 has some solution. But we will using a slightly different approach: mount another with our own:

sudo mkdir /mnt/host
# Edit /etc/rc.local and add the following line before "exit 0"
mount -t vmhgfs .host:/ /mnt/host -o rw,uid=33,gid=1001,sync

7update: ok the build-in share sucks, do a samba share on Mac instead.

8. Now to config fixed ip address for the virtual machine by its MAC address (config MAC address in VMware’s “Network Adapter -> Advanced Options”)

# On Mac host
sudo vim "/Library/Preferences/VMware Fusion/vmnet8/dhcpd.conf"
# Add something like this ()
host <linux machine hostname> {
    hardware ethernet <MAC address of linux machine>;
    fixed-address <The static IP address you want>;
}
# Now modify your /etc/hosts with the new static ip

Leave a Reply