Two Linux virtual machines sharing /home partition under VMwareFollow @ggarron
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.
Step 2 - Choose Linux
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
Step 4 - Select one or two processors,
Step 5 - Select if you want your VMachine to be private or not
Step 6 - Choose the amount of memory for this machine
Step 7 - How your network connection will be?
Step 8 - The type of IDE adapter (I've chosen the default)
Now here it comes the creation of disk
Step 10 - Choose to create a new disk.
Step 11 - SCSI as recommended
Step 12 - The size of disk you may need
Step 13 - And choose a name for your disk file
Now go to the VMware menu and choose
vm -> settings,
you will get a screen like this one
Step 14 - Click on Add... and you will get this screen
Step 15 - Click on hard disk and then on next
Step 16 - And create a new disk as you did before.
Step 17 - See that it will give a name different to the first one.
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
Step 20 - Choose the "Use an existing Virtual Disk" option
Step 21 - Choose the disk created as the second one for the first VM
Done with the second Virtual machine.
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
- Create a new partition table on both disks
- Create the partitions, which should look some like this.
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.