Tired of having to reboot in Windows to handle the occasional file or task that I cannot perform in Linux, I’ve recently tried PC emulators so that I could run Windows XP in an emulator box in Linux. Boy, have things changed since I’ve last tried emulators! It used to be that those things would be quite unstable or could be used only by people willing to read the source code.
Bochs has improved a lot but is not perfect yet. I was unable to install XP in it. I’ve tried a bunch of different configuration parameters but nothing worked. I have to say that while Bochs is better than it used to be, setting it up is still an arcane task.
Qemu on the other worked pretty much right out the box. Its default mode of operation is much more sensible than bochs’. The only thing people need to consider is to use kqemu (or qvm86). There was one bug that came up when I ran XP in qemu without kqemu that disappeared after I installed kqemu.
Anyway, now I can run Win XP in Linux… yay…
VirtualBox beats both of these, as it is a virtualizer, as opposed to an emulator.
Emulation is when the actual CPU of a machine is emulated. It is slow due to all of the low-level simulation of the CPU.
Virtualization, comparatively, uses the underlying hardware available through drivers that shepard calls by the virtualized OS to the host. This is far faster due to not actually emulating the CPU.
Let me clarify a few things:
1. You are commenting on a post which is over 4 years old (almost 5).
2. VirtualBox was not released when the post was composed. (Wikipedia shows a first release date for VirtualBox of January 15, 2007, almost a year later than my post.)
3. kqemu and qvm86, which I mention in my post, are virtualization modules for qemu. That is, qemu by default emulates but if qemu is used with these modules, it virtualizes. So the difference between VirtualBox and qemu is not one of virtualization vs emulation, since qemu can both emulate and virtualize.
4. Since writing this post, I moved from qemu+kqemu to kvm and then to VirtualBox. The reason I moved to VirtualBox was not virtualization because I already had that with kvm (and even with qemu+kqemu) but some additional features of VirtualBox and its user-friendliness.
5. Here is a better explanation of the difference between emulation and virtualization. In emulation each instruction which is to be executed by the virtual CPU must be translated into a series of instructions on the host CPU. Even if the virtual CPU and the host CPU are the same architecture, this translation must be performed. When the virtual CPU and host CPU are the same architecture, this translation is a net loss in performance. (When the virtual CPU and host CPU are different architectures, emulation can actually result in a gain over running a physical version of the CPU being emulated if it so happens that it is an architecture which in the models historically produced were much slower than the host CPU. This happens sometimes when running emulations of old game consoles.) In virtualization, most instructions to be executed on the virtual CPU can be directly executed on the host CPU if it happens that the two CPUs share the same architecture or if there is special hardware on the host CPU to accomplish this vritualization. (I am speaking in the general case. In general, it is possible to create a CPU with hardware providing virtualization support for an architecture very different than its own.) Some instructions might still need emulation.
So VirtualBox may beat bochs because VirtualBox virtualizes whereas bochs does not (and it does not seem to have evolved). But it is not the case that VirtualBox beats qemu because of virtualization.
If you need to use Windows programs then you could also try using Wine.