Perform these steps to install a virtual machine for Quantum Espresso on your computer:
Now you have the software to run a virtual machine, but you don’t have the virtual machine itself yet. Whence the next step:
Tell VirtualBox where it can find this virtual machine file:
Now you can launch the virtual machine:
You close the virtual machine via ‘File / Close’. You can choose to close it completely (comparable to the ‘power off’ setting of a computer) or to save the current state for later reuse (comparable to the ‘hibernate’ setting of a computer).
If after installing Quantum Mobile you find that your virtual machine has a different keyboard layout than your actual keyboard, then go to the FAQ of Quantum Mobile (‘how do I change the keyboard layout…‘) and follow the instructions over there. Restart the virtual machine to make the change effective.
If you are used to press ‘alt Tab’ to switch between apps, you may notice it does not work with Virtualbox. You can enable ‘alt Tab’ by pressing the Host Key. Follow these instructions to define which key is the Host Key (look at the answer by granada29).
It may happen that you get an error message when launching the virtual machine, telling that you don’t have virtual machine rights enabled in your BIOS. If that message is “VT-x is disabled in the BIOS for both all CPU modes”, you may find a solution here or (as a video) here (and here is another set of explanations, for Intel as well as AMD processors, and here yet another one). If you have another error message, Google for the exact message you got, and follow the instructions you find that way. Whether or not these rights in the BIOS are given by default, depends on your computer vendor.
Note for Apple users not using a M1: some more or less common issues when installing VirtualBox on Apple are listed here, with a link to a solutions:
The virtual machine you just installed contains more software than just Quantum Espresso. We will use some of that later in the course.
The last step you have to take, is to create a shared folder :
A virtual machine runs in its own silo, totally isolated from the rest of your computer. That’s good, that’s safe. Nevertheless, you will want to pass on files between your computer and the virtual machine. To allow such communication, we are going to set up now a folder that is shared between your computer and the virtual machine. Every file you put there on your computer, will be visible from within the virtual machine, and vice versa.
Short instructions to create a shared folder are available at the FAQ of Quantum Mobile (‘how do I set up a shared folder between the VM and my host?‘). A longer step-by-step explanation is given underneath. This explanation is general, whereas the explicit instructions between square brackets are for the case of your computer running under Windows.
cd /media/sf_host touch testfile.txt ls
if the folder ‘work’ did not yet exist, create it and descend into it as follows:
mkdir work cd work pwd
mkdir mycalculation cd mycalculation pwd
cp /media/sf_host/testfile.txt ./ ls
touch myoutput.txt cp myoutput.txt /media/sf_host
That’s it. Your shared folder is enabled, and you know how to use it. You can close this tab now and go on with the next item in the course.