為了測試舊系統,找了Virtual Server時代保留的古董VM Disk Image,掛在Hyper-V後卻發現狀況。

安裝Hyper-V VM Additions時,會先彈出需先移除Virtual Server版本Virtual Machine Additions的訊息,但試著反安裝時,卻又彈出This installer may only be run inside of a virtual machine的錯誤訊息。移不掉又裝不成,這下糗了。

常見的建議解法是去找一台VPC或Virtual Server,把VHD複製過去掛起來,移除VM Additions後關機,再把VHD搬回來重新掛回Hyper-V。但愚公移山法一點都不酷,不像駭客的行事風格,就像真的要做也得偷偷來,不然傳出去肯定成為駭客社群的笑柄。

所幸,爬文找到一招修改Virtual Machine Addtion Installer的密技,要用工具偷改MSI,比較符合我鍾愛的駭客路線,就決定這麼幹了。

先在C:\Windows\Installer找到安裝檔,安裝檔都被更名為隨機檔名,印象中VM Additions的安裝程式約14MB,並不難找。

我沒用文章提的MSI編輯工具(InstEd),而是用另一套過去用過的Orca MSI Editor來修改msi檔案(可見這種勾當也不是第一次幹了)。

總共要移除

  • ControlEvent: InstallWelcome/InstallNow/CA_IsRunningInsideVirtualMachine
  • ControlEvent: InstallWelcome/InstallNow/CA_CheckIfWeCanInstall
  • ControlEvent: ReadyToInstall/InstallNow/CA_IsRunningInsideVirtualMachine
  • ControlEvent: ReadyToInstall/InstallNow/CA_CheckIfWeCanInstall
  • CustomAction: CA_IsRunningInsideVirtualMachine

儲存msi檔後重新執行,這次它不再抱怨必須在Virtual Machine環境下執行,默默把Addtions移除。就可以安裝Hyper-V版的VM Additions囉!

為駭客精神按一個【讚】~~


Comments

Be the first to post a comment

Post a comment