virtualbox释放空间:
win虚拟系统:
清零:
在虚拟机中,从微软官网下载SDelete(https://technet.microsoft.com/en-us/sysinternals/bb897443),解压,cmd进入解压目录下(如放在c盘根目录下),打开cmd执行:
//把整个c盘下的未使用的磁盘空间标记为0
sdelete -z c:\
执行完后把虚拟机关机
压缩:
//如果是Mac宿主机,终端执行:
cd /Applications/VirtualBox.app/Contents/MacOS/
./VBoxManage modifyhd /Users/xxx/VirtualBox\ VMs/win7_64/win7_64.vdi --compact
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
//如果是window的宿主机,则用这个
进入宿主机VBoxManage目录(通常为VirtualBox安装目录),然后执行BoxManage命令压缩VDI虚拟机磁盘文件即可。
cd D:\Program Files\Oracle\VirtualBox
VBoxManage modifyhd F:\VMs\windows_xp_professional_sp3_x86.vdi –compact
Linux虚拟系统:
清零:
在虚拟机中,打开终端执行:
sudo dd if=/dev/zero of=/empty
sudo rm -f /empty
执行完后把虚拟机关机
压缩:
Mac终端执行:
cd /Applications/VirtualBox.app/Contents/MacOS/
./VBoxManage modifyhd /Users/xxx/VirtualBox\ VMs/CentOS74/CentOS74.vdi --compact
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%