Page 1 of 1

Change Default Machine folder

Posted: 13. Jan 2017, 23:43
by frees
Hello,
I have a little problem. I use two USB disks (120Go x 2) to backup my machines. But when I create a new clone, I do not see where I can change its location so that it saves to the correct disk and not to the default location.

My configuration:
"VIRTUAL" directory is in my Hard disk and I won't any virtual machines here. but It's also my default directory because I don't know if I save my new machine in directory 1-mVirtual(=diskUsb1) or 2-mVirtual(=diskUsb2).

Code: Select all

ls -larth
drwxr-xr-x  5 captain ed-m_mvirtual 4.0K Jan 13 21:08 VIRTUAL

ls -larth mVIRTUAL/
drwxrwx--- 1 captain ed-m_mvirtual 128K Jan 13 21:05 1-mVirtual
drwxrwx--- 4 captain ed-m_mvirtual 4.0K Jan 13 21:07 2-mVirtual
1-mVirtual is my disk USB 1

Code: Select all

ls -larth mVIRTUAL/1-mVirtual
drwxrwx--- 1 captain ed-m_mvirtual 128K Jan 13 21:05 1-partage
drwxrwx--- 1 captain ed-m_mvirtual 128K Jan 13 21:15 1-machines
2-mVirtual is my disk USB 2

Code: Select all

ls -larth mVIRTUAL/2-mVirtual
drwxrwx--- 1 captain ed-m_mvirtual 128K Jan 13 21:05 2-partage
drwxrwx--- 1 captain ed-m_mvirtual 128K Jan 13 21:15 2-machines
For see my mount partitions:

Code: Select all

df
Filesystem    1K-blocks         Used    Available    Use%    Mounted on
/dev/sda1        944120        81532       813796     10%    /boot
/dev/sda2     622548810    584898771     57799972     62%    /
/dev/sdb1     122546800     58478772     57799972     51%    /media/VIRTUAL/2-mVirtual
/dev/sdc1     125025792     35732992     89292800     29%    /media/VIRTUAL/1-mVirtual
To make it simple I just want to be able to choose the directory where my clone will be saved.

Thanks :wink:

Re: Change Default Machine folder

Posted: 14. Jan 2017, 10:24
by socratis
frees wrote:to backup my machines. But when I create a new clone
I believe you're staring with the wrong foot. A clone is not a backup, like twin siblings are not identical. The cloning process changes the UUIDs of the VM and every HD and it could change the UUIDs and MAC addresses of the network cards. If you're using Windows guests, that's definitely a call for activation. If you're using Linux guests, GRUB might fail to boot your VM, because it's booting using the HD UUID.

A better approach would be to copy the whole VM folder. It might actually be faster. See Moving a VM and interpret it as copying a VM.

And I'm not just suggesting the above method because it's my preferred one, but because it takes VirtualBox out of the equation. Your backup strategy shouldn't be relying on each application...

Re: Change Default Machine folder

Posted: 14. Jan 2017, 16:47
by frees
Sorry for my english is very bad, I have a hard time explaining.

Else I know clone It's not a backup, I have a third disk to backup the virtual machines of my two USB disks.
And these two USB drives have nothing to see.

Disk1 USB (1-mVirtual):
Virtual machine windows7
Virtual machine windows10
Virtual machine mandriva

Disk2 USB (2-mVirtual):
Virtual machine debian8
Virtual machine windowsXP
Virtual machine archLinux
Virtual machine pfsense
Virtual machine musix


Disk1 It's not the backup of Disk2

Now my problem is: where is my default machine folder? In disk1 It's good for windows7, windows10 and mandriva but not for windowsXP, debian8, archLinux ...
For the moment, my default machines folder is in my home user in the local hard drive but I don't want this configuration.

Example, if I make a clone of windows7 (in disk1) and debian8 (in disk 2)
Now it's:
Windows7 ==> disk1 USB (/media/VIRTUAL/1-mVirtual/Windows7)
Windows7 clone ==> disk Local of my computer (/home/station/VirtualBox VMs/Windows7 clone)
Debian8 ==> disk2 USB (/media/VIRTUAL/2-mVirtual/Debian8)
Debian8 clone ==> disk Local of my computer ==> (/home/station/VirtualBox VMs/Debian8 clone)

But I want this:
Windows7 ==> disk1 USB (/media/VIRTUAL/1-mVirtual/Windows7)
Windows7 clone ==> disk1 USB (/media/VIRTUAL/1-mVirtual/Windows7 clone)
Debian8 ==> disk2 USB (/media/VIRTUAL/2-mVirtual/Debian8)
Debian8 clone ==> disk2 USB (/media/VIRTUAL/2-mVirtual/Debian8 clone)

But for now I do not see how to make my cloned machines saved according to my choice on disk1 or on disk 2?

Re: Change Default Machine folder

Posted: 16. Jan 2017, 15:21
by scottgus1
Virtualbox's default machine folder is set in the main Virtualbox window, File menu, Preferences, General.

At the present my default machine folder set in Virtualbox is my P: drive. I have a DOS guest on the P: drive. For a test I changed the default machine folder to my Q: drive, then I made a clone of the DOS guest. The clone went to the Q: drive.

At least as of 5.1.6, my present version (I operate on the "if it ain't broke don't fix it" paradigm) clones get made in the default machine folder.

You can set your default machine folder to the desired destination via the main Virtualbox window. There may be a command-line method to set this folder, I don't know what it is right off. I'm certain a search of the manual can find it.

Or you can try the "VBoxManage clonevm" command, see section 8.9 in the manual. Part of the possible switches to the command is "--basefolder", which apparently allows you to pick where the clone goes. I haven't tried it, not being a heavy cloner myself.

Re: Change Default Machine folder

Posted: 18. Jan 2017, 11:56
by frees
It's a shame that there is not the "--basefolder" functionality in the GUI and you can not define for each machine or machine group a different default folder.

But maybe one day;)
Thanks a lot and have a good day