CentOS powers my personal websites and since it is based on RedHat Enterprise Linux (which we use at work) it makes my life easier when jumping back and forth between servers as all the filepaths are same, repositories and packages are all consistent. All in perfect harmony as far as work and personal web server are concerned.
Being a Mac user at home and a PC user at work (fanboys hold your guns), I wanted a local development enviornment for my macbook, environment that was consistent with my work and personal web server. So far I had been using the OSX native Apache server + MySQL + PHP. So, naturally the software versions are not the same, OSX does not use /var/www/html as the default apache directory (list goes on..)
I went about trying to install CentOS 5.3 for VMWare Fusion on my MacBook, it was anything but easy. The net installer failed on me around 4-5 times. After wasting hours here is how I went about it all..
Download CentOS 5.3
http://mirror.as29550.net/mirror.centos.org/5.3/isos/x86_64/
You can use any of the ISOs, perhaps try the net install and if that does not work, you could download CD1, for a minimal server install that is all you will need. For those of you who are in a hurry or just too lazy, grab a VMWARE Image of CentOS 5.1 here http://www.vmware.com/appliances/directory/1122
Install CentOS 5.3 in VMWare Fusion
I wont go into details here, if you have used VMware Fusion before, you will know how easy this is.
CentOS 5.3 Installation Setup and Config
Again, this has been covered in great length already and I feel I cannot improve upon this fantastic walkthrough at http://www.howtoforge.com/perfect-server-centos-5.3-x86_64-ispconfig-3 and http://www.howtoforge.com/perfect-server-centos-5.3-x86_64-ispconfig-3-p2, you wont need much beyond the first 2 pages.
Almost all of the procedure is the same, with the exception of initial package installation. Since I wanted a bare minimal installation, here is what I installed initially:
- Editors
- DNS Name Server
- Mail Server
- Server Configuration Tools
- Administration Tools
- Base
- System Tools
After the reboot, login and setup additional user plus yum install apache, php and mysql among other packages.
OK, the hard part is done.
VMWare Fusion DHCP - Static IP for CentOS Server
Since VMware Fusion allocates a IPs randomly to guest OS, I needed to change the VMware config to ensure my local CentOS server always had a fixed IP.
VMware uses vmnet8 interface for virtual NAT networking and can be configured in the /Library/Application Support/VMware Fusion/vmnet8/dhcpd.conf file (OSX).
Here is what it looks like on my setup:
subnet 192.168.181.0 netmask 255.255.255.0 {
range 192.168.181.128 192.168.181.254;
option broadcast-address 192.168.181.255;
option domain-name-servers 192.168.181.2;
option netbios-name-servers 192.168.181.2;
option domain-name "localdomain";
option routers 192.168.181.2;
}For each VM OS you can add additional config lines as below:
host CentOS-5-64-bit-vm {
hardware ethernet 00:0c:29:4b:b9:a3;
fixed-address 192.168.181.10;
}Hostname:
It is important that your machine name does not contain any spaces (it is easy enough to rename the VM OS in VMWare Fusion).
Ethernet Address:
Inside the Guest OS you can find out your virtual ethernet id by typing ifconfig -a or alternatively you can take a peek inside guest machine's VMX file (located in ~/Documents/Virtual Machines/myos/myos.vmx)
IP:
You can choose an IP address, but ensure this is outside the subnet range specified in the original dhcpd.conf
done.
Restart the VMWare daemons
sudo "/Library/Application Support/VMware Fusion/boot.sh" --restart
Setup local domains for your VMGuest
To test and access your development server, you can SSH on from OSX Terminal, but it is easier to setup local domain names for actual web development.
In OSX you can edit your /etc/hosts file as below:
92.168.181.10 dev1 dev2 dev3
And there you have it, a local development server that is perfectly in sync with your remote setup. Ofcourse, this method can be repeated with any Linux OS of your choice, CentOS is the one I use for mine.
This by no means is a comprehensive guide as I am fairly new to Linux myself, so, please feel free to comment and share your thoughts and ideas.
Further Reading and References
How to set up networks and dhcp on vmware (on Mac and other OSs)
DHCP on VMWare Fusion
http://groups.drupal.org/node/19497
http://groups.drupal.org/node/6266
http://www.thoughtpolice.co.uk/vmware/

















4 comments
15th Jul, 09
Or you could just get one of the vmware appliances from http://thoughtpolice.co.uk/vmware
much easier to hit the ground running
15th Jul, 09
Yes indeed. I had included a link to the page, but I have not tried one as yet. It was a good learning curve none the less. Perhaps a tad steep for a first timer, in which case a ready image is ideal.
16th Jun, 10
I just completed a CentOS 5.5 Release 2 install (64 bit) on my Macbook Pro using VMWare Fusion. For an install that didn't include ANY of the package groups, I was prompted for ISO's one through six. Like the author of this website experienced, netinstall of CentOS on Fusion (mine's v. 2.0.5) failed. FYI, my disk usage after installation was 2.2 GB.
16th Jun, 10
Thanks Marshall,
I tried doing a fresh net install of centos-5.5 and I had the same issues. My colleague Darren Shelley and I tried installing the same in Virtual Box and experienced the same issues. I managed to get an install without ANY packages, but that wasnt much use as this didnt include YUM either.
So far, DVD install is the only method that has worked for me. Due to the minimal set of packages I selected, it only required the first DVD for the install!
I am slowly edging towards VirtualBox on my Macbook. Anyone with experience of both?
Post new comment