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)
It is completely free and open source. Please feel free to test it! Only v5 works properly at the moment. Need to figure out how to install the VBoxSup.inf file somehow, or get the VirtualBox service running before opening the program. :)
As for this package, I can not figure out how to get it to run without Virtualbox being installed on the host system. Am I missing something? As I understand, "portable" means the whole program is contained in one folder, kind of like an AppImage or Flatpak.
Thank you for your work. You seem to be a lot more adept at scripting than myself. Hats off. Maybe we can work together to make something that will satisfy the PortableApps specifications? :D
I'm thinking we just need to rewrite the .bat file after install to reference the PortableApps folder once I place the install junk in the appropriate folder there... but I'm not sure how to get your script to play nicely with the stuff already going on in the .ini files. Maybe it will just magically work... lol. Maybe a different .bat file to start it once it's installed? Maybe some kind of custom.nsh file would work?