Installing MOM6 in a virtual machine running Ubuntu - adcroft/MOM6-examples GitHub Wiki

Synopsis

This page gives guidance on how to set up MOM6 on an Ubuntu OS running in a Oracle VirtualBox virtual machine. We offer this page as guidance only but we cannot provide support for this process.

This overall process can take a few hours depending on your internet connection and choices.

Obtain Oracle's VM VirtualBox Manager

  1. Download VirtualBox for your OS (assume Windows from here on):
  2. Navigate to and download the isntalled from https://www.virtualbox.org/wiki/Downloads.
  3. Run the installation package.
  4. Answer “Install” when it asks to install each new device software (several devices).
  5. Start Oracle VM VirtualBox and configure a VM:
  6. File->Preferences: Change Default Machine Folder to wherever you have some space.
  7. Click “New”.
  8. Choose a name, e.g. “Fred”, select “Linux” for type and select your preferred Linux distribution (I’ll use Ubuntu 64bit here).
  9. For memory, use about half of your host machines physical memory.
  10. Select “Create a virtual hard drive now”, then “VDI”.
  11. Under "Storage on physical hard drive" - "Dynamically allocated" uses a lot less space but is slower than "Fixed". - “Fixed” is faster to use but you’ll need to decide how much disk to give over to the VM and it will take a little while to create the file-space.
  12. Choose a disk size that fits within your physical available hard disk size (I usually use 8Gb).
  13. Launch Oracle's VM Virtual Box, select the virtual machine you created above, and click "Start". The order of the following steps varies with edition and flavor of installation:
  14. For "Select start-up disk", click the folder icon and navigate to the ISO image you just downloaded, click "Open" and then "Start".
  15. Follow the linux installation procedure (example below).
  16. If VirtualBox pops-up a message about mouse capture, make a note of the "host key" and then click "Capture".
  17. After installation, install "Guest additions" for VirtualBox:
  18. sudo apt-get install dkms
  19. At the VirtualBox window "Devices" menu, select "Insert Guest Additions CD"
  20. cd /media/cdrom
  21. sudo sh ./VBoxLinuxAdditions.run
  22. sudo reboot
  23. Enable "Shared clipboard->Bi-directional" from the VM window devices menu.

Obtain and install your linux distribution

These instructions are based on installing debian8 and Ubuntu but other distributions will have similar steps.

  1. You will need to download an ISO image appropriate for you PC. Usually i386 (or amd64 is you have an AMD processor).
  • For Debian, goto https://www.debian.org/distrib/ and read the options/instructions.
    • I prefer to use "net install" usually referred to as netinst: https://www.debian.org/CD/netinst/. The netinst CD image is usually only a few hundred MBs and the big downloads then happen during the installation process.
  • For Ubuntu, goto http://www.ubuntu.com/download, follow links to download the desktop version.
    • I prefer use the alternate "network installer" which might take the name of "mini.iso".
  1. At the Debian installation screen, use the up/down keys to select "Graphical Install".
  2. Select a language, location and keyboard. Debian will then detect your network.
  3. Choose a hostname, e.g. MOM6-sandbox, and network, e.g. gcms-rock.net.
  4. Decide a root user password. I disable the root account by leaving the password blank. Your user account should get sudo privileges.
  5. Create a user account with decent password.
  6. Configure the clock.
  7. For partition disks select "Guided - use entire disk".
  8. You should be presented with just one SCSI disk.
  9. Partition scheme: "All files...". At the prompt about writing changes to disk, select yes.
  10. Configure the package manager (choose your country and then guess a nearby server).
  • In all likelihood you can skip the proxy server step.
  1. Software selection:
  • My choices: Debian desktop environment, GNOME, standard system utilities
  • Be patient while all the software packages are downloaded and then installed.
  1. Install the GRUB boot loader (since there is no other OS) on /dev/sda.
  2. When prompted, reboot and login and open a terminal.
  3. Use sudo apt-get install XYZ where XYZ is replaced by "vim", and again for any other packages you might want.

Software for FMS

To build FMS codes we need git, csh, pkg-config, gfortran, netcdf and MPI

sudo apt-get install git tcsh pkg-config
sudo apt-get install gfortran
sudo apt-get install netcdf-bin libnetcdf-dev
sudo apt-get install openmpi-bin libopenmpi-dev
#sudo apt-get install mpich2 libmpich2-dev # Not needed

Use the gfdl-ws/gnu.mk template and add FC=mpif90 CC=mpicc LD=mpif90 at the point where NETCDF=3 REPRO=1 is normally specified in other instructions.

In recent version of libnetcdf-dev, the file netcdf.inc has been removed. You can get this instead with sudo apt-get install libnetcdff-dev (note the second "f"). Similarly if linking fails you might need to add -lnetcdff to the LIBS variable in your mkmf template.