1. 程式人生 > >VmWare虛擬機器增加硬碟容量的方法

VmWare虛擬機器增加硬碟容量的方法

1、增加一個虛似硬碟

    如果是在vmware裡面安裝的windows系統,添加個硬碟很容易,

(1)先開啟要新增硬碟的虛擬系統(不要啟動該系統),選擇虛擬機器選單---設定-----選新增,

(2)然後在彈出新增硬體嚮導視窗中------選擇硬碟-------一路next就好了,後面的操作和新建一個虛擬機器的時候配置硬碟是一樣的。

(3)添加了新的硬碟後,啟動windows進到系統中,在控制面板中找“管理工具”->“計算機管理”,然後選“磁碟管理”,新增新磁碟就好了。

其實很簡單的..如果想繼續給VMware增加硬碟的話,重複上述動作。

2、改變原虛擬硬碟的大小

介面中並沒有提供增加硬碟容量的方法。只能在命令列形式下執行。安裝所在盤的c:\Program Files\VMware\VMware Workstation下有一個vmware-vdiskmanager.exe,就是它。

命令引數如下:------------------------------------------------------------------Usage: vmware-vdiskmanager.exe OPTIONS <disk-name> | <mount-point>Offline disk manipulation utility   Options:      -c                    : create disk; need to specify other create options      -d                    : defragment the specified virtual disk      -k                    : shrink the specified virtual disk      -n <source-disk>      : rename the specified virtual disk; need to                             specify destination disk-name      -p                    : prepare the mounted virtual disk specified by                             the drive-letter for shrinking      -q                    : do not log messages      -r <source-disk>      : convert the specified disk; need to specify                             destination disk-type      -x <new-capacity>     : expand the disk to the specified capacity      Additional options for create and convert:         -a <adapter>       : (for use with -c only) adapter type (ide, buslogic or lsilogic)         -s <size>          : capacity of the virtual disk         -t <disk-type>     : disk type id      Disk types:         0                  : single growable virtual disk         1                  : growable virtual disk split in 2Gb files         2                  : preallocated virtual disk         3                  : preallocated virtual disk split in 2Gb files      The capacity can be specified in sectors, Kb, Mb or Gb.      The acceptable ranges:                            ide adapter : [100.0Mb, 950.0Gb]                            scsi adapter: [100.0Mb, 950.0Gb]         ex 1: vmware-vdiskmanager.exe -c -s 850Mb -a ide -t 0 myIdeDisk.vmdk         ex 2: vmware-vdiskmanager.exe -d myDisk.vmdk         ex 3: vmware-vdiskmanager.exe -r sourceDisk.vmdk -t 0 destinationDisk.vmdk         ex 4: vmware-vdiskmanager.exe -x 36Gb myDisk.vmdk         ex 5: vmware-vdiskmanager.exe -n sourceName.vmdk destinationName.vmdk         ex 6: vmware-vdiskmanager.exe -k myDisk.vmdk         ex 7: vmware-vdiskmanager.exe -p <mount-point>               (A virtual disk first needs to be mounted at <mount-point>)

-----------------------------------------------------------------其中的-x引數就是用來擴容的……如這個:vmware-vdiskmanager.exe -x 50GB myDisk.vmdk

    解析: vmware-vdiskmanager.exe -x 大小 虛擬硬碟檔案-------------------------------------------------------我的執行過程:D:\Program files\VMware\VMware Workstation>vmware-vdiskmanager.exe -x 50GB "F:\Ubuntu\Ubuntu 64-bit.vmdk"

==================================================================總結一下:1。檔名應該用雙引號括起來。2。vmdk檔名要連同路徑。3。GB,MB,別忘了B。

需要強調的一點是,調整硬碟大小之後的效果,相當於增加了原來物理硬碟的柱面數目,因此,檔案系統並不會自動增長。需要重新調整檔案系統的大小。這一步不同的系統有不同的方法。比如1. 如果guest OS為win系列,可以通過partion magic來實現2. 如果guest OS為Linux系列,可以通過 resize2fs來擴大ext2/3格式的檔案系統。3. 如果guset OS為其他Unix系統,可以通過向檔案樹中新增加分割槽,來擴充原檔案系統。通過vm加盤的方法:在選單欄哪裡有個"VM",點選"VM"裡面有個"settings"或者直接用快捷鍵Ctrl+D,點擊"Add"增加一個"Hard Disk"。加完後進入系統後,右擊我的電腦選擇"管理"進入後再選擇"儲存"中的"磁碟管理"。對你剛才新增加的硬碟進行快速格式化後,就可以為你原先的硬碟多增加一個碟符=已經擴大你原先的硬碟大小。

Using log file C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\vmware-Administrator\vdiskmanager.logGrow: 100% done.The old geometry C/H/S of the disk is: 1044/255/63The new geometry C/H/S of the disk is: 1566/255/63Disk expansion completed successfully.

WARNING: If the virtual disk is partitioned, you must use a third-party         utility in the virtual machine to expand the size of the         partitions. For more information, see:         http://www.vmware.com/support/kb/enduser/std_adp.php?p_faqid=1647