Posts: 893
Threads: 197
Joined: Jul 2014
Reputation:
0
I have a fairly large number of virtual machines set up in Oracle Virtualbox 5.0.16.
However, I would like to copy and use them on another PC.
Once I've copied the machine folders to the new PC, I'm a bit unsure how to get them
operational again. As usual any help is much appreciated...
Regards
Mike
64bit OS (32-bit on Samsung[i] netbook) installed in [i]Legacy mode on MBR-formatted SSDs (except pi which uses a micro SDHC card):
2017 - Raspberry pi 3B (4cores) ~ [email protected] - LibreElec, used for upgrading our Samsung TV (excellent for the task)
2012 - Lenovo G580 2689 (2cores; 4threads] ~ [email protected] - LL3.8/Win8.1 dual-boot (LL working smoothly)
2011 - Samsung NP-N145 Plus (1core; 2threads) ~ Intel Atom [email protected] - LL 3.8 32-bit (64-bit too 'laggy')
2008 - Asus X71Q (2cores) ~ Intel [email protected] - LL4.6/Win8.1 dual-boot, LL works fine with kernel 4.15
2007 - Dell Latitude D630 (2cores) ~ Intel [email protected] - LL4.6, works well with kernel 4.4; 4.15 doesn't work
Posts: 1,484
Threads: 96
Joined: Mar 2014
Reputation:
0
The simplest way I have found... and I must admit I've only done it a few times...
On the source machine copy the entire folder that contains your VM, something like: /home/user/VBox/vms/Linux/Linux Lite 2.8/
Now on your destination machine copy the entire folder to where you will be saving your VM's, something like: /home/user/VBox/vms/Linux
Now open Virtual Box on the Destination machine.
Goto Machine > Add and in the File Navigation, navigate into the folder you copied
It should have just "1" .vbox file to select, Open it.
It should now be in main VBox GUI, check settings are appropriate, Then start it.(fingers crossed)
Where you may have issues,
The versions of Guest Additions in your VM and the one's available on the new machine may not match.??
Virtual Box Extension Pack may complain.??
My source and destinations have alway been the same versions.
There is also "another method" under the File Menu
Export the VM on Source machine, that creates an OVA file (Appliance) , copy to Destination.
Import the VM on Destination machine, not sure exactly what that does to the VM.?, file format.?
Also not sure where the VM ends up.?, it may ask for a location
Upgrades WIP 2.6 to 2.8 - (6 X 2.6 to 2.8 completed on: 20/02/16 All O.K )
Linux Lite 3.0 Humming on a ASRock N3070 Mobo ~ btrfs RAID 10 Install on 4 Disks
Computers Early days:
ZX Spectrum(1982) , HP-150 MS-DOS(1983) , Amstrad CPC464(1984) , BBC Micro B+64(1985) , My First PC HP-Vectra(1987)
Posts: 1,484
Threads: 96
Joined: Mar 2014
Reputation:
0
I forgot to ask... Is the VM Linux or Windows.
Also you maybe able to shrink the VM.??
There are tools to do it, if it's a Dynamic Disk.
Check the setup - disks and see if it's dynamic.
Upgrades WIP 2.6 to 2.8 - (6 X 2.6 to 2.8 completed on: 20/02/16 All O.K )
Linux Lite 3.0 Humming on a ASRock N3070 Mobo ~ btrfs RAID 10 Install on 4 Disks
Computers Early days:
ZX Spectrum(1982) , HP-150 MS-DOS(1983) , Amstrad CPC464(1984) , BBC Micro B+64(1985) , My First PC HP-Vectra(1987)
Posts: 893
Threads: 197
Joined: Jul 2014
Reputation:
0
03-31-2016, 04:26 AM
(This post was last modified: 03-31-2016, 04:42 AM by m654321.)
Quote:I forgot to ask... Is the VM Linux or Windows.
Also you maybe able to shrink the VM.??
There are tools to do it, if it's a Dynamic Disk.
Check the setup - disks and see if it's dynamic.
Thanks Dave. The guest VMs (linux distros) were set up in an
LL2.8 host. Each VM was set up with a dynamic rather than a
fixed disk. You suggest shrinking the VMs, though I don't think
I'll need to do this - do the tools for shrinking VMs come with the
Oracle Virtualbox package?
Mike
64bit OS (32-bit on Samsung[i] netbook) installed in [i]Legacy mode on MBR-formatted SSDs (except pi which uses a micro SDHC card):
2017 - Raspberry pi 3B (4cores) ~ [email protected] - LibreElec, used for upgrading our Samsung TV (excellent for the task)
2012 - Lenovo G580 2689 (2cores; 4threads] ~ [email protected] - LL3.8/Win8.1 dual-boot (LL working smoothly)
2011 - Samsung NP-N145 Plus (1core; 2threads) ~ Intel Atom [email protected] - LL 3.8 32-bit (64-bit too 'laggy')
2008 - Asus X71Q (2cores) ~ Intel [email protected] - LL4.6/Win8.1 dual-boot, LL works fine with kernel 4.15
2007 - Dell Latitude D630 (2cores) ~ Intel [email protected] - LL4.6, works well with kernel 4.4; 4.15 doesn't work
Posts: 18
Threads: 4
Joined: Mar 2015
Reputation:
0
03-31-2016, 05:42 AM
(This post was last modified: 03-31-2016, 05:47 AM by stop0x0000000a.)
I've been using VB for ~5 years, prefer export/import ova.
1) ova = zipped virtual machine folder (or tar.gzipped, you may unpack it manually), takes less space in case you need a backup.
2) ova it is an open format, you may copy your VM to VMWare or Hyper-V host.
3) you've got additional CRC here, to be sure the files are copied fully and not corrupted.
Tried once to run VMWare images with VB, worked fine for me.
VM shrinking is a matter of file deletion, deleted files are still present on disk, so your guest still takes that space.
So you need to:
1) Defrag (for windows guests)
2) Fill empty space with zeros
3) Run VBoxManage then
See here:
https://www.maketecheasier.com/shrink-yo...ualbox-vm/
Posts: 1,484
Threads: 96
Joined: Mar 2014
Reputation:
0
@ stop0x0000000a
Thanks for the link, An important point that seems to be missing is the fact of "shrinking/moving the actual Guest partitions.?
If you created a 50GB VM, and installed the Guest and used the 50GB in the install, maybe 10GB / , 5GB /home , and say 35GB /data, or just a single partition.
Then you will not be able to shrink the VM. The 1st thing you need to do is shrink/move the Guest partition(s) using GParted or something else if using Windows.
You need "unallocated" space in the VM disk(s), then you can shrink the VM disk(s).
To verify this I just did my old XP VM,
It consisted of 2 separate Guest drives(8 & 16GB) for a C: & D: totalling 24GB. I 1st resized them, left a few GB spare in each, now the VM(.vdi's) total 7GB.
I was very aggressive in my clean-up
Upgrades WIP 2.6 to 2.8 - (6 X 2.6 to 2.8 completed on: 20/02/16 All O.K )
Linux Lite 3.0 Humming on a ASRock N3070 Mobo ~ btrfs RAID 10 Install on 4 Disks
Computers Early days:
ZX Spectrum(1982) , HP-150 MS-DOS(1983) , Amstrad CPC464(1984) , BBC Micro B+64(1985) , My First PC HP-Vectra(1987)
Posts: 18
Threads: 4
Joined: Mar 2015
Reputation:
0
@Wirezfree
I see you point, but it seems VM creates "sparse" files:
https://en.wikipedia.org/wiki/Sparse_file
i.e. file, that logical size is larger, than physical. This way it would be enough just to "zero" the sectors to save the space.
But I am not 100% sure anymore, probably will test it and post here the results.
Posts: 18
Threads: 4
Joined: Mar 2015
Reputation:
0
ok, I've checked that.
My working LL was the image to test, a lot of software has been installed/uninstalled since it was initially created, so it was wasted a lot.
1) The initial size:
Code: -rw------- 1 az az 9287237632 марта 31 13:09 Linux_Lite Clone.vdi
2) Then I filled the drive with zeros:
Code: cat /dev/zero > /empty_file
In a couple of minutes no more free space left and there is a huge empty_file.
so, rm empty_file.
Code: -rw------- 1 az az 9288286208 марта 31 13:13 Linux_Lite Clone.vdi
Seems the image size is the same.
Let's compact it:
Code: VBoxManage modifyhd Linux_Lite Clone.vdi --compact
Now the things are better:
Code: -rw------- 1 az az 4762632192 марта 31 13:15 Linux_Lite Clone.vdi
Posts: 1,484
Threads: 96
Joined: Mar 2014
Reputation:
0
Thanks for the info.
O.K, that worked quite well @ 50% reduction in size
Upgrades WIP 2.6 to 2.8 - (6 X 2.6 to 2.8 completed on: 20/02/16 All O.K )
Linux Lite 3.0 Humming on a ASRock N3070 Mobo ~ btrfs RAID 10 Install on 4 Disks
Computers Early days:
ZX Spectrum(1982) , HP-150 MS-DOS(1983) , Amstrad CPC464(1984) , BBC Micro B+64(1985) , My First PC HP-Vectra(1987)
|