You are Here:
Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section



Can I move my virtual machines from one PC to another?

Author (Read 3115 times)

0 Members and 1 Guest are viewing this topic.

Re: Can I move my virtual machines from one PC to another?
« Reply #9 on: March 31, 2016, 07:44:00 AM »
 

Wirezfree

  • PayPal Supporter
  • Platinum Level Poster
  • *****
  • 1484
    Posts
  • Reputation: 405
  • Linux Lite "Advocate"
    • View Profile

  • CPU: i7-4790S

  • MEMORY: 16Gb

  • VIDEO CARD: Intel HD4600 (Integrated)
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)
 

Re: Can I move my virtual machines from one PC to another?
« Reply #8 on: March 31, 2016, 06:27:27 AM »
 

stop0x0000000a

  • New to Forums
  • *
  • 18
    Posts
  • Reputation: 6
  • Linux Lite Member
    • View Profile
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: [Select]
-rw-------  1 az az        9287237632 марта 31 13:09 Linux_Lite Clone.vdi
2) Then I filled the drive with zeros:

Code: [Select]
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: [Select]
-rw-------  1 az az        9288286208 марта 31 13:13 Linux_Lite Clone.vdiSeems the image size is the same.



Let's compact it:

Code: [Select]
VBoxManage modifyhd Linux_Lite Clone.vdi --compact

Now the things are better:

Code: [Select]
-rw-------  1 az az        4762632192 марта 31 13:15 Linux_Lite Clone.vdi

 

Re: Can I move my virtual machines from one PC to another?
« Reply #7 on: March 31, 2016, 05:58:19 AM »
 

stop0x0000000a

  • New to Forums
  • *
  • 18
    Posts
  • Reputation: 6
  • Linux Lite Member
    • View Profile
@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.
 

Re: Can I move my virtual machines from one PC to another?
« Reply #6 on: March 31, 2016, 05:40:00 AM »
 

Wirezfree

  • PayPal Supporter
  • Platinum Level Poster
  • *****
  • 1484
    Posts
  • Reputation: 405
  • Linux Lite "Advocate"
    • View Profile

  • CPU: i7-4790S

  • MEMORY: 16Gb

  • VIDEO CARD: Intel HD4600 (Integrated)
@ 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)
 

Re: Can I move my virtual machines from one PC to another?
« Reply #5 on: March 31, 2016, 01:42:15 AM »
 

stop0x0000000a

  • New to Forums
  • *
  • 18
    Posts
  • Reputation: 6
  • Linux Lite Member
    • View Profile
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-your-virtualbox-vm/
« Last Edit: March 31, 2016, 01:47:32 AM by stop0x0000000a »
 

Re: Can I move my virtual machines from one PC to another?
« Reply #4 on: March 31, 2016, 12:26:19 AM »
 

m654321

  • Gold Level Poster
  • *******
  • 893
    Posts
  • Reputation: 86
  • Linux Lite Member, 'Advocate' & Donator
    • View Profile

  • CPU: Intel Pentium [email protected] (2cores) on an Asus X71Q

  • MEMORY: 4Gb

  • VIDEO CARD: Intel GM45 Express Chipset

  • Kernel: 4.x
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
« Last Edit: March 31, 2016, 12:42:03 AM by m654321 »
64bit OS (32-bit on Samsung netbook) installed in 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
 

Re: Can I move my virtual machines from one PC to another?
« Reply #3 on: March 30, 2016, 05:30:55 PM »
 

Wirezfree

  • PayPal Supporter
  • Platinum Level Poster
  • *****
  • 1484
    Posts
  • Reputation: 405
  • Linux Lite "Advocate"
    • View Profile

  • CPU: i7-4790S

  • MEMORY: 16Gb

  • VIDEO CARD: Intel HD4600 (Integrated)
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)
 

Re: Can I move my virtual machines from one PC to another?
« Reply #2 on: March 27, 2016, 05:52:36 PM »
 

Wirezfree

  • PayPal Supporter
  • Platinum Level Poster
  • *****
  • 1484
    Posts
  • Reputation: 405
  • Linux Lite "Advocate"
    • View Profile

  • CPU: i7-4790S

  • MEMORY: 16Gb

  • VIDEO CARD: Intel HD4600 (Integrated)
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)
 

Can I move my virtual machines from one PC to another?
« Reply #1 on: March 27, 2016, 03:31:45 PM »
 

m654321

  • Gold Level Poster
  • *******
  • 893
    Posts
  • Reputation: 86
  • Linux Lite Member, 'Advocate' & Donator
    • View Profile

  • CPU: Intel Pentium [email protected] (2cores) on an Asus X71Q

  • MEMORY: 4Gb

  • VIDEO CARD: Intel GM45 Express Chipset

  • Kernel: 4.x
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 netbook) installed in 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
 

 

-->
X Close Ad

Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section