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

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

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!)

答案1

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.

答案2

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.

答案3

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.

答案4

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.

相关内容