WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • Apple
You are here: Home / ESXi / Converting VirtualBox VDI (Virtual Disk Image) to VMDK for use with ESXi 8.x

Converting VirtualBox VDI (Virtual Disk Image) to VMDK for use with ESXi 8.x

05.31.2023 by William Lam // Leave a Comment

If you are converting an Oracle VirtualBox VDI (Virtual Disk Image) to a VMDK for use with VMware ESXi, you might come across the following error:

Unsupported or invalid disk type 2 for 'scsi0:0'. Ensure that the disk has been imported


The invalid disk type 2 is typically a giveaway that the VMDK was mostly likely converted to a format that is only understood by a VMware Type 2 Hypervisor (Fusion/Workstation/Player) rather than ESXi which is a VMware Type 1 bare-metal Hypervisor.

Luckily, there is a straight forward way to convert the existing VMDK into the format that ESXi understands!

Note: While VirtualBox does offer an export appliance option which produces an OVA (Open Virtualization Archive), it fails to properly import into a VMware environment 🙁 and hence the need to work directly with the VDI images.

Step 1 - Shutdown the VirtualBox VM and open a terminal as we will need to use the vboxmanage CLI

Step 2 - We need to clone each existing VDI image to the initial VMDK format by running the following command:

vboxmanage clonemedium rocky-linux-from-virtualbox.vdi --format=VMDK --variant=ESX rocky-linux-from-virtualbox-original.vmdk

Step 3 - Use either the vSphere Datastore browser or SCP the VMDK(s) to the desintation ESXi host

Step 4 - SSH to the ESXi host and we will use the vmkfstools to convert from the original VMDK format to one that ESXi understands by using the following command:

vmkfstools -i rocky-linux-from-virtualbox-original.vmdk -d thin rocky-linux-from-virtualbox.vmdk

Once the conversion has completed, you should confirm that VM can successfully boot in the next step before deleting the original VMDK(s) as they are no longer needed.

Step 5 - Finally, create the new destination VM in ESXi and attach the newly converted VMDK(s). It is also important before you complete the VM wizard, that you confirm the firmware type that was used whether it is BIOS or EFI and properly configure that under VM Options->Boot Options before creating the VM or it will not boot properly.


Note: You may also need to modify the default storage adapter based on the OS you have installed.

In using the latest VirtualBox 7.0 release to install the latest Rocky Linux distribution, I found that BIOS firmware was default and I simply mirrored that in ESXi VM and successfully allowed me to power on. If you went with the default ESXi VM for Rocky Linux, which is EFI firmware, then you will need to re-create the VM (especially important when using ESXi 8.x due to this VM firmware behavior change) and make sure you detach the VMDK before deleting the VM or you will need to go through the clone and conversion process again.

More from my site

  • Support for read-only VMDK in vSphere 8.0 Update 2
  • Creating a custom VIB for ESXi 8.x
  • Google Coral USB Edge TPU Accelerator on ESXi
  • USB Network Native Driver Fling for ESXi 8.0 Update 1
  • Auditing vSphere Datastore activities (Download, Upload, Copy, Move, Rename and Delete)

Categories // ESXi Tags // ESXi 8.0, VirtualBox, vmdk

Thanks for the comment!Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC) across Private, Hybrid and Public Cloud

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • ESXi on Lenovo ThinkStation P3 Ultra 09/29/2023
  • Quick Tip - vSphere 7.0 Update 3o also supports disabling/enabling vSphere Cluster Services (vCLS) in vSphere UI 09/29/2023
  • Heads Up - New image identifier required by VM Service in vSphere 8.0 Update 2 09/27/2023
  • How to setup private GitLab on a Synology for Project Keswick? 09/26/2023
  • ESXi on SimplyNUC Moonstone 09/25/2023

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2023

 

Loading Comments...