Monthly Archives: November 2010

I and many others I know run MacOS as their primary operating system. Much of the research I do involves Linux, and therefore I often use Linux in order to become friendly with it.

A good way to run Linux is inside a virtual machine, where it need not worry about power management which unfortunately it doesn’t handle well, and fortunately, MacOS does. Linux is getting better though. Anyway, Linux runs well inside VMware Fusion, and with plenty of memory, you don’t even really notice that it’s running in a VM.

Sharing files between the host and the Linux is a problem that is easily solved. VMware try to give you tools to do it, and they seem to work well with Windows. MacOS has an NFS server, Linux does NFS well. With a little hacking, you can get MacOS and Linux to share a common home directory, allowing for very easy, seamless, integrated file sharing between the two environments.

Warning, the procedure below can be harmful to your Ubuntu installation if you do something wrong.

Give MacOS an /etc/exports file with the following contents (typical):

/Users/<macosuser> -network -mask

Start nfsd by typing:

$ sudo nfsd enable

Install Ubuntu inside Fusion in the normal way. Open a terminal, and give the root user a password:

$ sudo passwd

Log out of gnome, and get to a console by pressing fn + ctrl + option + F1, and login as root.

Edit /etc/passwd:

# vim /etc/passwd

Change the uid of your local user to that of your user on MacOS. You can find your MacOS uid by issuing the following command in Terminal:

$ ls -ln ~

It will probably be 501 or similar. Change the uid of the local user in Ubuntu (probably 1000) to 501. Do the same for your local group in /etc/group for Ubuntu.

You will also need to know the IP address of the VMware adapter on MacOS. Use $ ifconfig. It will probably be something like:

ether 00:50:56:c0:00:08
inet netmask 0xffffff00 broadcast

You now have the option of putting this in /etc/hosts like:


Which will allow you to refer to your MacOS as macos_hostname.local in the next section.

The next step is to mount the nfs shared home directory into /home/<ubuntuser>. Do this by editing /etc/fstab and adding a line at the bottom that looks like:

<macos_hostname>.local:/Users/<macosuser> /home/<ubuntuuser> nfs defaults 0 0

You should now be able to login to Ubuntu again by pressing fn + ctrl +option + F7 (maybe F8 on new Ubuntu’s), and have your MacOS home directory shared with your Ubuntu user and have full read/write permissions.


I use a mac and iphone, therefore I use iTunes. Unfortunately, it’s the easiest solution to music management for the mac and iPhone.

I have a Time Capsule as well, which I use to store my music data, and this can be mounted to my laptop using AFP.

I also have an external hard drive, which contains a mirror of my music data, which I rsync from the Time Capsule weekly.

Being a unix variant, macos has the concept of symbolic links and I thought I could just use this feature to switch the path to my music between the Time Capsule or my external hard drive. Simple, replace a single symbolic link, and my music magically comes from a different backing store.

Unfortunately, iTunes resolves symbolic links when you add files to its library. So my symbolic link idea doesn’t work as well as I had hoped.

Bring in titl, Tools for iTunes Libraries. A not-very-well-written library to modify the binary iTunes library file. Once I hacked around the Java, I managed to get it to do what I wanted, and I now have a script which backs up my iTunes library file, finds/replaces paths and allows me to switch the source of my music data.

All because iTunes resolves symbolic links before storing paths.