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.

Is there a specific difference in performance between an OS installed on a Virtual Box and an OS installed locally on a computer?

Is there any formula so that I could know what is lost when you install an OS in a virtual box.

For example, if you assigned 512Mb of memory in a virtual box os. But it is actually 256Mb when compared to its performance when it is installed locally.

Please, I need the information because we're making a comparative analysis on operating systems. And I can't just install Sabayon Linux, it might ruin the 3 other os that I have already installed.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Given the number of variables involved (everything from caching efficiency to what programs are running your host OS) it is practically impossible to know the exact difference theoretically. However, I would do the following to determine this experimentally without affecting my current install;

Overview:

  1. Purchase an identical harddrive to what you currently have installed in your computer.
  2. Remove the current harddrive you have so you don't mess up any of your currently installed stuff.
  3. Install the OS's that you are analyzing to that harddrive -- note, they MUST not be installed in different partitions and the drive should be zero'd between changing the operating systems (this more closely simulates how it might look under virtual box -- i.e. a fresh drive).
  4. Perform your benchmarking for each OS
  5. Put your old harddrive back in
  6. Fire up VirtualBox and install each OS, perform your benchmarking for each OS.

Caveats:

  • If you are trying to do a high-quality comparative analysis, you HAVE to do the comparison from each individual OS ON the hardware.
  • Make sure you pick a good set of benchmarking software that doesn't bias toward one thing or another to heavily. And if you do bias toward something heavily (RAM usage perhaps?) make sure you get enough samples that the aggregate data is meaningful.
  • Ensure the software running on your host os is the same AND minimal during your benchmarking process for each OS you sample
  • I would recommend defragging your harddrive between installs of the OS's under virtualbox, this will help ensure the virtual disk will be more contiguous on disk
share|improve this answer

There is, actually, a specific difference.

In a virtual machine, the hardware that the OS thinks it's running on is not real.

Whereas in a local, bare-metal OS, the hardware that the OS thinks it's running is, by and large, actually physically present.

share|improve this answer
    
ahh, this is not very accurate. CPU, RAM, hard disk is all very REAL, network controllers, graphics and sound are emulated. –  Molly7244 Feb 20 '10 at 3:31
    
hard disk is definitely not real, actually; while some VMs can present raw disk access to their guest OS, running a guest on a virtual HDD (eg /my/VMs/foo.vdi) is very common. –  quack quixote Feb 20 '10 at 3:50
    
while a container is used, the action certainly happens for real on your HDD and if your disk is noisy enough might be able to hear it actually :P –  Molly7244 Feb 20 '10 at 3:59
1  
one could say the same about any emulation -- even though the graphics is emulated, the VM desktop still shows up on my monitor; even though the sound is emulated, the VM media player still plays thru my speakers. doesn't change the fact that my guest OS thinks it has a VBOX HDD and is displaying to an "Innotek ...VirtualBox Graphics Adapter". –  quack quixote Feb 20 '10 at 4:24
    
@brice - i'm sorry, my comment was not using "emulation" in the technical sense described by those documents, and you're right, by that definition VirtualBox is not an emulator. i was referring to the fact that the guest OS sees virtual hardware instead of real hardware in most places. yes, the CPU runs the guest OS code natively (though even CPU features available to the guest can be restricted, eg number of cores). on my testbed VirtualBox guest, the CPU (and possibly RAM, not sure) is the only real hardware the guest knows about -- everything else is virtual/emulated/fake. –  quack quixote Feb 20 '10 at 12:34

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.