Why does VM software need to know which OS will be running inside the VM?

21

2

When I create a new VM (with VirtualBox) it will ask me what OS will run inside the VM.

Why does it need (or like) to know that? Will it result in better performance? Will some things work / not work? (Links to technical details welcome!)

Martin

Posted 2011-09-25T17:02:25.283

Reputation: 2 055

Answers

18

For "Operating System Type", select the operating system that you want to install later. The supported operating systems are grouped; if you want to install something very unusual that is not listed, select "Other". Depending on your selection, VirtualBox will enable or disable certain VM settings that your guest operating system may require. This is particularly important for 64-bit guests (see the section called “64-bit guests”). It is therefore recommended to always set it to the correct value.

Source

I've noticed VirtualBox suggests the default memory and disk size based on your OS selection. There are also additional prompts, such as one for account creation (certain OSes) before the installation to streamline the installation process.

VirtualBox also provides guest additions to supported OSes. For the whole list, including caveats, take a look here.

Jin

Posted 2011-09-25T17:02:25.283

Reputation: 4 107

I think its primarily so it knows which guest additions iso to load for install. – Journeyman Geek – 2011-09-26T09:21:17.237

7

It's just so VirtualBox can select the optimum and supported default settings of the VM you create. You can alter these as you want in the "Settings" afterward. Some OS's have better support for some drivers, some doesn't have 3d Acceleration support and so on.

nos

Posted 2011-09-25T17:02:25.283

Reputation: 3 699

5

Some of it controls optimizations the VM can make when it knows the OS.

One very useful optimization that I know of is spin-lock detection. When Windows enters a CriticalSection or Linux enters a pthread_mutex_lock, the CPU usage will briefly go to 100% while it waits for another CPU to finish. If the VM knows about that it can make sure to run the other CPU thread immediately.

Another optimization is the virtual graphics driver. A Linux guest will get a OpenGL virtual card while Windows will get a DX9 card.

Zan Lynx

Posted 2011-09-25T17:02:25.283

Reputation: 1 518

1

The main ones are:

  1. In specific cases it needs to know what HDD type / structure will simulate
  2. It needs to "push" the client software - needs to know what software and how to push it towards user

Any other silly customization... but these are the main ones.

Bogdan Ciocoiu

Posted 2011-09-25T17:02:25.283

Reputation: 11

1

Mainly so it can best select the settings it feels would be well suited for your PC plus That virtual machine. Also its used to streamline things and stuff like that. Like virtual box mainly does this for its "guest additions" pack which is used to help it use devices on the host machine and share folders back and forth between the host and virtual machine.

death2all110

Posted 2011-09-25T17:02:25.283

Reputation: 21