Some tips for working with virtual machines

 What is a virtual machine?

Virtual Machine (VM) is software that can be installed on a computer/server and emulates a complete operating system. This can provoke an experience of using a real operating system, installed on one physical computer itself.

You can use virtual machines on servers, so one powerful server will run different servers working in parallel (for example, one virtual server can be Linux, another will run Windows, etc.).

In addition and for other needs you can also run VMs on personal computers, for example - such as servers - a different operating system (in our company there are some who run Windows on a Mac for some reason). It is also nice even if you do not want to install some software on your own PC because they are dangerous or for short use. Basically use it as a sandbox.

In desktop tests using VMs is extensive and very useful.

There are several companies that produce VMs, I know more about VMware but most of the tips below are true for everyone.

VMware comes with a free version that you can always go back to the initial point, and a paid version that you can save a few snapshots (which means maintaining a certain situation) you want.

Here is an example of the snapshots tree saved virtual machine simulating Windows 10. You can choose to play from any snapshots in the tree regardless of its location.

In a good testing environment, the testers are usually connected to the server running a large number of virtual machines. These machines create an environment for manual and automated testing.

Operating Systems can be prepared as ISO files.

Tips for use:

  1. Because slowly we will form branched snapshots tree, if later we will recall that we need to always use a certain tool we need for the tests, we will need to install it on every snapshot. Therefore it is very important to start installing all the tools we can think of in the first snapshots. It is better to install more than one need to install than a lot of times later. Below, you can find a number of ideas.

  2. If the machines run on your PC, it should be strong, and highly recommended to use an SSD HD.

  3. Use many snapshots during the tests. Sometimes there are bugs that only saved snapshots will be reproduced! For example: you do a scenario of a particular installation, the opening of the product, certain actions, and so on. After every few steps, create a snapshot, for example when the environment is ready for installation, with installation completed, and so on and so forth. You may come up with a bug because you make a conscious action, or the computer itself has run a process, and you will never be able to reproduce it w/o the snapshot.

  4. In addition, if you want to try to reproduce a bug, you just go back to the situation before the implementation of the action rather than reinstalling it all the time. I worked with someone who also used to announce loudly that he found a bug or another without checking himself, and did not keep snapshots. It was quite frustrating to sit next to him for a long time when he began transferring a virtual machine setup, installed, failed to reproduce, and started again.

  5. Something happened? You're not sure then whether or not - to save a snapshot? I think besides all the obvious, all bugs should be kept at least until repaired (so there will be a place where developers can debug).

  6. On the other hand, each snapshot will take you disk space, so whenever you have some free time, delete what you do not need.

  7. Give a significant name for snapshots. No one will remember what snapshot59 means.

  8. Also, a rare but possible to have a situation in the VM that does not behave exactly like a PC, and the bug there is not real. Rare, but know it is possible.

  9. Go to the settings. There are important things that can be configured as memory (raising and lowering), network (direct or bridged), and more.

  10. It is possible to take a movie from the VM and photograph the screen.

  11. Notice the icons in the upper menu - they can be useful.

When you have a new Image, this is what you want to install to prepare for the tests to come:

  • If you don't have a user with admin rights, or a user with user rights, create them (start, right-click on the computer, manage, local users).

  • If you want to set that the users will not require passwords.

  • Log in to the user, open the browsers, log off, and log in to the admin.

  • Make sure the VM configurations are set to get OS updates. From time to time update the OS.

  • Install any tool you think you might need, for example: install fiddler, install 7zip.

  • Set on the desktop or in Windows Explorer shortcuts to any directory you know that are going to use in the tests.

  • Save a snapshot.

  • If you use different divisions (for example one with IE & Firefox, one with IE and Chrome save them now.