Vmware虚拟机教程之在WinPE上运行VMware!
白羽 2018-07-25 来源 :网络 阅读 2141 评论 0

摘要:本文将带你了解Vmware虚拟机教程之在WinPE上运行VMware!,希望本文对大家学Vmware有所帮助。

本人尝试多次,在winpe上运行VMware workstation,不管是完整版,精简绿色版都会报错,上网查了N多资料,没有可行的办法,在这里有For BartPE的vmware Plugin://www.bootcd.us/BartPE_Plugin_Details/535/VMware-Workstation-4_5_2-Plugin.html,希望高手去研究一下,既然在BartPE下能运行,在WinPE下我想应该也能的,附上相关资料:===============================================================================This is a test to find out if this plugin works without my customizations on XPE1.02 I don't expect this to work on XP or with any other shell than XPE 1.02.I think you will need a WMI-repository and MSI ..... let's find out about compatibilty of this plugin and your PE.Please do not redistribute this at this stage because I expect it to change a lot next weeks.This plugin needs some more preparation than usual. Here is a description of the necessary steps.Dependancies:XPE 1.0.2 - MSI - 2k3-built of BartPE - a standard installation of VMware on a 2k3 system Files:This plugin needs files in several system-folders and about 20MB in a program folder. The programs runs fromRam-drive and in this case R:/ws452 as installpath is hardcoded into all infs - sorry for that - %temp%/ws452 doesn't work for me. Run search and replace on all files if you need to change that. I don't like B: for RAMdrive as I use to have a virtual floppy on this letter. You can decide wether you want files on CD or in a self-extracting archive - for this plugin I used files on CD. In some cases you probably have to rename some files for example the oem (?).infs - this plugin uses oem0-oem2.You can change the oem-number - run s+r on all files to adjust.Registry:Most of the registry entries can be done via an *.inf file. There are some registry-entries that can't be processed by PE-builder - they have to be merged in when BartPE is alive. The plugin uses a cmd to export the registry entries. If the SAM - branch does not contain more than just the header you have to change permissions on HKLM/SAM so that it expands uptoHKLM/SAM/SAM/Domains/Account/Users/Names/__vmware_user__ RAMdrive:I use the driveletter R:/ for this build - B:/ is better suited for a virtual floppy drive - so I changed the driveletter. I recommend useing a RAMdrive with 256MB or more. If you try less be prepared to see RAMdrive-crashs quite often.System-RAM:Don't expect this plugin to work if you are building a BartPE for systems with less than 512MB of RAM. If you only need raw-disk-creation you can build for smaller systems - in this case you may even be able to use programfiles on CD instead of RAM-drive to safe about 20MB of RAM.Testing in a VM:You can and should test your builts before writing them to media in VMware. 512MB-VMs are enough as you will not be able to start a VM while running on VMware - it may work in Virtual PC but I don't know for sure. If you can push the play-button and get the No VM in a VM message your built is ready for toasting it.?/p> Run make.cmd and read ws452-files-only.infVMware is launched by running vmware.cmd===============================================================================还有这里://www.911cd.net/forums//index.php?showtopic=8876===============================================================================It finally works !A month ago I had almost given up - 2 months of running against a wall and I still was not able to introduce the "_vmware_user_" pseudo NT-acount that I needed to actually start a VM. Now I know it was worth the time. The trick was simply to export the SAM-hive at the right time and to merge it into BartPE at the right time.I never seen any other plugin make use of the SAM-hive - the pebuilder is not even able to process this kind of registry stuff - so I needed some time until I started looking into non-obvious directions . Another tricky aspect was the sequence in which the different ingredients have to be loaded at boot-time.Anyway - now I got a way to build a working version based on a 2k3 build with some kind of explorer shell. It is repeatable on different builds, different methods to load network and different explorer-shells. Here is a short outline of the required actions: make a clean install of VMware into R:/ws452 - use installrite to capture classes. Hand edit the registry entries for the drivers. Create a profile-dir with settings for VMware - all users and default users. Manually copy installer dir into build dir as the pebuilder won't accept the dir name. Setup a config.ini and a preferences.ini that fit this special working conditions. Create a BartPE with a RAM-drive as large as possible. Install classes and drivers via *.inf. At boot-time register some *.ocx files, register the 3 dlls needed, copy profiles to RAM-drive, add System-acount to administrator group and finally merge the _vmware_user_ and the group settings.Well - the working speed is slow compared with a standard install. But I don't think that this argument counts much in those situations where a VMware-LiveCD would be useful.Desaster recovery - you can start your VMs when your host-system is unusable. You can extract files from Linux or BSD VMs and so on. P2V - you can easily find out if a target-system will run in VMware - just go to the target, boot it from BartPE and run the target-system as a VM. Create raw-disks to convert them into vmdk-files.Forensic - boot a target-system once and be able to read any filesystem natively just by starting small "translator VMs" Not all functions are fully working at this time - the biggest problem - passing the check of the _vmware_user_ - is solved and everything else will be simple.Don't expect a plugin tomorrow - as this will become the most complicated plugin I have ever seen. Actually I use a mixture of *.infs, editing build dir and merging *.reg-files at runtime. Now it runs on a 2k3 build with XPE. I will try XPsp1 as well but I see no point in adopting it for XPsp2 at this time.Amazingly it doesn't matter if you put the VMware-dir in the ram-drive or onto the CD. I think the option to put it into program-dir looks more promising so I will follow that road.Another idea that I will try is to load the complete BartPE with VMware into RAM so that I can change CDs and insert media with prebuilt VMs. It is possible to install Virtual PC into the same BartPE build. My current build includes VMware 4.5.2, Virtual PC, SSH-client with user-keys (client from ssh.com), an older demo-version of X-win 32, various remote control clients like ultravnc, Citrix-clients and some disk-image mounting tools like file-disk, Ken Katos vdk.exe and some P2V scripts. I hope to replace Virtual PC by Virtual Server and to add Svista-serenity as well. I don't have access to these versions now so that may take some time but I am sure that it is possible.PE为了精简及更加有效的运行目的功能,会对很多东西进行精简你看下VM绿色版本的绿化程序就知道了。。。。--很显然为了运行VM,需要让PE进行很多倒退@shift 1@echo offCLScolor 0aecho.echo               VMware Workstation 6.0.2.59824 绿色精简版echo.echo.echo                                 即将进行安装,是否要继续......echo.     echo ---------------------------------------------------------------------------echo."%cd%/choice.exe" /C YN /N /M "请输入 Y (继续安装)或 N (退出安装):"IF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 GOTO stIF ERRORLEVEL 2 IF NOT ERRORLEVEL 3 GOTO exPAUSE:ST:regdllecho 正在注册所需的DLL文件....regsvr32 /s "%cd%/vmappcfg.dll"regsvr32 /s "%cd%/vmappsdk.dll"regsvr32 /s "%cd%/vmdbCOM.dll"regsvr32 /s "%cd%/vmhwcfg.dll":addregecho 正在添加注册表项目...reg delete  "HKEY_LOCAL_MACHINE/SOFTWARE/VMware, Inc." /fset regadd=reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Setup%regadd%" /v "SourcePath" /d "%systemroot%/inf" /fset regadd=reg add "HKEY_LOCAL_MACHINE/SOFTWARE/VMware, Inc.%regadd%" /v Core /d "VMware Workstation" /fset regadd=%regadd%/VMware Workstation%regadd%" /v "InstallPath" /d "%cd%" /fset regadd=%regadd%/License.ws.6.0.200907%regadd%" /v "StartFields" /d "Cpt, ProductID, LicenseVersion, LicenseType, Epoch" /f%regadd%" /v "Cpt" /d "COPYRIGHT (c) VMware, Inc. 1999-2007" /f%regadd%" /v "ProductID" /d "VMware Workstation for Win32" /f%regadd%" /v "LicenseVersion" /d "6.0" /f%regadd%" /v "LicenseType" /d "User" /f%regadd%" /v "Epoch" /d "2009-7-1" /f%regadd%" /v "Hash" /d "6b3d34d9-b34f898e-2600b82e-9f65a272-44f2afe8" /f%regadd%" /v "Serial" /d "ERHUD-2RGAC-X01FZ-4MRN2" /f%regadd%" /v "Name" /d "User" /f%regadd%" /v "CompanyName" /d "@China" /f@reg  add "HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Cdrom" /v "Autorun" /d "0" /f:adduserecho 开始创建 __vmware_user__ 账户 ...net user __vmware_user__ /add /comment:"VMware User" /fullname:"__vmware_user__"net localgroup __vmware__ /add /comment:"VMware User Group"  >nulnet localgroup users __vmware_user__ /del >nulnet localgroup __vmware__ __vmware_user__ /add >nul:Start VM basic serviceecho 装载虚拟机需要基本服务 ...sc create vmx86 type= kernel start= auto binpath= "%cd%/drivers/vmx86.sys" displayname= "VMware Virtualization Driver"net start vmx86sc create VMnetuserif type= kernel start= auto binpath= "%cd%/drivers/vmnetuserif.sys" displayname= "VMware Network Application Interface"net start VMnetuserifecho 初始化完成,即将启动服务安装....choice /t 5 /c e /n /d eCALL "!)服务.cmd"@ECHO OFFCLScolor 0aGOTO MENU:MENUECHO.ECHO.                  =-=-=-=-=请选择要启动的服务项目=-=-=-=-=ECHO.ECHO.                       1  启动-本机网络服务(桥接,直接连接外网)ECHO.ECHO.                       2  启动-USB和COM服务ECHO.ECHO.                       3  启动-DHCP和NAT服务(共享上网,默认安装虚拟网卡8)ECHO.ECHO.                       4  启动-用户权限服务ECHO.ECHO.                       5  安装-本地网络ECHO.ECHO.                       6  安装-虚拟磁盘映射ECHO.ECHO.                       7     退   出ECHO.ECHO.ECHO."%cd%/choice.exe" /C 123456789 /N /M 请输入选择项目的序号:IF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 GOTO SERVICE1IF ERRORLEVEL 2 IF NOT ERRORLEVEL 3 GOTO SERVICE2IF ERRORLEVEL 3 IF NOT ERRORLEVEL 4 GOTO SERVICE3IF ERRORLEVEL 4 IF NOT ERRORLEVEL 5 GOTO SERVICE4IF ERRORLEVEL 5 IF NOT ERRORLEVEL 6 GOTO SERVICE5IF ERRORLEVEL 6 IF NOT ERRORLEVEL 7 GOTO SERVICE6IF ERRORLEVEL 7 GOTO ENDPAUSE:SERVICE1"%cd%/netcfg.exe" -l "%cd%/drivers/netbridge.inf" -c s -i vmware_bridgenet start VMNETBRIDGEGOTO MENU:SERVICE2sc create hcmon type= kernel start= auto binpath= "%cd%/drivers/hcmon.sys" displayname= "VMware hcmon"net start hcmonSC CREATE Vmparport TYPE= KERNEL BINPATH= "%cd%/drivers/VMPARPORT.SYS" GROUP= "EXTENDED BASE" DISPLAYNAME= "VMware VMparport"net start VmparportGOTO MENU:SERVICE3sc create "VMware NAT Service" start= auto  binpath= "%cd%/vmnat.exe"  depend= "VMnetuserif" displayname= "VMware NAT Service"set regadd=reg add "HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/VMware NAT Service/Parameters%regadd%" /v "ConfigPath" /d "%cd%" /fsc create VMnetDHCP start= auto  binpath= "%cd%/VMnetDHCP.exe"  depend= "VMnetuserif" displayname= "VMware DHCP Service"set regadd=reg add "HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/VMnetDHCP/Parameters%regadd%" /v "ConfFile" /d "%cd%/vmnetdhcp.conf" /f%regadd%" /v "LeaseFile" /d "%cd%/vmnetdhcp.leases" /f"%cd%/devcon.exe" -R INSTALL "%cd%/drivers/netadapter.inf" *VMnetAdapter8start /wait vnetlib -- add dhcp vmnet8start /wait vnetlib -- add nat vmnet8start /wait vnetlib -- stop natstart /wait vnetlib -- set vnet vmnet8 addr 192.168.203.0start /wait vnetlib -- stop dhcpstart /wait vnetlib -- update dhcp vmnet8start /wait vnetlib -- start dhcpstart /wait vnetlib -- update nat vmnet8start /wait vnetlib -- start natstart /wait vnetlib -- update adapter vmnet8GOTO MENU:SERVICE4sc create VMAuthdService  start= auto binpath= "%cd%/vmware-authd.exe"  depend= "vmx86" displayname= "VMware Authorization Service"net start VMAuthdServiceGOTO MENU:SERVICE5sc create VMnetDHCP start= auto  binpath= "%cd%/VMnetDHCP.exe"  depend= "VMnetuserif" displayname= "VMware DHCP Service"set regadd=reg add "HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/VMnetDHCP/Parameters%regadd%" /v "ConfFile" /d "%cd%/vmnetdhcp.conf" /f%regadd%" /v "LeaseFile" /d "%cd%/vmnetdhcp.leases" /f"%cd%/devcon.exe" -R INSTALL "%cd%/drivers/netadapter.inf" *VMnetAdapter1start /wait vnetlib -- add dhcp vmnet1start /wait vnetlib -- set vnet vmnet1 addr 10.10.10.0start /wait vnetlib -- stop dhcpstart /wait vnetlib -- update dhcp vmnet1start /wait vnetlib -- start dhcpstart /wait vnetlib -- update adapter vmnet1GOTO MENU:SERVICE6sc create vstor2 type= kernel start= auto binpath= "%cd%/VMMount/vstor2.sys" displayname= "Vstor2 Virtual Storage Driver"net start vstor2sc create vstor2-ws60 type= kernel start= demand binpath= "%cd%/VMMount/vstor2-ws60.sys" displayname= "Vstor2 WS60 Virtual Storage Driver"net start vstor2-ws60sc create vmount2 start= demand  binpath= "%cd%/VMMount/vmount2.exe"  depend= "RpcSs"  displayname= "VMware Virtual Mount Service Extended""%cd%/VMMount/vmount2.exe" /servicenet start vmount2GOTO MENU:END    

本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注职坐标系统运维之Vmware频道!


本文由 @白羽 发布于职坐标。未经许可,禁止转载。
喜欢 | 0 不喜欢 | 0
看完这篇文章有何感觉?已经有0人表态,0%的人喜欢 快给朋友分享吧~
评论(0)
后参与评论

您输入的评论内容中包含违禁敏感词

我知道了

助您圆梦职场 匹配合适岗位
验证码手机号,获得海同独家IT培训资料
选择就业方向:
人工智能物联网
大数据开发/分析
人工智能Python
Java全栈开发
WEB前端+H5

请输入正确的手机号码

请输入正确的验证码

获取验证码

您今天的短信下发次数太多了,明天再试试吧!

提交

我们会在第一时间安排职业规划师联系您!

您也可以联系我们的职业规划师咨询:

小职老师的微信号:z_zhizuobiao
小职老师的微信号:z_zhizuobiao

版权所有 职坐标-一站式AI+学习就业服务平台 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
 沪公网安备 31011502005948号    

©2015 www.zhizuobiao.com All Rights Reserved