Introduction

A friend of mine from StumbeUpon, to be precise The Master Chief (Visit his SU blog) asked me after reading Dual boot with two Linux sharing home asked me if I have ever hear about doing the same thing under VMware, well the answer was not, but I decided to try it and here it is what I did, hope this was what to need MasterChief.

Creating the two Virtual Machines

First we need to create two virtual machines each one with two hard disks, and one of it will be the same for both Virtual Machines (The one that will contain the /home directory).

Step 1 - Start creating the virtual machine, I choose here custom, but may be not needed.

</img>

Step 2 - Choose Linux

</img>

And the appropriate type of Linux, in my case I have chosen other 2.6 Kernel Linux

Step 3 - Name your Virtual machine as you may like

</img>

Step 4 - Select one or two processors,

</img>

Step 5 - Select if you want your VMachine to be private or not

</img>

Step 6 - Choose the amount of memory for this machine

</img>

Step 7 - How your network connection will be?

</img>

Step 8 - The type of IDE adapter (I’ve chosen the default)

</img>

Now here it comes the creation of disk

Step 10 - Choose to create a new disk.

</img>

Step 11 - SCSI as recommended

</img>

Step 12 - The size of disk you may need

</img>

Step 13 - And choose a name for your disk file

</img>

Now go to the VMware menu and choose

vm -> settings,

you will get a screen like this one

</img>

Step 14 - Click on Add… and you will get this screen

</img>

Step 15 - Click on hard disk and then on next

</img>

Step 16 - And create a new disk as you did before.

</img>

</img>

Step 17 - See that it will give a name different to the first one.

</img>

Ok, Done with the first Virtual Machine.

Step 18 - Now repeat the step 1 to 13 for the other virtual machine, remember to choose a different name.

Once Created we are going to add another disk, but this time will be an existing one, the one we have created as the second on the first Virtual Machine.

Step 18 - Go to vm -> setting on the menu, and click on add.

Step 19 - Click on hard disk and on next

</img>

Step 20 - Choose the “Use an existing Virtual Disk” option

</img>

Step 21 - Choose the disk created as the second one for the first VM

</img>

Done with the second Virtual machine.

Installing Linux

I have installed Ubuntu, but could be any distribution you want, I will only show the relevant steps of the installation, as all the rest is as you are used to do it.

  • Be sure to choose manual disk partition

</img>

  • Create a new partition table on both disks

</img>

  • Create the partitions, which should look some like this.

</img>

See that the second disk will contain the /home directory which is the one we want to share.

Finish installing the Linux, and then install the second one taking care of this important things.

  • The user should be the same on both Linux
  • The Userid should be the same on both Linux
  • The Groupid should be the same on both Linux for the main user
  • The second Disk should contain the /home directory

Done, you can now start one or the other VMware machines, and you will have access to the same documents at their /homes directories.

By this time I have not tried but I think is not a good idea to turn both machines on at the same time.

You may want to read this article Move home directory to its own partition

If you find any better way to do it, or any mistake in this how-to please let me know, I tried it and worked fine.