Page 320 - From GMS to LTE
P. 320

306  From GSM to LTE-Advanced Pro and 5G

            4.18.3  Running Several Virtual Machines Simultaneously
            The second interesting feature of virtual machines is that the hypervisor can execute
            several instances simultaneously on a single physical computer. Here is a practical
            example. A user is running Ubuntu Linux as their main (host) operating system on their
            notebook and does most of their daily tasks with it. Every now and then, however, they
            also want to try out new things that might have an impact on the system, so they run a
            second Ubuntu Linux in a virtual machine as a sort of playground. In addition they
            often use another virtual machine instance running Windows simultaneously with the
            virtual machine running Ubuntu. As a consequence they are running three operating
            systems at the same time: the host system (Ubuntu), one additional Ubuntu in a virtual
            machine and Windows in another virtual machine. Obviously a lot of RAM and hard
            drive storage is required for this and when the host and both virtual machines work on
            computationally intensive tasks they have to share the resources of the physical CPU.
            But this is usually an exception as most of the time the user works only on something on
            the host operating system or only on something in one of the virtual machines. When a
            virtual machine is not needed for a while its window can just be minimized rather than
            the virtual machine being shut down. After all, the operating system in the virtual
            machine takes little to no resources while it is idle. Again note that the guest OS does
            not know that it is running in a window or that the window has been minimized.


            4.18.4  Virtual Machine Snapshots
            Yet another advantage of virtual machines is that the virtual machine manager software
            can create snapshots of a virtual machine. In the easiest scenario a snapshot is made
            while the virtual machine instance is not running. Creating a snapshot is then as simple
            as ceasing to write to the file that contains the hard disk image for that virtual machine
            and creating a new file to which all changes that are applied from now on are recorded.
            Returning to the state of the virtual machine when the snapshot was taken is as simple
            as deleting the file into which the changes were written. It is even possible to create a
            snapshot of a virtual machine while it is running. In addition to creating an additional
            file for writing changes that will be made in the future to the hard drive image, the cur-
            rent state of all simulated devices including the CPU and all its registers are recorded
            and a copy of the RAM is saved on disk. Once this is done, the operating system in the
            virtual machine continues to run as if nothing had happened at all. From its point of
            view nothing has actually happened because the snapshot was made by the hypervisor
            from outside the virtual environment so it has no way of knowing that a snapshot was
            made. Going back to the state captured in the snapshot later on is then done by throw-
            ing away all changes that have been made to the hard drive image, loading the RAM
            content from the snapshot file and reloading the state of all simulated hardware compo-
            nents to the state they were in when the snapshot was made. Once this has been done,
            all programs that were running at the time the snapshot was made resume running at
            exactly the machine instruction they were about to execute before. In other words, all
            windows on the screen are again in the position they were in when the snapshot was
            made – the mouse pointer is back in its original place, music starts playing again at the
            point at which the snapshot was made, etc. From the guest operating system’s point of
            view nothing has happened; it does not even know that it has just been started from a
            snapshot. The only  thing that is different after the restart is that when the guest
   315   316   317   318   319   320   321   322   323   324   325