无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站投放广告、加入VIP会员,请联系 微信:wuyouceo
查看: 15207|回复: 48
打印 上一主题 下一主题

【高手请进,把老外的技术搞到手!】在WinPE上运行VMware!

[复制链接]
跳转到指定楼层
1#
发表于 2008-2-18 10:42:28 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本人尝试多次,在winpe上运行VMware workstation,不管是完整版,精简绿色版都会报错,上网查了N多资料,没有可行的办法,
在这里有For BartPE的vmware Plugin:http://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 from
Ram-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 upto
HKLM\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.inf

VMware is launched by running vmware.cmd

===============================================================================
还有这里:http://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.

===============================================================================

[ 本帖最后由 adoijay 于 2008-2-18 11:35 AM 编辑 ]

vmware on bartPE.jpg (117.33 KB, 下载次数: 93)

运行截图

运行截图
2#
发表于 2008-2-18 10:51:46 | 只看该作者
如果不是組網的需要,還是用VPC更為精簡
回复

使用道具 举报

3#
 楼主| 发表于 2008-2-18 11:02:52 | 只看该作者
本人觉得既然要用虚拟化,就要用最好的软件,就目前来讲VPC还是难以企及VMware的,无论是虚拟层运行的效率,还是虚拟层实现的功能,vmware都是更胜一筹,不说别的就光是如何把vmware运行在WinPE下就很有技术研究的价值!

vmware on bartPE 5.jpg (142.08 KB, 下载次数: 84)

运行截图

运行截图
回复

使用道具 举报

4#
 楼主| 发表于 2008-2-18 11:27:48 | 只看该作者

高手请进,把老外的技术搞到手!

刚下载到一段国外高手在BartPE上运行VMware的录像,高手们看看他是如何实现的!把老外的技术搞到手!
录像下载:论坛的附件太小了,发在网络硬盘里,swf格式录像
http://www.fs2you.com/files/c73a2105-ddd1-11dc-a624-0014221f3995/
回复

使用道具 举报

5#
发表于 2008-2-18 11:49:34 | 只看该作者
PE为了精简及更加有效的运行目的功能,会对很多东西进行精简
你看下VM绿色版本的绿化程序就知道了。。。。

--很显然为了运行VM,需要让PE进行很多倒退

@shift 1
@echo off
CLS
color 0a
echo.
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 st
IF ERRORLEVEL 2 IF NOT ERRORLEVEL 3 GOTO ex
PAUSE


:ST

:regdll
echo 正在注册所需的DLL文件....
regsvr32 /s "%cd%/vmappcfg.dll"
regsvr32 /s "%cd%/vmappsdk.dll"
regsvr32 /s "%cd%/vmdbCOM.dll"
regsvr32 /s "%cd%/vmhwcfg.dll"

:addreg
echo 正在添加注册表项目...
reg delete  "HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc." /f
set regadd=reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup
%regadd%" /v "SourcePath" /d "%systemroot%\inf" /f
set regadd=reg add "HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.
%regadd%" /v Core /d "VMware Workstation" /f
set regadd=%regadd%\VMware Workstation
%regadd%" /v "InstallPath" /d "%cd%" /f
set 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

:adduser
echo 开始创建 __vmware_user__ 账户 ...
net user __vmware_user__ /add /comment:"VMware User" /fullname:"__vmware_user__"
net localgroup __vmware__ /add /comment:"VMware User Group"  >nul
net localgroup users __vmware_user__ /del >nul
net localgroup __vmware__ __vmware_user__ /add >nul

:Start VM basic service
echo 装载虚拟机需要基本服务 ...
sc create vmx86 type= kernel start= auto binpath= "%cd%\drivers\vmx86.sys" displayname= "VMware Virtualization Driver"
net start vmx86
sc create VMnetuserif type= kernel start= auto binpath= "%cd%\drivers\vmnetuserif.sys" displayname= "VMware Network Application Interface"
net start VMnetuserif
echo 初始化完成,即将启动服务安装....
choice /t 5 /c e /n /d e
CALL "!)服务.cmd"
@ECHO OFF
CLS
color 0a

GOTO MENU
:MENU
ECHO.
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 SERVICE1
IF ERRORLEVEL 2 IF NOT ERRORLEVEL 3 GOTO SERVICE2
IF ERRORLEVEL 3 IF NOT ERRORLEVEL 4 GOTO SERVICE3
IF ERRORLEVEL 4 IF NOT ERRORLEVEL 5 GOTO SERVICE4
IF ERRORLEVEL 5 IF NOT ERRORLEVEL 6 GOTO SERVICE5
IF ERRORLEVEL 6 IF NOT ERRORLEVEL 7 GOTO SERVICE6
IF ERRORLEVEL 7 GOTO END
PAUSE

:SERVICE1
"%cd%\netcfg.exe" -l "%cd%\drivers\netbridge.inf" -c s -i vmware_bridge
net start VMNETBRIDGE
GOTO MENU

:SERVICE2
sc create hcmon type= kernel start= auto binpath= "%cd%\drivers\hcmon.sys" displayname= "VMware hcmon"
net start hcmon
SC CREATE Vmparport TYPE= KERNEL BINPATH= "%cd%\drivers\VMPARPORT.SYS" GROUP= "EXTENDED BASE" DISPLAYNAME= "VMware VMparport"
net start Vmparport
GOTO MENU

:SERVICE3
sc 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%" /f
sc 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" *VMnetAdapter8
start /wait vnetlib -- add dhcp vmnet8
start /wait vnetlib -- add nat vmnet8
start /wait vnetlib -- stop nat
start /wait vnetlib -- set vnet vmnet8 addr 192.168.203.0
start /wait vnetlib -- stop dhcp
start /wait vnetlib -- update dhcp vmnet8
start /wait vnetlib -- start dhcp
start /wait vnetlib -- update nat vmnet8
start /wait vnetlib -- start nat
start /wait vnetlib -- update adapter vmnet8
GOTO MENU

:SERVICE4
sc create VMAuthdService  start= auto binpath= "%cd%\vmware-authd.exe"  depend= "vmx86" displayname= "VMware Authorization Service"
net start VMAuthdService
GOTO MENU

:SERVICE5
sc 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" *VMnetAdapter1
start /wait vnetlib -- add dhcp vmnet1
start /wait vnetlib -- set vnet vmnet1 addr 10.10.10.0
start /wait vnetlib -- stop dhcp
start /wait vnetlib -- update dhcp vmnet1
start /wait vnetlib -- start dhcp
start /wait vnetlib -- update adapter vmnet1
GOTO MENU

:SERVICE6
sc create vstor2 type= kernel start= auto binpath= "%cd%\VMMount\vstor2.sys" displayname= "Vstor2 Virtual Storage Driver"
net start vstor2
sc create vstor2-ws60 type= kernel start= demand binpath= "%cd%\VMMount\vstor2-ws60.sys" displayname= "Vstor2 WS60 Virtual Storage Driver"
net start vstor2-ws60
sc create vmount2 start= demand  binpath= "%cd%\VMMount\vmount2.exe"  depend= "RpcSs"  displayname= "VMware Virtual Mount Service Extended"
"%cd%\VMMount\vmount2.exe" /service
net start vmount2
GOTO MENU
:END
回复

使用道具 举报

6#
 楼主| 发表于 2008-2-18 12:06:54 | 只看该作者
就是这个绿色版的vmware,在WinPE下是运行不起来的,在正常的XP下能运行,
  我们不讨论 WinPE是否会变慢,就像安装应用软件后会使系统变慢一样,不可能因为系统会变慢我们就不装软件是吧!
  我们想要实现的目标是:WinPE+VMware,打造成一个 VM-LiveCD/LiveUSB,使用它能到处启动机子,无论原来有没有安装虚拟化软件,
  都可以迅速到达虚拟环境,它有以下作用:
  1、灾难恢复
  2、P2V
  3、Common Virtual Environment

[ 本帖最后由 adoijay 于 2008-2-18 12:48 PM 编辑 ]

VM-LiveCD.jpg (39.05 KB, 下载次数: 89)

VM-Livecd

VM-Livecd
回复

使用道具 举报

7#
发表于 2008-2-18 12:43:04 | 只看该作者
我们想要实现的目标是:VMware+WinPE

反了吧

--一
回复

使用道具 举报

8#
 楼主| 发表于 2008-2-18 12:48:39 | 只看该作者
谢谢 secowu  提醒,已修改
回复

使用道具 举报

9#
发表于 2008-2-18 16:03:19 | 只看该作者
PE上运行虚拟机?我早就实现了呀?只不过不是这个版本的。
回复

使用道具 举报

10#
发表于 2008-2-18 16:04:08 | 只看该作者
PE下运行会出现功能不能实现的情况的。
回复

使用道具 举报

11#
发表于 2008-2-18 16:18:33 | 只看该作者
在PE上运行这个东东直接下载了绿色版就行了

不过本人实在觉得在PE系统运行虚拟机有点没事找事的紧o(∩_∩)o...


我闪
回复

使用道具 举报

12#
发表于 2008-2-18 19:26:34 | 只看该作者
用PE就能做到的事,干嘛还要硬插个VMware到其中,枉费那么多的内存。
回复

使用道具 举报

13#
发表于 2008-2-18 21:10:28 | 只看该作者
PE上运行虚拟机?我早就实现了呀?只不过不是这个版本的
回复

使用道具 举报

14#
发表于 2008-2-19 00:04:23 | 只看该作者
我已經做出 vmware workstation 6.0.2 的 plugin for BartPE+XPE 。

請看 http://bbs.wuyou.net/forum.php?mod=viewthread&tid=120481&highlight=%2Bhodgestructure

我沒辦法給出完整的 plugin,只能給出 .inf 檔。

因為檔案太多,太大了,而且我不會做 Get_file.cmd檔。

有意幫我做一個 Get_file 檔的,我可以把我的檔案 list 貼上來。
回复

使用道具 举报

15#
发表于 2008-2-19 00:07:16 | 只看该作者
忘了說,如果有人可以教我怎麼做 Get_file.cmd 是最理想的,這樣我以後就不用都麻煩別人了。
回复

使用道具 举报

16#
发表于 2008-2-19 00:50:42 | 只看该作者
这是VMware6的初始化批处理,在pe中一样可用

VMware Workstation v6.0 绿色精简中文版下载地址http://www.crsky.com/soft/1863.html

VMware_NAT.rar

1.35 KB, 下载次数: 306, 下载积分: 无忧币 -2

回复

使用道具 举报

17#
发表于 2008-2-19 01:27:07 | 只看该作者
恩,有待研究啊~~~
回复

使用道具 举报

18#
发表于 2008-2-20 00:46:01 | 只看该作者
高手云集,问题一定能解决~~~~~~
不过我暂时还想不出在PE里运行虚拟机的用处。可能我的使用范围比较小吧。
回复

使用道具 举报

19#
发表于 2008-2-20 03:12:27 | 只看该作者
有什么现实意义呢?一时想不到...
回复

使用道具 举报

20#
 楼主| 发表于 2008-2-20 19:46:14 | 只看该作者
多谢玄天 提供的 vmware 初始化脚本,已经证实这个脚本是有效的,只是还有点小问题,但是能运行VMware wks 6,见截图

PE下运行VMware6.JPG (132.21 KB, 下载次数: 56)

PE下运行VMware6.JPG
回复

使用道具 举报

21#
发表于 2008-2-26 10:48:55 | 只看该作者
顶了

现在研究的是vmware+WINPE+vmware

有些功能这样搭配很合适

在vmware里试验 WINPE+vmware
回复

使用道具 举报

22#
发表于 2008-2-26 10:49:14 | 只看该作者
期待各位的成果!!!!!!
回复

使用道具 举报

23#
发表于 2008-2-26 11:27:28 | 只看该作者
还是绿色版好一些。。
回复

使用道具 举报

24#
发表于 2008-2-26 13:59:18 | 只看该作者
没试过,不知道能不能用
回复

使用道具 举报

25#
发表于 2008-2-26 18:12:33 | 只看该作者
当然有用!!极有用!!我可以在vmware 里的xp 系统里装上我平时用的所有软件(我用8G或是更大的U盘),这样我出差在外的时候,只要有电脑运行PE,打开VMware 就可以用我设置好的XP,直接用我的业务软件。这样就不必因为我的业务软件不能在PE下用感觉烦了。
另外,这个PE可以不必加外置的程序,所有外置程序可以装在vm ware下的XP上,
严重关注!!!
我一直在找这样的PE,只可惜我不懂编程,只能等高手们的PE
回复

使用道具 举报

26#
发表于 2008-2-26 18:15:47 | 只看该作者
我的U盘下有vm ware 下的XP,我还可以在别的电脑的XP下用,不用在别人电脑上设置,
也不用在我下边的工厂安装我的外贸软件,这是最大的用处,更不用怕别的电脑的安全性不好,
我会把自己的XP防护做得很好。
总之,可以实现一张U盘下使用任何操作系统和相应的业务软件!!!
这应该是重大的技术突破!!!
回复

使用道具 举报

27#
发表于 2008-2-26 19:19:10 | 只看该作者
偶回去也试一下。顶了。
回复

使用道具 举报

28#
发表于 2008-2-26 19:19:16 | 只看该作者
这门技术在很久之前看过了, 是网友sanbarrow开发的.

看懂英文的就去作者的网站看看吧:
http://sanbarrow.com/
回复

使用道具 举报

29#
发表于 2008-2-26 23:04:19 | 只看该作者

回复 #20 adoijay 的帖子

这个脚本是XP下共享宽带的初始化文件,没有结果修改,现附是全部脚本(公用组件/共享上网/路由上网(局域网)的脚本,自己根据需要作适当修改就行了

VMware 初始化脚本.rar

4.45 KB, 下载次数: 195, 下载积分: 无忧币 -2

回复

使用道具 举报

30#
发表于 2008-3-20 02:33:09 | 只看该作者
用了楼上的脚本,还是无法启动vm6,哪位高手完美实现的

请给出详细步骤

试验了多个pe,vm的组合都不成?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-12-5 11:00

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表