Virtualbox portability

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Starfiretbt
Posts: 4
Joined: 21. May 2023, 19:02

Virtualbox portability

Post by Starfiretbt »

I tried to setup VirtualBox however it wants to be installed on my computer. I hate this as it means when I buy a new computer I have to reinstall the program and do all the work all over again. I much prefer portable files that can be moved where ever I want them.
1. Is there a way to set up VirtualBox as a portable folder?
2. Also when I tried to install the current VirtualBox in it's own folder, in hopes of making it portable, I get the error message "Missing Dependencies Python Core/ win32api." It does say those will be setup later but it gets me worried about other issues. If I try and set up VirtualBox in a portable folder will my computer try and put files in multiple places on my computer sabotaging the program and complicating it's removal if it fails?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Virtualbox portability

Post by scottgus1 »

All the VMs are portable, and so is the global configuration files (found in "C:\Users\{you}\.Virtualbox", note the period in the folder name). The VMs and configs don't need rebuilding to be used on a new host. The only thing that needs be done on a new host is install the Virtualbox app.

Copy the VMs over and register them in the new Virtualbox. Or, if you can put the copied VMs in the exact folders they were in on the old host, you can also copy the global configuration folder too, and the entire shebang will copy over.

You cannot have the installed Virtualbox app be portable, it must plug into the registry and install drivers. It is best to let Virtualbox install in the default "C:\Program Files", where full system protection is in place.

The Python warning is no big deal as long as you have no intention to control Virtualbox with Python scripts.
Starfiretbt
Posts: 4
Joined: 21. May 2023, 19:02

Re: Virtualbox portability

Post by Starfiretbt »

Okay I think I know what you mean, there is a part of VirtualBox that HAS to be installed, but that part is easily reinstalled. The rest is a portable folder. I don't know what VM'. I'm assuming it is the folder from which I would access VirtualBox and is the part I mostly interact with.
VirtualBox is like MiniVMac, Basilisk II, and SheepShaver isn't it? Only instead of emulating different Macs it emulates different PC's. Those programs are portable but I understand if VirtualBox needs a little extra help.
multiOS
Volunteer
Posts: 832
Joined: 14. Sep 2019, 16:51
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: WIN11,10, 7, Linux (various)
Location: United Kingdom

Re: Virtualbox portability

Post by multiOS »

No,VirtualBox is nothing like the emulators you have mentioned which were developed to 'fully' emulate specific computer systems including their hardware and operating system. They sometimes require users to provide their own ROM images where these are still protected by copyright etc.

VirtualBox and similar applications are designed to enable virtualised x86_64 systems to be created using the host machine's hardware, i.e. discrete allocations of hard disk space, 'surplus' RAM and CPU cores, supplemented by some entirely virtualised hardware, which are then capable of accepting the installation of a variety of operating systems that the user has to provide and install in the same way as you would install them on real hardware.

If you want to understand further, I would suggest you read the early sections of the VirtualBox User Manual available from the Download Page.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Virtualbox portability

Post by scottgus1 »

I'll add on a couple things:
Starfiretbt wrote:it emulates different PC's
Virtualbox actually simulates one kind of PC, a Virtualbox PC. Mostly generic hardware, with a couple of choices for network cards and audio based on what kind of OS will be installed in the "PC".
Starfiretbt wrote:I don't know what VM'.
I surmise this sentence is incomplete and was supposed to say "I don't know what 'VM' means." A "VM" is a "virtual machine", also called a "guest" in Virtualbox parlance, and refers to the "PC" that Virtualbox makes.

To keep you on track, "Virtualbox" is the app. VMs or "guests" are the virtual machines Virtualbox makes. Virtualbox has to be installed on each physical PC that will run VMs. The VMs are the "PCs" that Virtualbox makes, and can be copied to each Virtualbox host. You start Virtualbox, then you pick a VM and start it.
AW-1992
Posts: 18
Joined: 6. Mar 2023, 02:41

Re: Virtualbox portability

Post by AW-1992 »

scottgus1 wrote: 27. May 2023, 03:15 All the VMs are portable, and so is the global configuration files (found in "C:\Users\{you}\.Virtualbox", note the period in the folder name). The VMs and configs don't need rebuilding to be used on a new host. The only thing that needs be done on a new host is install the Virtualbox app.

Copy the VMs over and register them in the new Virtualbox. Or, if you can put the copied VMs in the exact folders they were in on the old host, you can also copy the global configuration folder too, and the entire shebang will copy over.

You cannot have the installed Virtualbox app be portable, it must plug into the registry and install drivers. It is best to let Virtualbox install in the default "C:\Program Files", where full system protection is in place.

The Python warning is no big deal as long as you have no intention to control Virtualbox with Python scripts.
Hi Scott, thank you for all your help on these forums as usual. Rather than make a new thread I thought I'd just piggyback off this one. I was wondering if you could point me to any resource that teaches how to use VMs in a portable sense with Virtualbox (or just spoonfeed me the answer if there isnt such a thing).

My problem is, I have my VMs on a portable SSD and want to run them on both school and home computers. However, I'm not sure the right process to export and import the VM into the program. I exported as .vdi with .iso as well, but when I import it, it points to a new directory and makes a new VM file. Importing also fails sometimes when someone at school messes with the virtualbox installed on the computer.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Virtualbox portability

Post by mpack »

Please see Howto: Move a VM. This applies on the same host or on different hosts.
AW-1992
Posts: 18
Joined: 6. Mar 2023, 02:41

Re: Virtualbox portability

Post by AW-1992 »

Im not sure how that resource helps me, if I want to open and configure a VM from my SSD, it will prompt me to import it and then set a directory for the import. Do I just point the directory back to where the VM came from?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Virtualbox portability

Post by scottgus1 »

The link demonstrates a principle that can be used in your project.

A VM consists of a folder with a .vbox file, a disk file*, and a Logs subfolder, and possibly a Snapshots subfolder. If you take that whole folder to another host, you can register the .vbox file on the new host using the main Virtualbox window's Machine menu Add command.

On the host where you have all these VMs, right-click each VM in the VM list and choose Move. Then Move each VM to a folder on the SSD. When they're all moved, then you can take the SSD to another computer where Virtualbox is installed, register each VM's .vbox file, and all the VMs will be on that computer too. Repeat for as many host computers as you want.

Whenever you move the SSD to another computer, the entire contents of the VM comes along. All the changes you make in a run of the VM stays on the SSD and will appear on the next host, too.

***********************

Note that this does not use Export/Import. Export/Import will make multiple different copies of one VM and the changes on one copy will not appear on other copies.

Note also that on each host, the drive letter for the SSD has to be the same as it was when the VM's .vbox file was registered, since the drive letter is used in the Virtualbox registry. The drive letter can be different on each different host, but for each host the drive letter must be the same as it has always been. If you change the SSD's drive letter to a letter somewhere between Z and the usual C D E F, perhaps V for "VM", before you start Moving or registering VMs, then you may not have problems with the SSD's drive letter changing and making the VMs inaccessible on that host.

* Virtualbox defaults to putting the VM's disk file inside the VM folder next to the .vbox file. If you happen to make the disk file in a different folder, the concept of the VM "folder" is broken and the put-them-all-on-the-SSD idea won't work. In the Virtualbox Media Manager, you can Move the disk file to the VM's folder next to the .vbox file, then the VM folder will be ready to be Moved to the SSD.
AW-1992
Posts: 18
Joined: 6. Mar 2023, 02:41

Re: Virtualbox portability

Post by AW-1992 »

I see. So if I Import a machine, it will make a copy and leave the original untouched. And any edits to the VM will be on the copy. This copy will be in the format .vbox.

However, if I use Add instead of import, I can open a .vbox file in the Virtualbox program, configure the VM, and save the new configurations onto the same .vbox file.

Did I get everything correct?

Thank you for the advice. I didn't realise that Add was different to Import.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Virtualbox portability

Post by scottgus1 »

AW-1992 wrote: 5. Sep 2023, 14:28 This copy will be in the format .vbox.
No. All VMs have a .vbox file and one or more disk files. The .vbox file is the "motherboard and peripherals" of the VM. The disk file (usually .vdi but can be other extensions) is the VM's disk. The folder containing the .vbox and the disk file(s) is the "case" of the VM. The whole folder is the VM.

Don't think about the guts of the VM or the files that make it up. Just think:
"If I picked up a PC or laptop and carried it with me, I'd have the whole laptop or PC to use elsewhere. If I put the VM folder on the SSD I can use the VM wherever I can plug in the SSD."

Yes, Export makes copies that will not contain the same data over time. You don't want to use Export/Import. You want to put the whole VM folder on the SSD then Machine Add the VM's .vbox file on every host you want to use the SSD's VM on. Don't think about what's going on inside the "case". Just think: "The VM folder is on the SSD. Machine Add the .vbox file and all my data comes with me in the VM when I move the SSD."
Post Reply