Welcome to FreeSoftwareServers Confluence Wiki

Find and Replace :


[SOURCE] = IP or DNS of Source VM host
[DESTINATION] = IP or DNS of Destination VM host
[USER] = User running SCP
[ORIGINALUSER] = Original Owner of files, or Proper owner of files on new VM Host



Script :

Run CMDs From [SOURCE]:
VBoxManage controlvm "[VMNAME]" poweroff
chown [USER]:[USER] "/srv/Virtualbox/[VMNAME]" -R 

mkdir "/srv/Virtualbox/[VMNAME]"
scp [USER]@[SOURCE]:"/srv/virtualbox/[VMNAME]/*" "/srv/Virtualbox/[VMNAME]/"
VBoxManage registervm "/srv/Virtualbox/[VMNAME]/[VMNAME].vbox"
VBoxManage list vms
vboxheadless -s "[VMNAME]" &
VBoxManage list runningvms
VBoxManage showvminfo "[VMNAME]" 

Optional CMD on [DESTINATION] :
chown [ORIGINALUSER]:[ORIGINALUSER] "/srv/Virtualbox/[VMNAME]" -R 

Run CMDs From [SOURCE] Machine:
VBoxManage unregistervm "[VMNAME]"
VBoxManage list vms 
Optional CMD on [SOURCE] Machine:
sudo rm "/srv/Virtualbox/[VMNAME]" -R 
  • No labels