how to move VMs

Discussions related to using VirtualBox on Linux hosts.
Post Reply
52ROSt
Posts: 86
Joined: 28. Dec 2014, 07:12

how to move VMs

Post by 52ROSt »

Linux host / Windows guests

I have 2 Windows Guest VMs, which I need to move to a different location on the same PC and at a different PC.

I want to move them by zipping the entire folder and move the zip-file.

Question:

Before zipping the VM folder, do I need to click "REMOVE" in the VM Virtual Box Manager?

Any addtional hint is welcome!

Thanks in advance.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: how to move VMs

Post by scottgus1 »

Please see Moving a VM.
52ROSt
Posts: 86
Joined: 28. Dec 2014, 07:12

Re: how to move VMs

Post by 52ROSt »

@scottgus1

Tanks for the helpful link. I keep this now in installation notes to not forget it again.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: how to move VMs

Post by mpack »

52ROSt wrote: I want to move them by zipping the entire folder and move the zip-file.
Be careful with that. The zip format is old enough that the original format has the same 4GB limitation on filename length that FAT had. Variants of the format have been developed, so you need to think about what variant you will be using, and whether the target PC supports it. It may be better to avoid zip.
52ROSt
Posts: 86
Joined: 28. Dec 2014, 07:12

Re: how to move VMs

Post by 52ROSt »

@mpack
Thanks for the hint with zip. I should have written "compress"; *tar.gz is the compression I use in Linux Mint.
It there also a limitation?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: how to move VMs

Post by mpack »

I don't use gz, but I assume it has gone through similar variations over the years. So if source and target are recent Linux then you probably won't have a problem.
52ROSt
Posts: 86
Joined: 28. Dec 2014, 07:12

Re: how to move VMs

Post by 52ROSt »

With the comment about the problem with using zip-Format I got triggered to make a short test. I wanted to know which algorithm is best for compressing a VM.

Comparing the size of the original VM folder, with the size of the compressed file, I got the following result:
7z => 72%
tar.7z => 71%
tar.bz2 => 65%
tar.gz => 64%

7z has the highest compression ratio but takes also quite some time. tar.gz has the lowest compression ration and is pretty quick.
Host is Linux Mint and guest is Windows 10.
I did not make any test about the security in respect to un-compressing the VMs. Based on usage I know that tar.gz works fine; if fully work in Linux.

@mpack
From the safety point of view, what kind of compression algorithm would you use?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: how to move VMs

Post by scottgus1 »

Questions:

Do you intend to run the VM on the new places on the existing PC and the other PC? or are you just backing up?

And is the other PC networked in your local LAN or on the internet?

Zipping may take more time than just a straight copy. Disk space is cheap nowadays, so storing several full-size copies of a VM is quite possible. And rsync can get the VM backed up over the internet with much less data being passed after a first seed copy (provided not much changes between backups).

Further, FC file-compare for local LAN copies and hashing for over-internet copies can serve as integrity checks. A zip may save disk space but cannot be integrity-confirmed as being an exact copy of the original unless it is unzipped at the destination.

I used Cygwin rsync & SHA256 hash integrity-check for offsite backups, and regular file copy and FC integrity-check for LAN backups of the office server VMs I oversaw for a while.
52ROSt
Posts: 86
Joined: 28. Dec 2014, 07:12

Re: how to move VMs

Post by 52ROSt »

I have 2 reasons for compressing VMs. 1. Backup on my workhorse and external HDDs and 2. to also moving them to my backup PC. The move function of the 6.x version works nice thus I have the possibility to move a machine simply over to the other PC using WLAN connection.

So far it seems I was lucky with my tar.gz compresssion. The extracted VMs started immediately.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: how to move VMs

Post by scottgus1 »

OK, just remember that a copied VM that boots isn't necessarily a perfect copy, if the data mistake occurs in a portion of the data that isn't touched by the boot process. You'll have no integrity check that the zip truly copied the original correctly, unless you unzip at the end and check hashes. But that's up to each person how sure they want to be of their backups.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: how to move VMs

Post by mpack »

52ROSt wrote: @mpack
From the safety point of view, what kind of compression algorithm would you use?
I wouldn't, but my choice has nothing to do with safety. Text compression of the type done by ZIP, RAR et al are most effective on text. On binary they can't guarantee to get any compression at all, and it uses a lot of time - I don't consider it worth the bother, so I choose to transport the images on larger drives instead.

For archiving purposes I might choose to properly compact the drive. But note that compaction is not compression. Compaction discards unwanted data, it does not attempt to make the same data fit into fewer bytes.
52ROSt
Posts: 86
Joined: 28. Dec 2014, 07:12

Re: how to move VMs

Post by 52ROSt »

@mpack & @scottgus1

Thanks for both your postings.

I now understand now that I don't understand enough about copies of VMs and compression and compaction. That's lesson 1. I now know that I need to take care with compression in general and especially with VMs and try to learn more.

A great thing is the move-function in v6. Thanks to the ones who wrote this code.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: how to move VMs

Post by scottgus1 »

52ROSt wrote:A great thing is the move-function in v6. Thanks to the ones who wrote this code.
Sure makes it easy, doesn't it? Starting in version 4 it was pretty OK with new VMs made in version 4, if one knew the layout of a VM. Try it back in version 3 days..... :shock:
52ROSt
Posts: 86
Joined: 28. Dec 2014, 07:12

Re: how to move VMs

Post by 52ROSt »

Try it back in version 3 days.....
No way, although it could a great way to learn more.

I am happy with my XP VM, which runs an application running only with XP. I also have a W7 WM which I used for a while for Outlook. And my lastet VM is a W10, which I need for weather data while being off-shore on our sailing nutshell. This W10 only contains the needed application of PredictWind, Firefox, Opera, 7z, and Okular. That's it. I hope this runs stable for the next 5 - 10 year so I can complete my budget-sail. For the rest I use my Linux Mint.
Post Reply