Discussion:
[vbox-dev] IMachine::setSettingsFilePath not supported?
Karoline Haus
2014-06-30 11:53:36 UTC
Permalink
I would like to be able to create a VM under a specific folder. In fact, I would like to import a VM from an OVA file, and then have that VM registered under a specific folder. However, by default VBox will store it under $HOME/.VirtualMachines and I cannot figure how I can use the API to change the settings file path on VM import? I have seen there is an IMachine::setSettingsFilePath function, but I use the Python API and it does return a "Not Implemented" error. Is there any other way to store VMs under a specific location?

Many thanks for any pointers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.virtualbox.org/pipermail/vbox-dev/attachments/20140630/d7b4cf46/attachment.html
Klaus Espenlaub
2014-07-01 10:16:22 UTC
Permalink
Karoline,
Post by Karoline Haus
I would like to be able to create a VM under a specific folder. In fact,
I would like to import a VM from an OVA file, and then have that VM
registered under a specific folder. However, by default VBox will store
it under $HOME/.VirtualMachines and I cannot figure how I can use the
API to change the settings file path on VM import? I have seen there is
an IMachine::setSettingsFilePath function, but I use the Python API and
it does return a "Not Implemented" error. Is there any other way to
store VMs under a specific location?
Changing of the settings file path for an existing VM is a todo, it
needs a lot of groundwork (moving disk images in the directory and the
like).

What you want is setting the default machine folder before importing,
maybe reverting this change afterwards (if you want locally created VMs
still in the default place).

I'm wondering why your setup uses a .VirtualMachines subdirectory, I
don't see this anywhere in the code. Ancient VirtualBox versions default
to ~/.VirtualBox/Machines, and newer versions default to ~/VirtualBox
VMs, but stick to the old default if it's an upgrade. One can switch to
the new default though, or pick a totally different directory.

Klaus
Post by Karoline Haus
Many thanks for any pointers.
Warren Block
2014-07-01 13:31:11 UTC
Permalink
On Tue, 1 Jul 2014, Klaus Espenlaub wrote:

...
Ancient VirtualBox versions default to ~/.VirtualBox/Machines, and
newer versions default to ~/VirtualBox VMs, but stick to the old
default if it's an upgrade. One can switch to the new default though,
or pick a totally different directory.
If there is a chance to change that default, please consider removing
the space character from future versions. It is problematic on systems
that normally use spaces as delimiters, involving extra quoting. The
space really does not improve the readability of the directory name.

Thanks!
Klaus Espenlaub
2014-07-02 15:16:26 UTC
Permalink
Warren,
Post by Warren Block
...
Ancient VirtualBox versions default to ~/.VirtualBox/Machines, and
newer versions default to ~/VirtualBox VMs, but stick to the old
default if it's an upgrade. One can switch to the new default though,
or pick a totally different directory.
If there is a chance to change that default, please consider removing
the space character from future versions. It is problematic on systems
that normally use spaces as delimiters, involving extra quoting. The
space really does not improve the readability of the directory name.
Unlikely that there's any change of defaults in the foreseeable future.
I don't think that in today's world the stripping out of a space just to
make sloppy scripting slightly simpler is a valid justification.

If you want a different default machine folder, set it in your
environment before creating VMs, and that's all you need. It will be
remembered across updates.

Klaus
Post by Warren Block
Thanks!
Warren Block
2014-07-02 15:56:59 UTC
Permalink
Post by Warren Block
...
Ancient VirtualBox versions default to ~/.VirtualBox/Machines, and
newer versions default to ~/VirtualBox VMs, but stick to the old
default if it's an upgrade. One can switch to the new default though,
or pick a totally different directory.
If there is a chance to change that default, please consider removing
the space character from future versions. It is problematic on systems
that normally use spaces as delimiters, involving extra quoting. The
space really does not improve the readability of the directory name.
Unlikely that there's any change of defaults in the foreseeable future. I
don't think that in today's world the stripping out of a space just to make
sloppy scripting slightly simpler is a valid justification.
Well, it's not just scripting, but any place that filename is used in a
command where spaces are delimiters. On almost all operating systems,
too. Given that, it seemed kind of odd that the space was added.

I understand reluctance to change the default again. If it does
eventually come up, please rethink the space at that time.

Thanks!

Karoline Haus
2014-07-02 07:18:25 UTC
Permalink
Hi Klaus,

Yes, the way I'm doing it now is to change the default settings path before I import a VM, and then change it back to the system default. I had figured that way myself already :-) It is OK and it does work for now.

I use VBOX 4.3.12 under Gentoo Linux, and I think that is the current VBOX version, isn't it?

Thanks for your help.

Karoline



Klaus Espenlaub <klaus.espenlaub at oracle.com> schrieb am 12:23 Dienstag, 1.Juli 2014:



Karoline,
Post by Karoline Haus
I would like to be able to create a VM under a specific folder. In fact,
I would like to import a VM from an OVA file, and then have that VM
registered under a specific folder. However, by default VBox will store
it under $HOME/.VirtualMachines and I cannot figure how I can use the
API to change the settings file path on VM import? I have seen there is
an IMachine::setSettingsFilePath function, but I use the Python API and
it does return a "Not Implemented" error. Is there any other way to
store VMs under a specific location?
Changing of the settings file path for an existing VM is a todo, it
needs a lot of groundwork (moving disk images in the directory and the
like).

What you want is setting the default machine folder before importing,
maybe reverting this change afterwards (if you want locally created VMs
still in the default place).

I'm wondering why your setup uses a .VirtualMachines subdirectory, I
don't see this anywhere in the code. Ancient VirtualBox versions default
to ~/.VirtualBox/Machines, and newer versions default to ~/VirtualBox
VMs, but stick to the old default if it's an upgrade. One can switch to
the new default though, or pick a totally different directory.

Klaus
Post by Karoline Haus
Many thanks for any pointers.
_______________________________________________
vbox-dev mailing list
vbox-dev at virtualbox.org
https://www.virtualbox.org/mailman/listinfo/vbox-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.virtualbox.org/pipermail/vbox-dev/attachments/20140702/90df9fcb/attachment.html
Klaus Espenlaub
2014-07-02 15:26:02 UTC
Permalink
Karoline,
Post by Karoline Haus
Hi Klaus,
Yes, the way I'm doing it now is to change the default settings path
before I import a VM, and then change it back to the system default. I
had figured that way myself already :-) It is OK and it does work for now.
I use VBOX 4.3.12 under Gentoo Linux, and I think that is the current
VBOX version, isn't it?
Yes. 4.3.14 is likely to happen soon (no exact dates as usual, when it's
ready), but there's no plan to change this bit of the API, just pushing
out bug fixes. Quite a few have been piled up in the mean time.

We hope to find time to address this for the next major release, but
there's always so much to do...

Klaus
Post by Karoline Haus
Thanks for your help.
Karoline
Karoline,
Post by Karoline Haus
I would like to be able to create a VM under a specific folder. In fact,
I would like to import a VM from an OVA file, and then have that VM
registered under a specific folder. However, by default VBox will store
it under $HOME/.VirtualMachines and I cannot figure how I can use the
API to change the settings file path on VM import? I have seen there is
an IMachine::setSettingsFilePath function, but I use the Python API and
it does return a "Not Implemented" error. Is there any other way to
store VMs under a specific location?
Changing of the settings file path for an existing VM is a todo, it
needs a lot of groundwork (moving disk images in the directory and the
like).
What you want is setting the default machine folder before importing,
maybe reverting this change afterwards (if you want locally created VMs
still in the default place).
I'm wondering why your setup uses a .VirtualMachines subdirectory, I
don't see this anywhere in the code. Ancient VirtualBox versions default
to ~/.VirtualBox/Machines, and newer versions default to ~/VirtualBox
VMs, but stick to the old default if it's an upgrade. One can switch to
the new default though, or pick a totally different directory.
Klaus
Post by Karoline Haus
Many thanks for any pointers.
Loading...