Skip to end of metadata
Go to start of metadata

This tutorial will explain how to create the "virtual machine" using the "virtual machine player" in order to run the practical exercises.

 

What is a "virtual machine"? A virtual machine is literally one computer operating system and its applications running on top of another operating system. It is a way of using Linux with MacOSX and Windows for example. But is can also be used to run one version of Linux on another version of Linux. Often called "appliances", virtual machines are useful for providing complete environments for certain applications so that no software needs to be installed on the host computer.

What is a "virtual machine player"? A virtual machine player is an application that is used to run or 'play' the virtual machine. This is typically either 'VirtualBox' or 'VMplayer'. Mac users may be familiar with 'Parallels' which is also a virtual machine (VM) player. The VM player software needs to be installed on the host computer before the virtual machine can be used.

Why use a "virtual machine"?. Virtual machines are very useful for training. All of the software and training materials for OpenIFS and Metview are loaded into the virtual machine. There is no need to install software/files on your own computer. OpenIFS user workshop create the workshop case studies using virtual machines so that we can deliver training remotely. We have examples of virtual machines from previous workshops. For more information please contact openifs-support@ecmwf.int.

Before you start

This tutorial assumes you have already downloaded one of the OpenIFS/Metview virtual machines. The virtual machines have been used for the OpenIFS workshops.

If you do not have a virtual machine and would like to try one, they are available for download on the OpenIFS ftp site. Please contact openifs-support@ecmwf.int for more information.

On this page...

Also see...

The VirtualBox user documentation page has more information about creating and using virtual machines.

It includes a FAQ and HowTo articles on various topics.

Information about VirtualBox is also available on the openSUSE website.

Creating the virtual machine

In this tutorial we will assume the use of VirtualBox as the VM player (see: http://www.virtualbox.org/)

 

  1. First make sure you have downloaded and installed VirtualBox and it starts correctly.

  2. Start VirtualBox and click the 'New' button:



  3. In the window that appears, for Name type 'openifs' (any name is fine), for Type select 'Linux', for Version select 'openSUSE (64bit)'.


  4. For Memory size, increase it to at least 1200Mb more if you can. Do not move the bar into the red! This will cause your computer to slow down drastically and it may even freeze.
    The amount of memory on your computer may be less or more than shown in the figure below.


  5. For Hard drive, select the option 'Use an existing virtual hard drive file'. Then click on the yellow folder icon to locate the virtual machine file. This file will have a name similar to the one shown below and always have the .vmdk extension.


  6. Then click on the Create button. The newly created virtual machine should now be shown in the left panel.



  7. Next, click on the Settings icon to change a few of the properties.


  8. Under the General tab, select Advanced. For Shared Clipboard, enable Bidirectional and likewise for Drag'n'Drop (your system may not support these). When set these will allow cut'n'paste of text between the virtual machine and your computer.


  9. If (and only if) you have a computer with multiple processors or multiple 'processor cores', you may want to increase the number of processors available to the virtual machine. To do this, in the Settings window, select System, then Processor and adjust the slider. As for memory settings, do not go into the red!


  10. Enable Shared Folders. This allows both the virtual machine and the real computer to exchange files as both can read and writes files to any directories you specify as a shared folder.

    Shared folders may not always work. It relies on software known as 'VirtualBox guest additions'. Although this is installed in the OpenIFS virtual machines, it does not always work and may need re-installing. For more information, please see below.


    In the Settings window, select Shared Folders and click the blue folder icon with the green cross to create a new one.



  11. In the window that appears, under Folder Path select the folder or directory on the host computer that will act as a shared folder (create it if it doesn't already exist). Then under Folder Name give it a name as it will appear on the virtual machine; shared_folder might be a good choice.
    Make sure that Read-only is not selected and Auto-mount is selected.

    With Auto-mount selected, the shared folder will be available when the virtual machine boots. It can normally be found in the directory /media/ with the prefix 'sf_' added to the shared folder name.

    If shared folders do not appear to work in the virtual machine, it may be that some additional software 'Guest Additions' is not installed.

    The version of Guest Additions installed must match the version of VirtualBox. If this is not the case, or in doubt, reinstall the Guest Additions software (see below).

  12. Close the Setttings box. To start the virtual machine, click the Start green arrow on the main window.



  13. When the virtual machine has booted, the keyboard layout can be changed by clicking on the small icon labelled 'gb' in the bottom right corner.
    The default is set to a UK keyboard.

On first boot

The first time the virtual machine (VM) boots, it may take you through a series of screens to accept the licence, configure the language, timezone and date.

Use TAB and RETURN keys to navigate through these options, the mouse will not work until the VM has fully booted.

The first screen asks you to confirm acceptance of the OpenIFS Binary Licence.

Use TAB to navigate to option to Agree to the License Terms:

Hit RETURN to select (put a X), then TAB again to Next:

and hit RETURN to progress to the next screen.

The following screens will ask for the choice of language:

keyboard and timezone. Again use the TAB key to navigate the options (or the shortcuts highlighted in yellow) and RETURN to select the option.

These steps only need to be done on the very first boot of the virtual machine.

Resizing the screen and shared folders

Resizing screen automatically

To have the monitor size in the virtual machine change size automatically as the virtual machine window is resized, select the 'Auto resize' option from the View menu when the virtual machine is active.

In order for this to work, some additional software might need to be installed on the virtual machine, known as Guest Additions. If this doesn't work, try installing (or reinstalling) the guest additions software.

Change default screen size

The first time the virtual machine (VM) is started, the screen size may be set to 1024x768 pixels.

To change the screen size requires changing the desktop settings in the Linux virtual machine (similar to any Linux desktop)

  1. Start up the virtual machine and let it start up fully.
  2. Resize the VM window to the required size.
  3. In the bottom left corner, find the openSUSE icon and click it.
  4. Then select 'Applications' and 'Configure Desktop':
  5. On the window that appears, find the icon labelled 'Display and Monitor' and click it.
  6. On the display window, click 'Size & Orientation' in the left bar (if not selected).
    In the middle panel, find the 'Size' menu:
  7. Select the largest size on this menu. It should match the resized window from step 2.
  8. Click 'Apply' to set the new resolution:
  9. Confirm the change and you're done.

Shared folders

Shared folders enable the host and guest machines to share files via a common folder (directory).

Please see instructions above for how to setup the shared folder for the virtual machine.

In order for this to work, some additional software might need to be installed (or reinstalled) on the virtual machine, known as Guest Additions. See below for more information.

Install Guest Additions

Although Guest additions is normally installed in the OpenIFS virtual machines, the shared_folder (and auto-screen resize) does not always work. This may be due to different versions of the guest additions between the VM and VirtualBox.

In which case, re-install following the instructions below.

To install or re-install Guest Additions follow these instructions.

Check guest additions are installed

To check if guest additions is already installed run the following command in a Terminal:

 lsmod | grep -i vbox

if you see the following output (or similar), then the Guest Additions software is installed.

vboxsf                 47936  0
vboxvideo              12669  1
vboxguest             293037  6 vboxsf
drm                   335594  3 vboxvideo

Following the install steps below will overwrite any existing guest additions installation. It should not be necessary to uninstall. However, you can uninstall guest additions by:

sudo zypper rm virtualbox-guest-kmp-default virtualbox-guest-tools virtualbox-guest-x11

This will prompt for the root password 'metv1ew!'

Install steps

These steps use the Mac OSX version of VirtualBox. Other systems may be slightly different.

  1. Start up the virtual machine (VM) and let it start up fully.

  2. On the virtual machine (not the host), check that the necessary kernel files are installed:

    zypper search kernel-devel

    If not, install them with the command:

    sudo zypper install kernel-devel

    The installation needs to be done as the root user. This command will prompt for the root password 'metv1ew!'

    The 'make' and 'gcc' packages are also required but these are normally available by default in the OpenIFS virtual machine.

  3. With the virtual machine as the active window, select the 'Devices' menu and the 'Install guest additions CD image..



    A popup window should appear in the virtual machine showing the CD.
    Click the Guest Additions CD to mount it. A new folder window should appear showing the contents of the CD.

  4. In the virtual machine, open a Terminal window from the openSUSE icon and 'Applications' menu


     

  5. In the Terminal, change to the directory where the VBoxAdditions CD was mounted. This will be under the /run/media directory, followed by the username.

    e.g.
    cd /run/media/openifs/VBOXADDITIONS_4.3.34_104062

    (older systems may use /var/run/media instead).

  6. To start the installation of the Guest Additions, type the following in the Terminal:

    sudo ./VBoxLinuxAdditions.run

    This will prompt for the root password, usually 'metv1ew!'

    The installation may report that Guest Additions is already installed and ask you to confirm.

    The installation only takes a few minutes.

  7. Reboot the virtual machine for the changes to take effect.

 

Allow normal users access to shared folders

Check that the user accounts have access to the shared folder. The shared folder is usually mounted in the /media directory:

% ls -l /media
drwxrwx--- 1 root vboxsf 170 Jun  2  2014 sf_shared_folder

In the above example, the VirtualBox settings have used a shared folder name of 'shared_folder'.

For users to read/write to this directory, they must be in the 'vboxsf' group. Look in the /etc/group file to check:

% grep vboxsf /etc/group
vboxsf:x:493:openifs,metview

If the usernames are missing, add them using these commands:

sudo usermod -a -G vboxsf openifs
sudo usermod -a -G vboxsf metview

The user will need to log out then back in again for this change to take effect.

Please note that the user 'openifs' does not exist on earlier OpenIFS Virtual Machines.

Finally, make a link from your home directory to the shared folder:

cd
ln -s /media/sf_shared_folder shared_folder

 

Download OpenIFS workshop files

Some of the earlier OpenIFS virtual machines (from 2013 & 2014) came with the metview exercises and OpenIFS example forecast data already installed. For these virtual machines, there is no possibility to install the exercises from the other OpenIFS workshops.

For the 2015 and later OpenIFS workshops, download the latest version of the OpenIFS/Metview  virtual machine (contact openifs-support@ecmwf.int for assistance).

Configure the virtual machine as above and let is start fully. Then:

  • Open a Terminal Window
  • In the home directory run the command:

    ./get_workshop

    and follow the instructions.

Please note that these workshop files are large and will take some time to download and unpack, depending on the speed of your network connection and computer.

Problems and solutions

Here's a list of possible problems and their solutions that might arise using the virtual machine.

64-bit guest OS list is not displayed

VirtualBox does not present the list of 64 bit OS when creating the virtual machine.

This might be because your computer is only 32bit. In which case you can't use the virtual machines as they are built as 64-bit.

If you have a 64bit computer, this might be because of settings in Windows 8 or 10 that conflict. Please see this article for more information on the solution http://www.fixedbyvonnie.com/2014/11/virtualbox-showing-32-bit-guest-versions-64-bit-host-os/#.VvvZBT_VmuA

VT-x is disabled in BIOS

Some users may get this error when first trying to run the virtual machine (or a similar error):

"Failed to open a session for the virtual machine openifs. VT-x is disabled in the BIOS. (VERR_VMX_MSR_VMXON_DISABLED)."

This arises because the OpenIFS/Metview virtual machines are 64-bit which requires hardware virtualization support in the BIOS of your computer to be enabled.

There are many helpful pages on Internet forums to resolve this, see for example: http://askubuntu.com/questions/256792/how-do-i-enable-hardware-virtualization-technology-vt-x-for-use-in-virtualbox

Mac users. The above instructions apply to machines running Windows/Linux which allow access to the BIOS. On Macs, this is not possible though this issue can still occur. If you see this message on a Mac, it's likely that another application has changed the state of the VT-x hardware acceleration. In which case, a reboot of the machine usually clears it.

If none of the above solve the problem, make sure you are running the latest version of VirtualBox for your machine. Older versions of VirtualBox do not support VT-x on newer computers.

Network is not working

In some cases, it may not be possible to use the VM to connect to the outside, or connections only work to the local network. This may be due to proxies on your local network intercepting external traffic.

To solve this, configure the VM with your local network proxy settings in Yast2 > Network settings > Proxy.

Drag'n'Drop not working

Check that the Settings for the VM are set to 'Bidirectional'. Also, when the VM is running, check that the menu option "Devices" -> "Drag'n'Drop" is also set to Bidirectional.

If shared folder does not automatically mount

On the virtual machine, mount the folder manually by (for example to your home directory):

mkdir $HOME/share
sudo mount -t vboxsf -o uid=$UID,gid=$(id -g) shared_folder $HOME/share

The name 'shared_folder' should be the same as the name of the shared_folder in the VM Settings panel.

Shared folders stop working after kernel update

If a system update has updated the kernel files and shared folders have stopped working, reinstall the Guest Additions software. Guest Additions adds files to the kernel and these must be reinstalled if the kernel is changed.