团结起来,齐心协力帮助地震中受灾的同胞度过难关!

推荐虚拟机开源软件:Virtualbox 1.60

上一篇 / 下一篇  2008-05-09 20:04:53 / 个人分类:软件

推荐虚拟机开源软件:Virtualbox 1.60

 

      前两天逛虚拟机论坛,看到一些推荐,就到迅雷里下载了一个试试。软件很小,20M左右,安装也很简单,用深度精简XP做了一个系统。我给VB.XP分配的是512的内存,进去之后感觉运行起来比VM下面1G的XP还要快!用一见钟情来形容我对Virtualbox(以下简称Vbox)的感觉也不为过,“爽”就一个字。

 

      既然Vbox的虚拟系统运行很快,并且也很稳定,我打算就把以前VM下的XP+Oracle转移到Vbox里面来。原VM系统占用了固定18G的硬盘空间,我深恶痛绝。很可惜,搜索出来的信息表明,Vbox 1.60还不能直接拿VM虚拟的系统用。查看Vbox 的帮助,确实是不支持的:

 

5.4. VMDK image files
Starting with version 1.4, VirtualBox also supports the popular and open VMDK container format that is now supported by a large number of virtualization products.

This means you can import your existing VMDK files by way of the Virtual Disk Manager just like existing VDI images; see Section 3.5, “The Virtual Disk Manager”. While VirtualBox fully supports using VMDK files in most situations, the more advanced features of virtual hard disks are presently not supported. In detail, with VMDK images,

you presently cannot create snapshots;

only write-through images are supported; immutable and normal hard disk are not.

 

      没办法,又花时间重建了一个深度XP+Oracle+应用软件的系统。在这过程中,我选择的动态磁盘分配方式,预留30G空间。完工之后,查看VBox下VDI文件,才5G,哈哈。

 

      但动态磁盘分配方式还是给我带来了烦恼。我在Vbox里面导入dmp数据,导出,一系列操作之后,虚拟XP在HOST系统里面已经占用了约9G的空间,有点大了。但是,当我移除oracle的user,甚至压缩表空间之后,尽管我在Vbox虚拟XP中看磁盘占用空间已经变小,但真实系统中VDI的大小丝毫不变。搜索信息,有几种可行方法:

1.HOWTO: Shrink a VirtualBox 1.5.0 Windows Guest Virtual Disk

Problem: Your XP virtual disk file in VirtualBox 1.5.0 has grown too large due to fragmentation. Even though you only have 4 gigs of stuff on the disk, the file is 12GB large!
 
Here's what you need to do:
1. Defragment the disk, moving files to the beginning of the disk.
2. Overwrite all empty space in the disk file with zeros.
3. Close the windows VM and compact the disk file
 
You need these free tools:
 
First, boot up your Windows VM under VirtualBox.
 
DirMS will defragment the disk and move all files to the beginning (leaving all the free space at the end of the disk.) Run the command:
 
dirms c -q
or
dirms c
 
You may need to run this several times. Run the built-in XP defrag utility to get a visual map after running dirms. You'll see the improvements.
 
Now wipe the free space with zeros:
 
sdelete -c c:
 
Now, exit your Windows VM and go back to a Puppy prompt:
 
VBoxManage modifyvdi <diskfile.vdi> compact
 
That should compact your disk file!
 
=======================================================
 
2.You need a tiny utility called Nullfile which will write a dummy file in the current directory and fill it with 0s. When the file can no longer write (disk full) it then deletes the file and closes. This effectively does what you want I think. It iwas written to make the compression of free space easier for disk imaging/cloning.
 
You can get it here:
 
 
and this one works just fine, though I think there is a version 1.02 out there somewhere. download the file, place it in the root, and rename it nullfile.exe. It works fairly fast, though it doesn't seem so. Now you can run it in a commsand window. If you stop the file in the middle, remember to delete the dummy.xxx file it creates. It is a good idea to defrag the disk first and consolodate empty space.
 
I read something about a 4GB size limit on the dummy file, so if that is the case, then I'm sure you could rename the file and run Nullfile multiple times.
 
======================================================================
 
3.
1) guest: defrag (with jkdefrag) with default param
2) guest: defrag (with jkdefrag) with param 5
3) guest: sdelete -c (write zero's in free space) not compatible with ma Vista but works fine...
4) host: vboxmanage modifyvdi xxxxx.vdi compact
5)hours work (for all steps) and finally ma VDI size returned to 7,4 Gb
 
====================================================================
 
4.*琥珀
2008-01-19, 09:12 PM
讓 vdi 檔案縮小 (釋放未使用空間) 的方法:
 
步驟一:sdelete -c (由 guest os 執行)
步驟二:vboxmanage modifyvdi <檔案> compact (由 host os 執行)
 
經過壓縮後,可用空間就會回來了。
 
====================================================================
 
      以上方式都可以有效减小VDI的大小。我嫌麻烦,因为30G的动态分配空间,每时每刻都在变化,做一次大的操作又得压缩一次。我采取了一种新的方式:
 
1.新建一个VDI,命名为BAK.VDI,以从盘方式挂载在Vbox XP下并格式化。
2.对原Vbox的C和D盘做镜像,可以利用BOOTCD里的Acronis TI完成每个分区的镜像。备份文件放到挂载的F:
3.创建一个新的Vbox,给一个新的硬盘固定空间(我分配9G,可按实际使用空间和未来扩展可能而定)
4.以DEEP.XP.ISO引导系统,给新VDI分区(C:和D:)
5.挂载BAK.VDI作为从盘。
5.将备份的分区镜像分别恢复到新的XP。
5.删除原有XP的VDI文件。
 
大功告成!!!!!!!!!!!!

TAG: Virtualbox 开源 软件 推荐 虚拟机

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

Open Toolbar