Page 1 of 1

VM Configuration Templates

Posted: 19. Jan 2011, 03:16
by bknonix
Are the "default" settings for each OSTYPE stored anywhere that can be user edited?

I am building myself a script to create new VMs, call...
1. VBoxManage clonehd
2.. VBoxManage createvm
3. VBoxManage modifyvm
(lots of times - to get all the settings correct)...

But, what I would like is to change some of the defaults, like "no floppy disk", memory allocation, etc

Re: VM Configuration Templates

Posted: 19. Jan 2011, 11:54
by HubTou
Hello,
bknonix wrote:Are the "default" settings for each OSTYPE stored anywhere that can be user edited?
To my knowledge :
  • there are no default settings per OSTYPE, but generic default settings
  • these default settings are documented in the user manual
  • some of them are available through "VBoxManage list systemproperties"
  • the list of OSTYPES is available through "VBoxManage list ostypes"
bknonix wrote:I am building myself a script to create new VMs, call... [...] But, what I would like is to change some of the defaults, like "no floppy disk", memory allocation, etc
I did something like that in vboxhost (http://www.projet-hev.org/dist/vboxhost.tar.bz2).

Have a look at:
  • ./Scripts/vboxhost.libsh for default configurations (in the register function)
  • ./vboxhost for the top level user command
  • ./ToutesLesVm/Modele.rc for a usage example (a template, in fact)
Best regards,

Hubert

Re: VM Configuration Templates

Posted: 19. Jan 2011, 12:05
by mpack
HubTou wrote:there are no default settings per OSTYPE, but generic default settings
Au contraire. In fact the only reason you need to select an OS type at all is so VBox can choose an appropriate set of defaults for that OS. In the GUI you pick the OStype from a list. For the "createvm" command you use the --ostype switch. I doubt the defaults can be modified though, short of rebuilding the OSE code (i.e. I expect I'd find a table if I dug in the code long enough).

Re: VM Configuration Templates

Posted: 19. Jan 2011, 16:19
by HubTou
Hello mpack,
mpack wrote:
HubTou wrote:there are no default settings per OSTYPE, but generic default settings
Au contraire. In fact the only reason you need to select an OS type at all is so VBox can choose an appropriate set of defaults for that OS [...] I doubt the defaults can be modified though, short of rebuilding the OSE code
You're right but we are not talking about the same "settings" :-)

I was taking "settings" literally as "things that you can set", for instance with "VboxManage modifyvm", as seems to be the case in dot 3 in the original email.

In this light, I don't think that the default values are OS dependent.

Best regards,

Hubert

Re: VM Configuration Templates

Posted: 19. Jan 2011, 17:58
by Perryg
From what I can see/tell setting the ostype primarily sets up the icon, suggested amount of minimal RAM, and the typical HDD controller. Since the controller is able to be over-written using VBoxManage as well as the amount of RAM, the only advantage that I can find is the GUI icon. Of course I could be missing something as the code that ostype is used against is all over the frontend, widgets, Etc.. but as far as I can tell the only advantage for the ostype is the icon.

I have setup a Windows guest using Linux as the ostype, changed all of the required fields and it worked as if I had selected Windows but with the Linux icon. Go figure!

But to answer the OP I don't know of any "templates" as such.

Re: VM Configuration Templates

Posted: 19. Jan 2011, 21:31
by HubTou
Hello,

I recall reading somewhere that the OS type enabled some internal tweakings inside VirtualBox.

One example that springs to mind is for OS/2.

As the manual says:
Guest operating system (guest OS):  the operating system that is running inside the virtual
machine.   Theoretically, VirtualBox can run any x86 operating system (DOS, Windows,
OS/2, FreeBSD, OpenBSD), but to achieve near-native performance of the guest code on
your machine, we had to go through a lot of optimizations that are speci?c to certain
operating systems. So while your favorite operating system may run as a guest, we of?cially
support and optimize for a select few (which, however, include the most common ones).
Best regards,

Hubert

Re: VM Configuration Templates

Posted: 19. Jan 2011, 21:45
by Perryg
AFAIK This is referring to what guests will run the best in VirtualBox, not that the default settings have anything to do with it.
I am sure that there must be some other tweaks in the code depending on the ostype it is just that I have not found anything that I could not override.

Re: VM Configuration Templates

Posted: 20. Jan 2011, 00:31
by Leak
Perryg wrote:AFAIK This is referring to what guests will run the best in VirtualBox, not that the default settings have anything to do with it.
I am sure that there must be some other tweaks in the code depending on the ostype it is just that I have not found anything that I could not override.
According to the docs (chapter 3.1.2, point 3) you have to select a 64-bit operating system type for your VM if you want to run a 64-bit guest on a 32-bit host, and there's no other setting you could tweak to get that same effect.

np: Isan - Waves (Blue Skied An' Clear (Disc 1))

Re: VM Configuration Templates

Posted: 20. Jan 2011, 00:38
by Perryg
VBoxManage sets that as well.
  • --hwvirtex on|off

Re: VM Configuration Templates

Posted: 20. Jan 2011, 01:08
by Leak
Perryg wrote:VBoxManage sets that as well.
  • --hwvirtex on|off
I don't think that's the same - or why would 3.1.2 point 2 say

"you must enable hardware virtualization for the particular VM for which you want 64-bit support; software virtualization is not supported for 64-bit VMs."

immediately followed by point 3 saying

"If you want to use 64-bit guest support on a 32-bit host operating system, you must also select a 64-bit operating system for the particular VM. Since supporting 64 bits on 32-bit hosts incurs additional overhead, VirtualBox only enables this support upon explicit request."

if it all just hinged on turning on hardware virtualization, which point 2 would already accomplish?

Re: VM Configuration Templates

Posted: 20. Jan 2011, 01:20
by Perryg
I appreciate that you are reading the manual. It is really refreshing to see. But you have not gotten to the section that talks about creating the guest on a headless server that does not have a GUI. Trust me when I say that everything that can be done in the VirtualBox main GUI can be accomplished at the command line. Actually I know of a lot of things that can *only* be accomplished using the command line.