How to compress to half size a Virtual Machine

I have a Windows 8.1 virtual machine, my Windows image is 30GB but I reduced it to 15GB. I used a very compressed read-only file system called Squashfs; the same used for LiveCDs.

But if this is read only, how can it be used? You need a trick. Virtualbox allows you to use hard-disk images as read-only and saving the changes.

Install squashfs-tool

For example using:
sudo apt-get install squashfs-tool

Gentoo users need to compile support in the kernel and at least include xattr and xz USEs

Compress the image file

Move the vdi image to an empty directory and then create the new image, for example:

mksquashfs /home/you/directory image.sfs

Edit your fstab file (/etc/fstab)

Add something like this:

/home/you/image.sfs /mnt/ squashfs defaults 0 0

  • /home/you/image.sfs is the compressed image
  • /mnt/ is the mountpoint

Then run the following:

sudo mount -a

Create a symbolic link

First rename the original image and replace it with the symbolic link

ln -s /mnt/windows.vdi / home / voce / Virtualbox \ VMs / Windows

  • /mnt/windows.vdi is the image
  • /home/you/Virtualbox \ VMs /Windows is the location of the virtual machine

Open VirtualBox

Press Ctrl + D

Select the correct image

Then press Ctrl + Space

Finally choose Multi-attach

And that’s all c:

And after that I played a bit with Rewrite of Key, which I have in the aforementioned compressed Windows :3

These bottons respect your privacy

Leave a Reply

Your email address will not be published. Required fields are marked *