HowTo Install Virtual Machines with VMware Player

From OpenFOAMWiki
Revision as of 10:12, 7 July 2012 by Wyldckat (Talk | contribs)

1 Introduction

Testing OpenFOAM installations on several different Operating Systems can take its toll. But at least with virtualization, one person can handle 3, 4 or even more virtual machines at the same time or in sequence, all with a single real machine.

For the readers that don't know what machine virtualization is, here are some pages on this subject at Wikipedia:

From the last link there are 2 popular and free virtualization applications for the general public:

  • VirtualBox - The preferred among the open-source community, given the code is open-source.
  • VMware Player - The one described in this How To page and which will be referred to from here on as VMplayer.

The choice of using VMplayer is somewhat simple: it's free, very good (if not best) performance and easy to use. (and personal preference - Wyldckat 00:11, 7 July 2012 (CEST)) Nonetheless, VirtualBox is a very good competitor, specially for testing PXE boot images. (Wyldckat 00:11, 7 July 2012 (CEST))

This wiki page is divided into the following chapters:

Final introductory note: this tutorial would probably be more appreciated as a video tutorial, but that exercise is left to the readers that wish to contribute!

2 How to install VMplayer

First a few links for reference:

Go to the first link and take care of registering and downloading VMplayer for your desired Operating System (Windows, Linux or Mac OS X). (If you don't want to register... search on-line for other possible solutions, but be careful not to download damaged software.)


  • Describe existing installers and how to run them on each OS.
  • Show pictures of the installation process, which should be nearly identical for all of them.

3 How to create a new virtual machine

TODO... 1st upload pictures, then write dialogue...

Here it will be exemplified how to create and install a virtual machine with Xubuntu 12.04 x86_64 (64bit). This assumes you've already downloaded the desktop ISO of Xubuntu 12.04 x86_64, which we'll leave to the reader to figure out how and were to get it.

3.1 Create a New Virtual Machine

This section will take you step by step on how to create a new virtual machine, mainly oriented to test building OpenFOAM. This example will use Xubuntu 12.04 x86_64 (aka 64bits and amd64).

To run the VMplayer, it will depend on the Operating System you are using on your real machine:

Should be on the programs menu, on the lower left corner of the screen, in the button also known as the Start button.
Depends a bit on the distribution. The more modern ones work the same way you run any other application: you write the name of what you want to run (vmplayer, vmware or even player) and it will show you what it thinks you mean. On the more classic ones, it usually is put in the System Tools section.
You can also go old school and run in a terminal/console window:
Mac OS X
If you have one, then you should already know where to look ;)

So, after you've managed to figure out how to run VMplayer, here are the steps to be taken (you can click on the images to see them bigger):

0. This is the main window of VMplayer 4.0.4, as shown on Ubuntu. The Windows and Mac versions should be almost identical.

Press the giant button Create a New Virtual Machine.
1. Here you can either use the automagical OS installer that VMplayer provides, which provides an automated way for installing the Operating system. For that method, pick either the first or second method shown above.

For this tutorial, we'll use the manual installation procedure (the third one), so we can have more control over the process.
2. Here things can get tricky at times. You have to choose the Guest Operating System (Guest is the virtual machine you're creating) as close as possible to the one you're installing. That includes the architecture, i.e. 32 or 64bit!

For the exemplified Xubuntu 12.04 x86_64 is a derivative of Ubuntu, so we will choose Ubuntu 64-bit.
3. Now for the location: this one is a bit confusing at times, but it's quite simple. As shown in the example above, the Name is the name given to the machine; the Location is the path to the folder where the machine is to be stored in.

The confusion can be that one might assume that the Location is the parent folder for the virtual machine, where the Name would then give the folder name to the machine, which is not the case.
4. Disk size is the maximum size of the primary virtual hard-drive. 20GB is usually more than enough for just testing OpenFOAM and ParaView. The file is not completely allocated when creating it,s o it's a very good way to save space as well!
As shown in the example, keep the virtual disk in a single file, so you can have the best performance. The split option is very useful if you want to carry the virtual machine inside an external hard-drive that is formatted to FAT32.
5. This is the summary of the hardware to be used by the virtual machine. We will want to customize it because building OpenFOAM needs more power.
6. For memory, we'll need a bare minimum of 1.6GB of RAM for 2 virtual cores and about 2GB for 4 cores. As shown in the image, you can either use the vertical tick bar (the one with the blue, green and yellow ticks) or change the value directly in the box that says 2048. Note: If you change the value numerically, use the up and down arrow on the right of the edit box to update the value; otherwise the value might not be defined properly.
7. On the left, choose the Processors row. Now if your real machine has 4 or more cores (or even Hyper Threading), then choose 4 processor cores. If not, choose less cores, to avoid overloading your real machine.

As for the Virtualization Engine, leave the default values as shown in the image above. If you're curious about what they do, check the user guide or search on-line.
8. Pick the Display on the left. The feature Accelerate 3D graphics has been known to be very experimental, so if you want to, you can use it at your own risk. The advice here is to leave things as shown in this picture above.
9. Pick the New CD/DVD (IDE) on the left. Here you can choose right away the ISO image that has the Xubuntu CD image.

For now, this is it, so you can hit the Close button.

Keep in mind that you can add and remove virtual hardware, such as serial ports, hard disks, CD/DVD drives, sound cards, network cards, floppy drives and so on. You can add and remove them later on.
10. Here's the final summary for the virtual machine! You can click on the button Finish.
11. These are instructions about the next steps that can be taken. We'll show them step-by-step on this tutorial.

3.2 Installing Xubuntu 12.04 x86_64

Now onward to installing Xubuntu 12.04 inside the virtual machine:

0. TODO...
1. TODO...
2. TODO...
3. TODO...
4. TODO...
5. TODO...
6. TODO...
7. TODO...
8. TODO...
9. TODO...
10. TODO...
11. TODO...
12. TODO...
13. TODO...
14. TODO...
15. TODO...
16. TODO...
17. TODO...
18. TODO...
19. TODO...
20. TODO...
21. TODO...
22. TODO...
23. TODO...
24. TODO...
25. TODO...
26. TODO...
27. TODO...
28. TODO...
29. TODO...
30. TODO...

4 Troubleshooting

On this chapter is shown various known issues and solutions. Other issues and solutions can be found in the official documentation (see chapter How to install VMplayer) and on-line.

4.1 The yield() function is not activated

Issue: A message dialogue box appears saying:

The yield() function is not activated

And doesn't allow running the machine.

Note: This is happens on Linux with kernel versions greater or equal to 2.6.31.

Solution: To fix this until next boot, run as root:

echo "1">/proc/sys/kernel/sched_compat_yield
sysctl -w kernel.sched_compat_yield="1"

For a permanent solution, run as root as well:

echo -e "\n\n#This is needed for Virtual Machines to run at full power\!\nkernel.sched_compat_yield = 1" >> /etc/sysctl.conf

4.2 Unable to operate the VMplayer window

Issue: Error and warning windows sometimes pop to the wrong side of the window, namely to the back of the VMplayer window!

Note: This is more common on Linux.

Solution: The main window is sometimes still usable, in the sense that it can still be moved out of the way, to reveal the small error/warning dialogue in the back of the main window.

4.3 /dev/vmmon does not exist

Issue: A dialogue appears with the message:

/dev/vmmon does not exist

Note: This is more common on Linux.

Solution: run as root:

/etc/init.d/vmware stop
/etc/init.d/vmware start

5 History

Readers are welcome to improve this document if they so see fit to do it. Links to video tutorials directly related to this tutorial are also welcome.

Below is a short edit history. For the complete history, see the History link at the top-right of the page.

  • Wyldckat 00:30, 7 July 2012 (CEST) - Still editing the page...