微软私有云分享(R2)3-部署虚拟机默认是美国?

发布于 2014-05-07  424 次阅读


可能只有接触过System Center 2012 R2和SCVMM2012/ R2的朋友才会发现,部署出来的虚拟机的国家、区域都是美国、英国,总之绝对不是中国

当然刚开始你可能会觉得没啥问题,不就是区域不一样,改成中国就行了么?事实上在装国内的一些软件的时候,会出现乱码的……

究其原因,主要是区域不是中国,一般会采用UTF-8来编码,而不是国内用的GB2312(国标威武),那么国内的中文软件也都会以GB2312来编码,但是国际上不是这样啊。

不管使用到System Center 2012 R2的微软私有云会有这个问题,在微软桌面虚拟化VDI中,也会遇到这个问题,部署出来的虚拟机(比如Windows8)默认是英文,这在国内使用是有多坑爹是可想而知了。

事实上用这些软件的人还是海外大拿居多,他们在设计之初可能也没想过中国人用这些东西会怎么样,不过这并不是说这种问题不能解决,而是说默认情况下,解决不了。

说到修改操作系统默认区域和语言,就得说道Sysprep和系统封装了。我们用的WDS以及网吧电脑城常用的ghost都可能会用到Sysprep,它会抽象化一些标准信息,只有在Sysprep阶段才可以修改区域和语言,这样部署出来的操作系统才能是原生中文。通过SCVMM2012 R2(早期版本也会如此)部署的虚拟机在部署完成后,修改国家和区域之后,安装多数软件仍会乱码

解决方法很简单,在"VM模板"中,我们调整这样一个属性,"应答文件"

应答文件是怎么产生的呢?是通过Windows System image manager 做出来的,在windows7以上的操作系统中,它是一个xml文件。

Windows System image manager又是从哪里来的呢?事实上安装SCVMM2012 R2的时候,自动就可以得到这个工具,它伴随SCVMM2012 R2的必备组件ADK一起出现。

关于应答文件的编写这里不过多废话,写这个文件比较费劲,关于如何写这个东西可能能写出几万字出来。

将下面的代码保存为.xml文件,上传至库服务器,然后在"VM模板"中调用,就可以解决操作系统默认语言和区域不是中文的问题了,同时这个脚本还会关闭所有防火墙。

<?xml version="1.0" encoding="utf-8"?>

<unattend xmlns="urn:schemas-microsoft-com:unattend">

   <servicing></servicing>

   <settings pass="specialize">

       <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

           <fDenyTSConnections>false</fDenyTSConnections>

       </component>

       <component name="Networking-MPSSVC-Svc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

           <DomainProfile_EnableFirewall>false</DomainProfile_EnableFirewall>

           <PrivateProfile_EnableFirewall>false</PrivateProfile_EnableFirewall>

           <PublicProfile_EnableFirewall>false</PublicProfile_EnableFirewall>

       </component>

       <component name="Microsoft-Windows-TerminalServices-RDP-WinStationExtensions" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

           <UserAuthentication>0</UserAuthentication>

       </component>

       <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

           <StartTiles>

               <RegionalOverrides>

                   <RegionalOverride wcm:action="add">

                       <Regions>

                           <Region wcm:action="add">

                               <Key>2</Key>

                               <CountryOrRegionID>CN</CountryOrRegionID>

                           </Region>

                       </Regions>

                       <Order>2</Order>

                   </RegionalOverride>

               </RegionalOverrides>

           </StartTiles>

       </component>

   </settings>

   <settings pass="windowsPE">

       <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

           <UILanguage>zh-CN</UILanguage>

           <UILanguageFallback>zh-CN</UILanguageFallback>

           <UserLocale>zh-CN</UserLocale>

           <InputLocale>0804:00000409</InputLocale>

           <SystemLocale>zh-CN</SystemLocale>

       </component>

       <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

           <UserData>

               <AcceptEula>true</AcceptEula>

           </UserData>

       </component>

   </settings>

   <settings pass="oobeSystem">

       <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

           <UILanguageFallback>zh-CN</UILanguageFallback>

           <InputLocale>0804:00000409</InputLocale>

           <UILanguage>zh-CN</UILanguage>

           <SystemLocale>zh-CN</SystemLocale>

           <UserLocale>zh-CN</UserLocale>

       </component>

   </settings>

   <cpi:offlineImage cpi:source="catalog:c:/users/zpl/desktop/cn_windows_server_2012_vl_x64_dvd_917962/sources/install_windows server 2012 serverdatacenter.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />

</unattend>

原创文章,转载请注明: 转载自奶油九叔

本文链接地址: 微软私有云分享(R2)3-部署虚拟机默认是美国?