summaryrefslogtreecommitdiffstats
path: root/content/posts/compacting-vdi-image.md
diff options
context:
space:
mode:
authorbreadcat2020-06-19 12:23:15 +0100
committerbreadcat2020-06-19 12:23:15 +0100
commit70bb5d5a801428b0fb390abf79f19ffcf5e29c67 (patch)
treeb9fd7990156bd58bc38d58f91829c05933215102 /content/posts/compacting-vdi-image.md
parent0f9a31348079c0a061bcc194912e75cc1c07bc1f (diff)
downloadblog.minskio.co.uk-70bb5d5a801428b0fb390abf79f19ffcf5e29c67.tar.gz
blog.minskio.co.uk-70bb5d5a801428b0fb390abf79f19ffcf5e29c67.tar.bz2
blog.minskio.co.uk-70bb5d5a801428b0fb390abf79f19ffcf5e29c67.zip
Simple migration of existing posts to hugo format
Diffstat (limited to 'content/posts/compacting-vdi-image.md')
-rw-r--r--content/posts/compacting-vdi-image.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/content/posts/compacting-vdi-image.md b/content/posts/compacting-vdi-image.md
new file mode 100644
index 0000000..bec8aad
--- /dev/null
+++ b/content/posts/compacting-vdi-image.md
@@ -0,0 +1,24 @@
+---
+title: "Compacting a VirtualBox VDI Image"
+date: 2018-09-06T12:26:00
+tags: ["formats", "guides", "linux", "snippets", "software", "windows"]
+---
+
+Firstly, you'll need to install `zerofree` on your Linux image, then mount the root partition as a read only volume. This can be done via:
+
+```
+sudo apt-get install zerofree
+sudo apt-get clean
+sudo reboot
+# interrupt grub boot and boot into recovery mode
+mount -n -o remount,ro -t ext4 /dev/sda1 /
+zerofree /dev/sda1
+shutdown -h now
+```
+
+And now on the Windows Host:
+```
+"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyvdi "VirtualBox VMs\server\server.vdi" compact
+```
+
+This should make the VirtualBox image more in line with the calculated size it should be. \ No newline at end of file