This makes virtualbox works in a portable mode:
- if you have any installed virtualbox then uninstall it first
- download https://download.virtualbox.org/virtualbox/7.0.8/VirtualBox-7.0.8-156879-Win.exe or any newer or older version
- click on
Download ZIPabove to download the scripts needed - create a folder inside your USB/external drive or whatever, name it
myVMBOX(ex.F:\myVMBOXif your USB is inF:\). - inside
F:\myVMBOXput the virtualbox exe we just downloaded (VirtualBox-7.0.8-156879-Win.exe) and rename it toVirtualBox.exe. - inside
F:\myVMBOXput the following filesstart_virtualbox.batanduninstall_virtualbox.bat, you will find them inside the zip you just downloaded. - now everytime you want to start virtualbox use
start_virtualbox.bat.
If you want to uninstall virtualbox use the Control Panel or uninstall_virtualbox.bat (this is optional).
That is all, now everytime you start virtualbox using start_virtualbox.bat it will start in a portable mode, the virtual machines we create will be saved to F:\myVMBOX inside your USB, and you can use the USB in any machine now, virtualbox will always find your virtual machines from your USB, but you have to always start virtualbox from start_virtualbox.bat.
If you download a newer virtualbox executable, then uninstall the old one and do the same steps again.
if you want to migrate your old created virtual machines to the new portable folder myVMBOX (for example your old virtual machines created with virtualbox), do the following:
- start virtualbox using
start_virtualbox.bat. - now close the virtualbox we just started.
- open
c:\myVMBOXfolder (c:\myVMBOXis just a symlink shortcut to your USB folderF:\myVMBOX), you have to openc:\myVMBOXfor this trick to work notF:\myVMBOX. - inside
c:\myVMBOXcreate a folder and name itMachinesif it does not already exist. - now inside
c:\myVMBOX\Machinesput all your old virtual machines folders, so you will have at the end something like that for example:
c:\myVMBOX\Machines\win10VM
c:\myVMBOX\Machines\win7VM
c:\myVMBOX\Machines\UbuntuVM
- now enter to every folder inside
c:\myVMBOX\Machinesand doble click the file that ends with.vboxextension (it have a blue icon).
that is all, all your older virtual machines are now registred in virtualbox database and are saved inside your USB. you will find them inside your USB F:\myVMBOX.
this gist was created for this discussion: vboxme/Portable-VirtualBox#89 (comment)