Sometimes you work with your team on the same project but using different virtual environments such as VirtualBox on one side and Hyper-V on the other.
In my case I have used Hyper-V on Windows while my colleagues were using VirtualBox. Here next I’d like to provide you with some tips how to launch VirtualBox VM on Hyper-V environement.
Things you should prepare before do a convertion:
- ISO image file of a system installed on the VM.
- VirtualBox VHD file with installed OS on it. In case your system is installed on VDI, you can easily convert it to VHD using VirtualBox manager tool. Try this link to find how to do this.
- Hyper-V installed.
First you should convert you VHD disk to Hyper-V VHD or VHDX. To do this we’ll use a PowerShell:
This will convert and prepare your disk for Hyper-V environement. While converting you’ll see following screen
While disk is converting, create new Virtual Machine in Hyper-V manager. When options to work with disk are proposed (crete new one, attach existing one or add later) select “Add disk later”. You will attach converted disk later to new created virtual machine.
Once converted you can proceed to the second step.
You should attach new converted disk to new created Virtual Machine. To do this:
- Open Hyper-V manager.
- Select new created Virtual Machine
- On the right pane select “Settings”
- In new pop-up window find “IDE Controller 0”
- Select Hard Drive in Select menu
- Click add to add new disk
- Select “Virtual hard disk” radio button
- Browse for new converted vhd disk
- Click Apply to save changes. Do not close the settings window as we need to proceed with it.
- In “IDE Controller 1” select DVD drive
- Select “Image file” and browse for media file with installation files.
- Click OK to save and close the window
- Start the VM. (Note, that you should disable network of the VM as this will try to load system from network)
- Press a key when you are prompted
- Select a language, a time, a currency, a keyboard, or an input method, and then click Next.
- Click Repair your computer.
- Select the operating system that you want to repair, and then click Next.
- In the System Recovery Options dialog box, click Command Prompt.
This will open command prompt. This step is required to fix boot sector of the Windows as VirtualBox is using different type of boot from VHD.
Type three following commands:
Shutdown the VM and remove media image from DVD drive.
Start the VM. It should now start in a normal way.
Hope this helps,