virtualbox释放空间

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%
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值