The simplest method of getting OpenFOAM running for this course is to set up a virtual machine. We prepared a VirtualBox appliance which runs on any operating system that VirtualBox supports (Windows, Mac OS X and Linux being among the more popular choices). We strongly recommend that for the purposes of this course you install OpenFOAM on your laptop using this method. This will give you a working installation with very little effort required on your side and has the added benefit that all installations are uniform.
Windows and Mac OSX
- Chances are good that your package manager already offers you a VirtualBox package.
On Debian and Ubuntu systems, the package is called virtualbox-ose, for OpenSUSE it is simply called virtualbox.
- If you want a newer version, or if your Linux distribution doesn't offer VirtualBox, chances are good that you will find a package on the official VirtualBox Wiki.
- Download and install the ExtensionPack.
Importing the VirtualBox appliance
- After you installed VirtualBox on your laptop, we deliver you on the first day of the course at 12.30 with a virtual machine appliance. Please note that this file is large (>2 GB).
- Start the VirtualBox application and from the File menu select Import Appliance…. In the dialog that appears click Choose… and select the acquired OpenFOAM-ToolsCourse.ova file and click the Next button.
- In the following dialog verify that the listed RAM size is at minimum 1024 MB, but leaves also about 1GB of memory for your host operating system. Finally click Import and wait for VirtualBox to finish importing.
- If your computer has a processor that provides hardware virtualization (Intel calls it VT-x, AMD calls it AMD-V), you can make your virtual machine faster by enabling the hardware virtualization in the BIOS setup and in the Machine→Settings→System→Acceleration dialog of the virtual machine. You should only modify your BIOS settings if you know what you are doing and feel comfortable navigating the BIOS setup. BIOS mis-configuration can break your computer!
Starting the virtual machine and testing the installation
Setting up a shared folder (optional)
With a shared folder you can directly transfer files and directories from and into your virtual machine very easily.
- From the machine settings (Machine → Settings) select the Shared Folders pane and add a new shared folder using the icon looking like a folder with a plus sign (marked with a red border in below screenshot)
- In the newly opened dialog use the upper drop-down box to select the directory on the host computer you want to share with the virtual machine. In the text box below give that share a name, usually the default proposed by VirtualBox is OK. We will refer to this name as SHARE from here on. Click Ok and close the settings dialog.
- Start the virtual machine, log in and open a terminal window by clicking the computer screen icon in the top panel. Enter the following commands:
su -l -c "usermod -a -G vboxsf $USER"
Enter the root password when prompted for it (you defined it during the initial setup of the virtual machine). Then log out and back in for the changes to take effect.
- Now you should be able to read and write files in the /media/sf_SHARE folder of the virtual machine. If the virtual machine was running while you added the shared folder as described in above steps, it might be necessary to reboot it for the shared folder to appear.