virt-win-reg在开机虚拟可用吗
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了virt-win-reg在开机虚拟可用吗相关的知识,希望对你有一定的参考价值。
参考技术A 在QEMU/KVM的虚拟化环境中,如果想要操作Windows虚拟机的注册表,原来的理解是不可以的,最近查资料发现其实有工具可以做到的libguestfs-tools套件提供了一个基于QEMU的磁盘映像去查找这个磁盘映像中安装的Windows操作系统的具体注册表信息,甚至是进行改动(当然不安全,目前可能不成熟,可能损坏映像文件)。
这个套件目前我只在centos和redhat的虚拟化环境中找到了,具体安装方法很简单:
复制代码代码如下:
yum install libguestfs libguestfs-tools libguestfs-winsupport
安装完成之后,使用virt-win-reg既可以对已经安装操作系统的虚拟机映像文件进行注册表的读取操作,不过要注意的是目前只推荐在虚拟机停止状态下获取注册表的信息,如果在启动模式下获取注册表或者修改注册表信息都可能导致虚拟机映像文件损坏。
具体使用方法如下:
复制代码代码如下:
virt-win-reg win9-clone 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall'
其中win9-clone是虚拟机的名字,可以通过libvirt的virsh list –all命令查询得出,不过一定确保虚拟机已经是停止的状态,否则可能造成磁盘损坏。
上面的命令最终执行的结果如下:
复制代码代码如下:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall]</p> <p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AddressBook]
@=hex(1):00,00</p> <p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Branding]
"QuietUninstallString"=hex(1):52,00,75,00,6e,00,64,00,6c,00,6c,00,33,00,32,00,20,00,49,00,65,00,64,00,6b,00,43,00,53,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,42,00,72,00,61,00,6e,00,64,00,43,00,6c,00,65,00,61,00,6e,00,49,00,6e,00,73,00,74,00,61,00,6c,00,6c,00,53,00,74,00,75,00,62,00,73,00,00,00
"RequiresIESysFile"=hex(1):31,00,30,00,30,00,2e,00,30,00,00,00</p> <p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Connection Manager]
"SystemComponent"=dword:00000001</p> <p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\DXM_Runtime]</p> <p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\DirectAnimation]
@=hex(1):00,00</p> <p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\DirectDrawEx]
@=hex(1):00,00</p> <p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Fontcore]
@=hex(1):00,00</p> <p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ICW]
@=hex(1):00,00</p> <p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\IE40]
@=hex(1):00,00</p> <p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\IE4Data]
@=hex(1):00,00</p> <p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\IE5BAKEX]
@=hex(1):00,00</p> <p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\IEData]
@=hex(1):00,00</p> <p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MPlayer2]</p> <p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MobileOptionPack]
@=hex(1):00,00</p> <p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NetMeeting]
"RequiresIESysFile"=hex(1):34,00,2e,00,37,00,31,00,00,00</p> <p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OutlookExpress]
@=hex(1):00,00</p> <p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PCHealth]
"QuietUninstallString"=hex(1):72,00,75,00,6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,00,20,00,73,00,65,00,74,00,75,00,70,00,61,00,70,00,69,00,2e,00,64,00,6c,00,6c,00,2c,00,49,00,6e,00,73,00,74,00,61,00,6c,00,6c,00,48,00,69,00,6e,00,66,00,53,00,65,00,63,00,74,00,69,00,6f,00,6e,00,20,00,44,00,65,00,66,00,61,00,75,00,6c,00,74,00,55,00,6e,00,69,00,6e,00,73,00,74,00,61,00,6c,00,6c,00,20,00,31,00,33,00,32,00,20,00,43,00,3a,00,5c,00,57,00,49,00,4e,00,44,00,4f,00,57,00,53,00,5c,00,49,00,4e,00,46,00,5c,00,50,00,43,00,48,00,65,00,61,00,6c,00,74,00,68,00,2e,00,69,00,6e,00,66,00,00,00
"UninstallString"=hex(1):72,00,75,00,6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,00,20,00,73,00,65,00,74,00,75,00,70,00,61,00,70,00,69,00,2e,00,64,00,6c,00,6c,00,2c,00,49,00,6e,00,73,00,74,00,61,00,6c,00,6c,00,48,00,69,00,6e,00,66,00,53,00,65,00,63,00,74,00,69,00,6f,00,6e,00,20,00,44,00,65,00,66,00,61,00,75,00,6c,00,74,00,55,00,6e,00,69,00,6e,00,73,00,74,00,61,00,6c,00,6c,00,20,00,31,00,33,00,32,00,20,00,43,00,3a,00,5c,00,57,00,49,00,4e,00,44,00,4f,00,57,00,53,00,5c,00,49,00,4e,00,46,00,5c,00,50,00,43,00,48,00,65,00,61,00,6c,00,74,00,68,00,2e,00,69,00,6e,00,66,00,00,00</p> <p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SchedulingAgent]
@=hex(1):00,00
该命令的其他用法可以使用man virt-win-reg获取相关帮助信息,用法还是很多的哦本回答被提问者和网友采纳
fortran 虚拟参数与实际参数不匹配。铸造可用吗?
【中文标题】fortran 虚拟参数与实际参数不匹配。铸造可用吗?【英文标题】:fortran dummy argument doesn't match actual argument. casting available? 【发布时间】:2014-05-24 15:51:14 【问题描述】:我最近继承了以前使用旧版英特尔 Visual Fortran 编译器构建的 Fortran 代码。有一段代码用于编译,但现在抛出错误 #6633 'The type of the actual argument of the dummy argument.'
问题是当一个名为READ_AND_CONVERT
的函数被REAL*4
DATA_ARRAY(*)
调用时,但在READ_AND_CONVERT
中,该参数被声明为INT*2
。我想它真的只是想要DATA_ARRAY
的地址。
有没有办法传递DATA_ARRAY
的地址,即使它们属于不同类型?
这里是READ_AND_CONVERT
:
SUBROUTINE READ_AND_CONVERT (MX, N)
C=======================================================================
C Reads Integer*2 Data Array and Converts it to Real*4.
C
C This is a service routine called by subroutines
C READ_XYZ_2, READ_XYZ_4, READ_XYZ_ALL and READ_XYZ_FULL
C=======================================================================
C
IMPLICIT NONE
C
INCLUDE 'XYZ.FOR'
INCLUDE 'COMMON_XYZIO.FOR'
INCLUDE 'COMMON_HDR.FOR'
C
C-----------------------------------------------------------------------
C Local Parameters
C-----------------------------------------------------------------------
C
LOGICAL BB_FOUND
INTEGER*2 MX, MY
INTEGER*4 N, J
REAL*4 YJ, BB
C
DIMENSION MX(*), MY(2)
EQUIVALENCE (YJ, MY(1))
C
C-----------------------------------------------------------------------
C
CALL GET_REAL_PARAMETER ('XYZ$_OFFSET', BB, BB_FOUND)
C
READ (LUGIN) (MX(J), J = 1,N)
C
IF (BB_FOUND) THEN
DO J = N, 1, -1
YJ = (SCALE_FACTOR * MX(J)) + BB
MX(2*J) = MY(2)
MX(2*J-1) = MY(1)
END DO
ELSE
DO J = N, 1, -1
YJ = SCALE_FACTOR * MX(J)
MX(2*J) = MY(2)
MX(2*J-1) = MY(1)
END DO
END IF
C
RETURN
END
【问题讨论】:
您确实需要更好地标记您的问题以获得一些关注。即使订阅了 [fortran*],我也没有听懂。 intel-fortran的粉丝只有41个,fortran的粉丝只有1500个。 【参考方案1】:找到解决方案here: 基本上禁用警告...通过设置属性 | Fortran |诊断 |检查例程接口 [从是更改为否]
文章还展示了如何进行强制转换,在他们的复数数组到实数数组的例子中:
use ISO_C_BINDING
complex(8), allocatable :: c(:)
real(8), pointer:: p(:)
allocate(c(N))
call C_F_POINTER(C_LOC(c), p, [2*N])
call donothing(N, p)
【讨论】:
【参考方案2】:英特尔 Fortran 中有一些指令禁用给定例程和给定参数的参数类型检查。禁用对所有代码的检查是危险的!
!DEC$ ATTRIBUTES NO_ARG_CHECK :: ARGUMENT_NAME
来源:https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/288896
【讨论】:
以上是关于virt-win-reg在开机虚拟可用吗的主要内容,如果未能解决你的问题,请参考以下文章
可以把VM虚拟机的那几个开机启动项禁止吗 会不会影响虚拟机使用 总觉得那虚拟机影响电脑速度
这个是虚拟机安装的黑苹果,然后开机这个提示怎么回事。谢谢大家了!