32 or 64 guest

This is for discussing general topics about how to use VirtualBox.
Gabriel123
Posts: 6
Joined: 28. Mar 2014, 19:20

32 or 64 guest

Post by Gabriel123 »

At the moment i use a Windows 64 bit host. Now i want to use Virtual Box to run a Linux guest. So my questen is:
Does a 32 or a 64 bit guest have a better performance.

PS: My notebook has 8 GB RAM and i want to use the guest with 4 GB RAM

Thanks for answers.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: 32 or 64 guest

Post by loukingjr »

There is no simple answer to your question. Some Linux distros are faster than others whether 32 bit or 64 bit. A lot of the performance has to do with the distro's desktop environment. It also depends on what kind of performance you need.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
Gabriel123
Posts: 6
Joined: 28. Mar 2014, 19:20

Re: 32 or 64 guest

Post by Gabriel123 »

loukingjr wrote:There is no simple answer to your question. Some Linux distros are faster than others whether 32 bit or 64 bit. A lot of the performance has to do with the distro's desktop environment. It also depends on what kind of performance you need.
Thank you for your answer, but unfortunately that‘s not what i meant? I only want to know, wether it is possible that not matter what distribution you use the 32 bit version run faster than the 64 bit version in Virtual Box on the basis of the emulation?
Last edited by Gabriel123 on 28. Mar 2014, 22:09, edited 1 time in total.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: 32 or 64 guest

Post by loukingjr »

what I said applies to both a physical machine or a virtual one.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
bulletmark
Posts: 53
Joined: 16. Jun 2009, 14:48
Primary OS: Ubuntu 12.12
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: linux,mac
Location: Brisbane Australia

Re: 32 or 64 guest

Post by bulletmark »

It's 2014, use 64 bit machines everywhere. I.e. in both VM hosts and guests.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: 32 or 64 guest

Post by loukingjr »

that's more or less true but there are still applications on OSX, Windows and Linux that only have 32 bit versions. 32 bit software running on a Windows 64bit host would actually be slower than if they were on a 32 bit host because they run in Windows Wow mode or whatever it's called. I still don't think there is a 64 bit Version of Google Chrome for OSX. I don't think any of it really matters because many people who ask about performance are asking because they want to play games and virtual machines aren't all that great for playing games anyway whether 64 bit or not. And of course there are still Linux distros only developed for 32 bit. I for one don't fret over the performance differences.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: 32 or 64 guest

Post by mpack »

bulletmark wrote:It's 2014, use 64 bit machines everywhere. I.e. in both VM hosts and guests.
That's a fashion statement, not a technical assessment of need. People generally don't need 64bit VMs - for example if you give the VM less than 4GB then 64bit RAM addressing is almost pointless.

And I would be less cagey than my colleague: all else being equal, 32bit will give better performance. The main driving force behind 64bit systems is that CPU mfrs are having trouble making CPU's go faster, and you can only fit so many cores on a die, so they need some other "performance" feature to sell to the muggles.
Gabriel123
Posts: 6
Joined: 28. Mar 2014, 19:20

Re: 32 or 64 guest

Post by Gabriel123 »

bulletmark wrote:It's 2014, use 64 bit machines everywhere. I.e. in both VM hosts and guests.
But what i really what to know is wether the simulation of a 32 bit CPU works better then the simulation of a 64 bit CPU. And so a 32 bit guest system maybe works faster then a 64bit guest.
bulletmark
Posts: 53
Joined: 16. Jun 2009, 14:48
Primary OS: Ubuntu 12.12
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: linux,mac
Location: Brisbane Australia

Re: 32 or 64 guest

Post by bulletmark »

mpack wrote:
bulletmark wrote:It's 2014, use 64 bit machines everywhere. I.e. in both VM hosts and guests.
That's a fashion statement, not a technical assessment of need. People generally don't need 64bit VMs - for example if you give the VM less than 4GB then 64bit RAM addressing is almost pointless.
Saying "people don't need" is what is pointless. Installing a 64bit guest costs nothing more and any performance difference either way is insignificant. 64 bit is the mainstream now so my point is, to keep things simple, just use a 64 bit install everywhere. Banish 32 bit systems to the past.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: 32 or 64 guest

Post by mpack »

Nonsense. A 64bit VM does cost more - of every resource. If the VM doesn't need those resources then it makes little sense to allocate them. I personally don't care a tinkers cuss what you say the mainstream is, that's just the same fashion statement again, and I've never been interested in technology-as-fashion. Anyway the most recent figures I've seen say that XP is still the most used OS, and that's 32bit - so even the fashion statement doesn't bear scrutiny.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: 32 or 64 guest

Post by mpack »

@Gabriel123. I see that you've asked the same question in the German language forum. Note that we normally don't allow cross posting, please bear that in mind for the future - though I'll let things be this time given this unusual example.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: 32 or 64 guest

Post by loukingjr »

Gabriel123 wrote: But what i really what to know is wether the simulation of a 32 bit CPU works better then the simulation of a 64 bit CPU. And so a 32 bit guest system maybe works faster then a 64bit guest.
Why don't you do this since it won't cost you anything more than a little time. Choose a mainstream Linux distro, download the 32bit and 64 bit .isos with the same DE, install them both as guests with the same settings. It shouldn't take more than 5-10 minutes each, then run them both and see which you think is faster.

then you will know which is faster for that particular Linux distro.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: 32 or 64 guest

Post by Perryg »

If I might add to the discussion. There most certainly is a cost. Some applications ( actually most ) are written to work in 32-bit. These can be used most of the time in 64-bit machines but with 32-bit mode OS drivers. This adds another overhead and is what causes many difficulties, hangs, crashes, Etc.

So it does mater and should be considered when selecting an OS. I have both 32 and 64 bit guests for this very reason. If the guest/s are just to play around with that is one thing, but using them in production, you want the one that is most stable.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: 32 or 64 guest

Post by mpack »

Gabriel123 wrote:But what i really what to know is wether the simulation of a 32 bit CPU works better then the simulation of a 64 bit CPU
VirtualBox doesn't simulate the CPU, code runs natively on the host processor, at native speeds. The only thing VirtualBox simulates is peripheral hardware: the surrounding PC.
Ramshankar
Oracle Corporation
Posts: 793
Joined: 7. Jan 2008, 16:17

Re: 32 or 64 guest

Post by Ramshankar »

I'm not going to get into the tradeoffs between running 64-bit code and 32-bit code in general. As far as VirtualBox is concerned, with our Intel VT-x implementation, there is a tiny performance hit while running 64-bit guests[1]. However, this is mostly negligible and not a reason to avoid 64-bit guests with 4.3.x.

This is because the world-switcher has to save/restore a few more MSRs that are specific to 64-bit (Kernel GS Base etc.) which are expensive. However, this can only be noticed if you run specific benchmarks that exercise the guest in a very specific way (i.e. trigger a lot of VM intercepts). I've optimized this on trunk to perform lazy MSR save/restore and on trunk there is practically no difference between 64-bit and 32-bit guests on VT-x in this regard.
Oracle Corp.
Post Reply