Page 1 of 1

Clone VMs to different drive. Nothing registered?

Posted: 29. Apr 2016, 14:31
by xlepws
Hello, I'm trying to clone one of my VMs to a different drive. I have run the following command from sudo:

Code: Select all

VBoxManage clonevm "Linux Mint" --basefolder "/media/pc_name/pc_ext_drive/Backup_VMs"
But the answer is:
VBoxManage: error: Could not find a registered machine named 'Linux Mint'
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBoxWrap, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "FindMachine(Bstr(pszSrcName).raw(), srcMachine.asOutParam())" at line 431 of file VBoxManageMisc.cpp
If I run VBoxManage list vms I have no results O.o
Image
..while I am actually running a lot of VMs:
Image

What should I do? Register VMs which are already there? What would "registering a vm" do/accomplish in this case?

Thanks!

Re: Clone VMs to different drive. Nothing registered?

Posted: 29. Apr 2016, 15:00
by Perryg
Removable media is very restrictive in Linux and is intentional. You should actually mount the media and assign your user to it with the -o switch and args. Then you would run the command in user space and not sudo.

Re: Clone VMs to different drive. Nothing registered?

Posted: 29. Apr 2016, 15:12
by xlepws
ok, I tried registering a cloned vm (full path needed) and succeeded :D
pc-001 pc_name # VBoxManage registervm "/home/pc_name/VirtualBox VMs/Linux Mint Clone/Linux Mint Clone.vbox"
pc-001 pc_name # vboxmanage list vms
"Linux Mint Clone" {82574499-b588-4358-9ed0-a1040d821a21}
pc-001 pc_name # VBoxManage clonevm "Linux Mint Clone" --basefolder "/media/pc_name/pc_ext_drive/Backup_VMs"
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Machine has been successfully cloned as "Linux Mint Clone Clone"
So, for whoever is wondering about this
* Cloning a VM via terminal requires pre-registering it even if already present in VBox GUI
* Cloning via terminal will not automatically add the cloned VM to VBox GUI

..I still wonder why creating VMs through the GUI doesn't actually register them :?

Cheers :)

Re: Clone VMs to different drive. Nothing registered?

Posted: 29. Apr 2016, 15:41
by xlepws
Perryg wrote:you would run the command in user space and not sudo.
That was it!
pc_name@pc-001 ~ $ vboxmanage list vms
"Win10_Ent_1" {c89636c6-97ad-4aa1-83cf-411c9e395034}
"Linux Mint" {33b45a3e-ce61-4ff8-9056-c95b429c3262}
"Win10_Pro_Eng_1" {bef934fe-ac9f-4200-8530-4bcded79f6cd}
"Win10_Pro_Ita_1_OK" {d7f0cfc3-efc7-4aef-be1b-276fa9088189}
"Win10_Pro_Ita_1 Clone" {5487152f-4b83-4e4c-8c92-a55cc6135fcb}
..while in su nothing would show :o

So what I said before was wrong: creating a VM via the GUI does actually register it..to show it, best not to be a super user :P