difference in performance: virtualbox os and local os

0

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.

Wern Ancheta

Posted 2010-02-20T01:58:53.833

Reputation: 5 822

Answers

1

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

Sam

Posted 2010-02-20T01:58:53.833

Reputation: 848

-1

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.

quack quixote

Posted 2010-02-20T01:58:53.833

Reputation: 37 382

ahh, this is not very accurate. CPU, RAM, hard disk is all very REAL, network controllers, graphics and sound are emulated. – None – 2010-02-20T03:31:43.183

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 – 2010-02-20T03:50:18.060

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 – None – 2010-02-20T03:59:18.743

1one 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 – 2010-02-20T04:24:35.817

@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 – 2010-02-20T12:34:47.643

(actually, i blame Molly for that; her first comment introduced the term "emulated".) – quack quixote – 2010-02-20T13:47:49.727

It's clear that this leaves room for a very interesting question on VHD performance! – Ivo Flipse – 2010-02-22T07:58:33.137