Page 1 of 2

multi host environments

Posted: 22. Feb 2011, 04:43
by TechGeek
So lets assume I have multiple servers with VirtualBox and they all access a shared filesystem, say NFS. I have a couple questions if someone can clue me in:

1. Is there a best practices paper some where on how the servers should be set up so that they aren't conflicting? Ideally I would like to be able to move virtual machines between hosts easily for load balancing (even if its not automatic).

2. I see in 4.0 that the settings file for the guest is now in the guest file. Is there a way to tell virtualbox to read in that file? I didn't see a way to do it in the gui and I would ideally like to be able to do this on the command line.

Thanks,

Gary

Re: multi host environments

Posted: 22. Feb 2011, 11:59
by mpack
Your question 2 makes no sense to me. Have another go?

Are you referring to the media registry having moved from VirtualBox.xml to <vmname>.vbox, the latter also being an xml. The latter is read by the GUI at several points in time, for display, to allow editing, and of course when you launch the VM.

Re: multi host environments

Posted: 23. Feb 2011, 02:02
by TechGeek
Sorry about that. So when a new machine is created, there is an xml file vmname.vbox created in the folder for the guest. It is associated with the application VirtualBox. If I had moved the folder from another machine to this one, I can double click the xml file and the machine and its vdi storage file get automatically registered in the VirtualBox manager. I was just wondering if there is a way to produce the same affect from the command line. It would make registering a guest much easier.

Re: multi host environments

Posted: 23. Feb 2011, 03:11
by BillG
VBoxManage registervm ?

Re: multi host environments

Posted: 23. Feb 2011, 03:32
by TechGeek
no, VboxManage registervm crashes out. Any other ideas?

Re: multi host environments

Posted: 23. Feb 2011, 12:00
by mpack
I assume you mean that VBoxManage errors out rather than crashes. What is the exact error message when this happens?

Re: multi host environments

Posted: 24. Feb 2011, 05:19
by TechGeek
I will try to get that posted here in the morning.

Re: multi host environments

Posted: 24. Feb 2011, 05:37
by TechGeek
One other thing I did notice was that each time I double clicked on the vbox file, it opened a new copy of the manager instead of using the one that was already open.

Re: multi host environments

Posted: 24. Feb 2011, 23:53
by TechGeek
Here is the error I get when trying the command:

VBoxManage registervm fedora_14.vbox

Code: Select all

VBoxManage: error: Runtime error opening '/home/grs/.VirtualBox/fedora_14.vbox' for reading: -102 (File not found.).
VBoxManage: error: /home/vbox/vbox-4.0.4/src/VBox/Main/src-server/MachineImpl.cpp[430] (nsresult Machine::init(VirtualBox*, const com::Utf8Str&, const com::Guid*))
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component VirtualBox, interface IVirtualBox, callee nsISupports
Context: "OpenMachine(Bstr(a->argv[0]).raw(), machine.asOutParam())" at line 88 of file VBoxManageMisc.cpp
The actually full path to the file in question is:
/home/grs/VirtualBox VMs/fedora_14/fedora_14.vbox
or

/media/esata/VirtualBox VMs/fedora_14/fedora_14.vbox

"VirtualBox VMs" is a soft link in my home directory to an external esata disk. Note that this is a virtual machine I created with VirtualBox 4.04 and I just did a remove from the manager. Also, double clicking the fedora_14.vbox file puts the machine back in the manager interface and it works just fine then.

Re: multi host environments

Posted: 25. Feb 2011, 00:20
by Perryg
"VirtualBox VMs" is a soft link in my home directory
Have you tried to just use the path to the external drive as your VirtualBox home instead of using soft links?
In preference you can set this and eliminate the soft link. I have all of my VMs on an eSata this way and have no issues.
Screenshot.png
Screenshot.png (129.57 KiB) Viewed 3047 times
Or VBoxManage setproperty machinefolder default|<folder> | if you need to do this from the CLI
Note: I change my home to not include the space in the name. I have no idea why they put that there. Makes it to where you must use "" on every command.

Re: multi host environments

Posted: 25. Feb 2011, 03:48
by TechGeek
No reason other than originally I just moved the entire .VirtualBox folder to the esata drive when I was using 3.x. I will see if it makes any difference.

Re: multi host environments

Posted: 28. Feb 2011, 01:18
by TechGeek
PerryG,

I changed the directory location from pointing to a soft link to pointing to the actual folder. However, there is no way to change to location of the user settings folder which is normally at /home/.VirtualBox Those files are needed also so I have a soft link to the folder on my esata drive.

This didn't change the way errors I received when trying to use the registervm command.

Re: multi host environments

Posted: 28. Feb 2011, 01:33
by Perryg
Sorry to hear this. Since I am not there to actually troubleshoot this with your configuration I just can't visualize what the solution would be. Maybe the DEVs will know what your problem might be? bugtracker

Re: multi host environments

Posted: 28. Feb 2011, 12:23
by mpack
TechGeek wrote:However, there is no way to change to location of the user settings folder which is normally at /home/.VirtualBox
Is there no equivalent of the VBOX_USER_HOME environment variable on Fedora hosts?

Re: multi host environments

Posted: 1. Mar 2011, 05:52
by TechGeek
Wasn't aware of that variable. Setting that allowed me to change the location. Still seems to be no way to import the virtual machines from the command line. Also no answer as to how multiple hosts are suppose to be set up to interact with guests on shared storage.