VirtualBox: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 4: | Line 4: | ||
==Linux Guest== | ==Linux Guest== | ||
<syntaxhighlight lang="bash"> | |||
sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096k | |||
sudo rm -rf /bigemptyfile | |||
</syntaxhighlight> | |||
'''OR''' | '''OR''' | ||
<syntaxhighlight lang="bash"> | |||
telinit 1 | |||
mount -o remount,ro /dev/sda1 | |||
zerofree -v /dev/sda1 | |||
</syntaxhighlight> | |||
==Windows Guest== | ==Windows Guest== | ||
<syntaxhighlight lang="batch"> | |||
cleanmgr | |||
del C:\Windows\SoftwareDistribution\Download | |||
del C:\Windows\Temp | |||
del C:\Documents and Settings\<user>\Local Settings\Temp | |||
del C:\Windows\$Nt*Uninstall* | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="batch"> | |||
rem http://cdn.chorke.org/soft/winx/sdelete/sdelete.zip | |||
sdelete.exe c: -z | |||
sdelete.exe d: -z | |||
</syntaxhighlight> | |||
==Compact== | ==Compact== |
Revision as of 09:27, 2 November 2018
- Run
defrag
in the Windows Guest - Nullify free space:
Linux Guest
sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096k
sudo rm -rf /bigemptyfile
OR
telinit 1
mount -o remount,ro /dev/sda1
zerofree -v /dev/sda1
Windows Guest
cleanmgr
del C:\Windows\SoftwareDistribution\Download
del C:\Windows\Temp
del C:\Documents and Settings\<user>\Local Settings\Temp
del C:\Windows\$Nt*Uninstall*
rem http://cdn.chorke.org/soft/winx/sdelete/sdelete.zip
sdelete.exe c: -z
sdelete.exe d: -z
Compact
VBoxManage modifyhd xp-msql-box.vdi --compact VBoxManage modifyhd xp-base-box.vdi --compact
OR
VBoxManage.exe modifymedium --compact xp-base-box.vdi VBoxManage modifymedium --compact xp-base-box.vdi vboxmanage modifymedium --compact xp-base-box.vdi
References
- Windows PowerShell 1.0 for Windows Server 2003 & Windows XP
- Windows PowerShell 2.0, WinRM 2.0, and BITS 4.0
- How to compact VirtualBox's VDI file size?
- How to optimized Windows XP size?
- Creating a Windows XP Vagrant box
- Discover Vagrant Boxes
- Vagrant vs. Terraform
- Creating a Base Box
- A list of base Boxes
- Example Vagrantfile
- Vagrant vs. Docker
- Vagrant Windows
- Getting Started
- Compact VDI