Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I use virtual machine on my i5 laptop, does it emulate every instruction or does it run it normally? How much speed is decreased ? Especially im talking about QEMU and virtualbox, how are they? Will it run games without problems ?

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

It depends on your virtualization software. Basically you have three choices:

  1. Emulate an entire PC, including CPU.
  2. Run the software as it is, using the hardware of the host, but intercept a few system calls and instructions.
  3. Modify the software so it runs on the hosts hardware, but the instructions which would be intercepted by 2) are now replaced by other routines.

All three work. All three are in use. All three have different performance characteristics.

1) Emulate
This will always be the slowest option. It has two advantages:

  • You can emulate a completely different host (e.g. emulate a ARM based computers on a AMD64).
  • You do not need any hardware support.

2) Intercept system calls

This answer is mostly AMD64 based. A modern x86 CPU has several levels with different permissions. These are called rings. The VM software takes over ring 0 (the ring with the most permissions) and gains the right to do just about anything on the computer. The software on the computer (both host and VMs) do not notice this. Using these rights it makes sure that multiple OS's do not interfere with each other.

As a result regular code runs at full speed (dnetc testing resulted at about 99% of the peed in a vm). Code which does system calls gets intercepted and modified, and is thus much slower. Usually the net result of this is a few percent speed loss.

3) Modified code

Instead of intercepting the system calls real time you can modify the software in advance. This way your code can be slightly faster, but you do needs to modify the software in advance.


Especially I am talking about QEMU and virtualbox, how are they?

I got a friend who is a programmer. She looked at QEMU's code. The recommended advice is not to touch it. Ever. Not even with a 10 foot pole. QEMU works with teh out of the box configuration, but fails quite often if you do not use default settings. It allocates resources and never checks if that succeeded... I could go on, but the less it is mentioned the better.

Virtualbox: I used virtualbox once. It worked. The windows version of it had a nice understandable interface. I did not test any performance, nor did I play any games.

Will it run games without problems?

The only games I have run are under Vmware (player). That worked well enough for 2D games. 3D games usually crash my computer (both Vm and host).

share|improve this answer
add comment

In VirtualBox if you enabled the Extended Features and Hardware Virtualization you are exposing the native supported features of your Processor/CPU to the Guest OS. Performance vary on how much RAM and number of CPU Core you allocate. Although allocating a fixed amount of ram and cpu core will not be utilize at all times because it depends on what you are running inside the VM or Guest OS.

Say, I allocated 1GB RAM and 1 CPU Core. Then I run some intensive application on the Guest OS like MATLAB, the application will use all available resources. You can even monitor what consumes them on Task Manager.

Normally, games (some) should work depending on their requirement, specially on the graphics department since games tend to use a lot of video memory, it crunches a lot of data so games is off topic if you want it to use on VMs.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.