Setting up an NFS share between a virtual Parallels Ubuntu server and OS X Mountain Lion

Parallels upto now has made my life very easy for virtualisation. Instances run fast, don’t slow down the mac and setting up shared directories so remote server and host can see the same application files works flawlessly. Until today that is…

Today I need to setup Symfony2. During it’s setup, config and running it uses a combination of cli and web tools which did not get on with my usual shared directory setup. I could either get it running on the mac without the ubuntu server able to see it or working on ubuntu without the IDE on the mac able to see it.

The solution turned out to be simple – NFS to the rescue!

On the mac to setup the NFS server edit the /etc/exports file to specify the directory to share and the network range that can see it. Most importantly is  -mapall=root:wheel which ensures that all client writes appear as root, so there are no permission hassles on the client end.

UPDATE: on using this method to share a system directory on another project the share failed, so it may not be possible to use this option in all cases.

 

At the client end create a mount point and mount:

And for good measure add into /etc/fstab

Copying a parallels linux instance to a new machine – and getting eth1 instead of eth0

Copying a parallels instance is easy as copying the file from one machine to another.

But, this seems to screw up networking. The copied instance starts but a call to ifconfig -a shows no eth0 but a disconnected eth1 instead.

I’m guessing this is because the mac address the new version of parallels is supplying is different.

A way to fix is to edit /etc/udev/rules.d/70-persistent-net.rules

and remove the old card definition, and reassign eth0 to the new card

 

In hindsight a better thing to try would be to set the mac address to that of the original machine before starting the instance on the new machine.

Updating Debian parallels tools for Parallels 7

On clicking Virtual machine/Install parallels tools seems to do nothing. What should happen is the parallels tools installer .iso image should appear mounted in the virtual cd rom drive (/media/cdrom0)

This may be due to the ‘real’ host cdrom drive hiding the mounted iso. To remap umount and remount the drive to make the installer appear:

Getting windows running in Parallels 6 to see a site hosted on OS X apache virtual host

1) Use the instructions in Elric’s post, just above, to get things into their default state, and then change the IP range if you need to (I use the 10.x.x.x range for other things, so for Parallels, I use address in the 172.31.x.x range)

2) Launch the Terminal (Applications>Utilities>Terminal) if it’s not already running, and type: ifconfig

3) As joevt stated above “In Mac OS X, the Parallels shared networking interface is vnic0”, so look for a block in the terminal output something like this:

Code:

vnic0: flags=8843 mtu 1500

ether 00:1c:42:00:00:08

inet6 fe80::21c:42ff:fe00:8%vnic0 prefixlen 64 scopeid 0x7

inet 172.31.0.2 netmask 0xffffff00 broadcast 172.31.0.255

inet6 fec0:0:0:fea9::2 prefixlen 64

media: autoselect

status: active

4) Note down the address after “inet” within the block (you’ll note that mine was 172.31.0.2)

5) On the parallels virtual machine, you need to edit the hosts file, which can be found at this path under Windows XP:

Code:

C:WINDOWSsystem32driversetc

6) Add lines corresponding to your sites as configured within apache, which will look something like this:

Code:

172.31.0.2 my.coolsite.com

172.31.0.2 apache_local

7) For details, you may find some parts of the originally linked article useful, but keep in mind that the options within Parallels changed with version 6, but hopefully the current post will help with that.

Good luck!