I wanted to switch from MAMP to (virtual) LAMP on my Mac in order to have a development platform that is identical to my production servers.
In production I use Ubuntu 10.04 as my server OS of choice, hosted by Amazon.
I used VMWare before, basically just to test websites in IE. After IE6 got killed (thank God!) I stopped using VMWare.
I thought installing ubuntu server would be easy, I couldn't be more wrong!
I did a couple of installs, which all fail (due to Fusion lite package and vmware tools download/install issues).
After some searching I found out that I needed Fusion full version (btw even with this version I had issues with sharing on a easy install -> empty /mnt/hgfs ).
Then I did a manual install and only installed ssh.
In order to install vmware tools I did:
sudo apt-get build-essential checkinstall sudo apt-get install linux-headers-virtual sudo apt-get install --no-install-recommends open-vm-dkms sudo apt-get install --no-install-recommends open-vm-tools
(see: Installing VMware tools on linux guest)
Then via VMWare menu i selected Virtual Machine -> Install VMWare tools.
In linux:
sudo mount /dev/crom /crom tar xzvf /cdrom/VMwareTools-8.8.0-465068.tar.gz -C /tmp/ cd /tmp/vmware-tools-distrib/ sudo ./vmware-install.pl -d sudo reboot
Via Sharing Options added a folder and it worked! Yey!
Because I need apache user (www-data) to write to this share I needed to change permission on this folder. Apache user has uid 33 and gid 33:
In linux:
id www-data
uid=33(www-data) gid=33(www-data) groups=33(www-data)
On ubuntu hgfs mount point is defined in /etc/mtab:
.host:/ /mnt/hgfs vmhgfs rw,ttl=1 0 0
Editing this file is useless so I copied this to /etc/fstab and added some user parameteres to it:
.host:/ /mnt/hgfs vmhgfs rw,ttl=1,uid=33,gid=33 0 0
After reboot I got some issues mounting /mnt/hgfs and had to skip mounting, so I added 'nobootwait' in /etc/fstab, so the line reads:
.host:/ /mnt/hgfs vmhgfs rw,ttl=1,uid=33,gid=33,nobootwait 0 0
Booting went just fine now, except that user permission where stil 501 as uid and dialout as gid:
edin@ubuntu:~$ ls -l /mnt/hgfs/ total 1 drwxr-xr-x 1 501 dialout 136 2011-09-16 01:30 Websites
I manually re-mounted:
edin@ubuntu:~# umount /mnt/hgfs edin@ubuntu:~# mount /mnt/hgfs edin@ubuntu:~# ls -l /mnt/hgfs/ total 1 drwxr-xr-x 1 www-data www-data 136 2011-09-16 01:30 Websites
Needles to say, I really got pissed off (excuse my French). I got dirty (I don't recommend these steps, there is a better way to do this, I just wanted it to work):
I created a bash file which did the re mounting:
sudo nano /bin/remount_hgfs
In the file I added:
#!/bin/sh -e umount /mnt/hgfs mount /mnt/hgfs
Made it executable:
sudo chmod +x /bin/remount_hgfs
I needed this to execute on boot, so in /etc/rc.local i added (just before exit 0):
sh /bin/remount_hgfs
Afer reboot everything finally worked. I can finally get back to work.
Has someone had same issues as me (and is there a better solution)?