从ghost映像.gho文件快速创建vmware虚拟机
https://www.cnblogs.com/blog2018/p/8857146.html
ghost文件.gho和vmware文件都是磁盘映像,但神奇的是,分属两家公司的文件格式,居然可以互相转换。
方法如下:
1. 将 ghost .gho文件 转换为 vmware 硬盘文件 vmdk
命令行命令:
ghost32 -clone,mode=restore,src=YOUR-GHOST-FILE.gho,dst=YOUR-VM-NAME.vmdk -batch -sure # 恢复gho镜像到vmdk磁盘
ghost32 -clone,mode=create,src=YOUR-VM-NAME.vmdk,dst=YOUR-GHOST-FILE.gho -batch -sure # 创建vmdk磁盘的gho镜像
@echo off title gho2vmdk script set bindir=%~dp0 cd /d "%bindir%" set /p ghoname= gho file name(no file suffix): if not exist "%bindir%\%ghoname%.gho" ( echo the "%bindir%\%ghoname%.gho" not exist. exit /b 1 ) echo src file name : "%bindir%\%ghoname%.gho" echo dest file name : "%bindir%\%ghoname%.vmdk" if "%PROCESSOR_ARCHITECTURE%" == "AMD64" ( "%bindir%ghost64.exe" -clone,mode=restore,src="%bindir%\%ghoname%.gho",dst="%bindir%\%ghoname%.vmdk" -batch -sure ) else ( "%bindir%ghost32.exe" -clone,mode=restore,src="%bindir%\%ghoname%.gho",dst="%bindir%\%ghoname%.vmdk" -batch -sure ) pause
@echo off title vmdk2gho script set bindir=%~dp0 cd /d "%bindir%" set /p vmdkname= vmdk file name(no file suffix): if not exist "%bindir%\%vmdkname%.vmdk" ( echo the "%bindir%\%vmdkname%.vmdk" not exist. exit /b 1 ) echo src file name : "%bindir%\%vmdkname%.vmdk" echo dest file name : "%bindir%\%vmdkname%.gho" if "%PROCESSOR_ARCHITECTURE%" == "AMD64" ( "%bindir%ghost64.exe" -clone,mode=create,src="%bindir%\%vmdkname%.vmdk",dst="%bindir%\%vmdkname%.gho" -batch -sure ) else ( "%bindir%ghost32.exe" -clone,mode=create,src="%bindir%\%vmdkname%.vmdk",dst="%bindir%\%vmdkname%.gho" -batch -sure ) pause
2. 创建一个和 ghost 原系统相匹配的虚拟机
在 vmware 中,按“新建虚拟机”向导,创建一个和 ghost 原系统匹配的虚拟机。
比如,ghost原系统是win7 x64,新虚拟机的操作系统,也要选择 windows 7 64位。
内存、硬盘,相应选择即可。
运行向导时,几个小细节需要注意:
- “安装客户机操作系统”步骤,选择“稍后安装操作系统”
- “指定磁盘容量”步骤,选择“将虚拟磁盘存储为单个文件”
- 向导完成后,无需启动虚拟机
3. 覆盖 vmdk 文件
将步骤1转换生成的vmdk文件,复制到步骤2 vmware向导创建的虚拟机目录,覆盖相应的vmdk文件
这时,启动虚拟机,即可引导ghost映像文件中的操作系统。
vmware有一个命令行工具 vmrun,用来执行vmware命令;结合ghost32,可以自动化完成这一整套操作。有需要的同学,可以继续研究一下。
参考文档:
- Creating a Workstation virtual machine using existing VMDK virtual disks (2010196)
https://kb.vmware.com/s/article/2010196- Converting Image File Format From GHO to VMDK and From VMDK to GHO
https://www.symantec.com/connect/articles/converting-image-file-format-gho-vmdk-and-vmdk-gho- 使用vmrun命令行来创建vmware虚拟机
http://www.cnblogs.com/phpdragon/p/5111692.html
============= End