Virtual Machines

As usual it is my personal note on refreshing my memory on a particular subject and some trouble shootings as relevant.

A virtual machine is an illusion of a machine (Guest) within another machine (Host). [1] discusses different types of virtual machine designs. The areas which I am focusing on are Hosted (Guest OS runs on Virtual Machine Monitor that in turns runs on the Host OS) and Hypervisor (Hypervisor is a software for virtualization which runs directly on the physical hardware of the host; it is basically a Virtual Machine Monitor). As Hypervisor runs directly on the Host hardware it is meant to be faster (ideally).

[2] A pmap data structure is a structure the contains the mapping between the memory (virtual) allocated to the Guest OS and the physical Host memory such that to the Guest OS the memory is starting from zero and are consecutive blocks. It is the responsibility of the Virtual Machine Monitor to manage the mapping/translation.

Virtualization setup is meant to be easier with the newer Windows OS that supports Hypervisor. But if we want to run Docker container on Windows OS then unfortunately we have to have a separate virtual machine like Oracle Virtual Box (shall use shorthand notation VB from this point onward) installed on Windows OS. Using Hypervisor does not help. And to make sure Oracle VB can run you may need to enable virtualization from the BIOS settings (depending on your hardware). On top of that if the version of Windows OS (on host) has hypervisor (Windows 10 has it) then you have to make sure that the Hypervisor is turned off (you can do that from settings->windows feature). Otherwise even though Oracle VB starts; when you try to access a particular installed OS image (like Ubuntu) or Docker image you would see the dreaded blue screen reporting critical error, Windows is gathering the information and you need a reboot of the host etc. One thing I noticed today that with Windows update your third party Virtual Machine may stop working all of a sudden and nothing helps other than uninstalling and reinstalling newer version of the virtual machine software.

I used Virtual Machines from several different vendors. So far I have used Parralels, VirtualBox and VMWare. In the past the virtual machine related problems that I have faced are as follows. Due to presence of a lock file the Virtual Machine could not be started. Removing the lock file allowed the virtual machine to start. In some cases the system was unable to locate the necessary files to start the virtual machine. In this case manually updating various links (possible to do it from a GUI) helped. The locations of various files are ideally saved in special XML files depending on the design; when I was updating the links I was basically adjusting the XML). In other cases I have seen “the parent virtual disk has been modified since the child was created” problem while starting the Virtual Machine. The fix for it is available here.

And this particular link [3] specifies why it was difficult to move/port Virtual Machine from one host to another for older (< 4.0) version of VirtualBox. Yes this problem is specific to VirtualBox implementation but still it provides useful hints on Virtual Machine design.

References and Further Reading:

[1] ]An Introduction to Virtual Machines Implementation and Applications

[2] Pmap

[3] https://www.virtualbox.org/manual/ch10.html

[4] http://www.utdallas.edu/~muratk/courses/cloud11f_files/smith-vm-overview.pdf

[5] https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1007969