Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Virtual machines

I've been trying to figure out how VMware works (specifically when Linux is installed) and I have a couple of questions:

  1. What happens when VMware encounters a command like push cs ? Specifically cs since its privilege level is 0 and VMware runs on 1 privilege level, so I'm assuming it somehow has to translate it into someother command.

  2. Virtual memory : How does it work on a virtual machine? are there 2 levels of translation - process virtual memory -> virtual machine physical memory -> real machine physical memory ? how would VMware be notified when a page is being swapped off by the real machine?

like image 510
Shmoopy Avatar asked Jan 22 '12 13:01

Shmoopy


People also ask

What is virtual machine used for?

A Virtual Machine (VM) is a compute resource that uses software instead of a physical computer to run programs and deploy apps. One or more virtual “guest” machines run on a physical “host” machine.

What is an example of a virtual machine?

Examples of virtualization platforms adapted to such hardware include KVM, VMware Workstation, VMware Fusion, Hyper-V, Windows Virtual PC, Xen, Parallels Desktop for Mac, Oracle VM Server for SPARC, VirtualBox and Parallels Workstation.

What is virtual machine and how does it work?

A virtual machine is a computer file, typically called an image, that behaves like an actual computer. It can run in a window as a separate computing environment, often to run a different operating system—or even to function as the user's entire computer experience—as is common on many people's work computers.

What are the types of virtual machines?

Based on their functions there are two different types of virtual machines – System virtual machines and process virtual machines. These types of VMs provide full virtualization.


1 Answers

  • Most instructions run directly on the CPU. But privileged instructions cause an exception, the handler emulates them.
  • Now I see what you mean with the push cs example. You mean instructions that silently behave differently on different privilege levels. The wikipedia article on x86 virtualization says they are binary translated, i.e. there is a recompilation phase before running the code on the host CPU.
  • In older x86, vmware maintains shadow page tables. Guest page tables must be emulated, to allow vmware to keep track of the view the guest OS has of page tables. Newer x86 have virtualization extensions that allow several levels of page tables in an efficient manner.
like image 84
ninjalj Avatar answered Sep 22 '22 04:09

ninjalj