-
Notifications
You must be signed in to change notification settings - Fork 154
Installing MOM6 in a virtual machine running Ubuntu
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.
- Download VirtualBox for your OS (assume Windows from here on):
- Navigate to and download the isntalled from https://www.virtualbox.org/wiki/Downloads.
- Run the installation package.
- Answer “Install” when it asks to install each new device software (several devices).
- Start Oracle VM VirtualBox and configure a VM:
- File->Preferences: Change Default Machine Folder to wherever you have some space.
- Click “New”.
- Choose a name, e.g. “Fred”, select “Linux” for type and select your preferred Linux distribution (I’ll use Ubuntu 64bit here).
- For memory, use about half of your host machines physical memory.
- Select “Create a virtual hard drive now”, then “VDI”.
- 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.
- Choose a disk size that fits within your physical available hard disk size (I usually use 8Gb).
- 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:
- For "Select start-up disk", click the folder icon and navigate to the ISO image you just downloaded, click "Open" and then "Start".
- Follow the linux installation procedure (example below).
- If VirtualBox pops-up a message about mouse capture, make a note of the "host key" and then click "Capture".
- After installation, install "Guest additions" for VirtualBox:
sudo apt-get install dkms
- At the VirtualBox window "Devices" menu, select "Insert Guest Additions CD"
cd /media/cdrom
sudo sh ./VBoxLinuxAdditions.run
sudo reboot
- Enable "Shared clipboard->Bi-directional" from the VM window devices menu.
These instructions are based on installing debian8 and Ubuntu but other distributions will have similar steps.
- 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".
- At the Debian installation screen, use the up/down keys to select "Graphical Install".
- Select a language, location and keyboard. Debian will then detect your network.
- Choose a hostname, e.g. MOM6-sandbox, and network, e.g. gcms-rock.net.
- Decide a root user password. I disable the root account by leaving the password blank. Your user account should get sudo privileges.
- Create a user account with decent password.
- Configure the clock.
- For partition disks select "Guided - use entire disk".
- You should be presented with just one SCSI disk.
- Partition scheme: "All files...". At the prompt about writing changes to disk, select yes.
- Configure the package manager (choose your country and then guess a nearby server).
- In all likelihood you can skip the proxy server step.
- Software selection:
- My choices: Debian desktop environment, GNOME, standard system utilities
- Be patient while all the software packages are downloaded and then installed.
- Install the GRUB boot loader (since there is no other OS) on /dev/sda.
- When prompted, reboot and login and open a terminal.
- Use
sudo apt-get install XYZ
where XYZ is replaced by "vim", and again for any other packages you might want.
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 libnetcdff-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.