Saturday, May 13, 2023

Create a Ventoy Disk Image using VirtualBox

There are already many tutorials available on the Internet for preparing a Ventoy USB stick, so how is it different this time?  Rather than answer this question, let me tell you the story behind this post.

A friend of mine called me one day and asked me to help him to reinstall Windows.  This should be easy if you have another Window machine available.  Unfortunately, the another machine he has is a Mac.  As you may already know, it is not simple to prepare a USB Window boot disk on a Mac, especially if you need to do it remotely (in this case, my friend is actually in another country) and the person you are helpful is not computer literate at all.

To cut a long story short, at the end I created a basic Ventoy installed USB drive, converted it into an image file, zipped it , sent the compressed image over the Internet to his Mac, and finally wrote it to a physical USB drive using Etcher.

Although this process works, it is some how convoluted and difficult to execute.  For instance, an image extracted from a 16GB drive may not fit another 16GB drive from another brand.  In fact, this was the problem I had.

Anyway, since then I have found a quicker way to get the image, and hence having this blog to share it with you.

Here are the steps I took for creating a basic Ventoy disk image.

1) Download a copy of the Ventoy Live CD ISO from Ventoy site (https://www.ventoy.net/en/download.html)

2) Prepare a basic virtual machine on Virtual Box.  The setting I was using are:





Ensure EFI support is required


Create a virtual machine with NO disk attached at the stage!


3) Create a virtual disk image and attached it to the USB controller of your virtual machine.  As mentioned before, a 16GB drive image may not be able to write to another branded drive with the same capacity, hence I would suggest you to create your image that is 2GB smaller than your target drive.  For example, if your drive is 16GB, then the image size should be 14GB.









As you can see, a 16GB does not have all its 16GB available to you.  Hence, it is safer to set the virtual disk size approx. 2GB less than the target drive capacity.


4) Start the VM, and follow the on screen instructions to install Ventoy onto the virtual USB drive you created in (3)



5) Turn off the virtual machine, and then open the folder where your VM files are stored by right click your VM, and select "Show In File Manager".




6) Open a command prompt, and then use the vboxmanage tool to convert the vdi to a disk image.  The command is:-

VBoxManage clonemedium --format RAW ventoy_1.vdi ventoy.img




If you are using Windows, vboxmanage may not be available under PowerShell.  In this case, type, cmd to change to CMD prompt, and try the vboxmanage command again.


7) Write the image file (ventoy.img) with your favorite imaging utility such as Etcher to a USB drive.






If you are in the similar situation like myself, who needs to write the image on a remote machine, then you may want to compress the image file before sending it over the Internet.  Since the image file is from an empty drive, the compressed file should be very compact.  In my case, it is merely 33MB which much more Internet friendly.

You may ask why didn't I do all of these on my friend's machine.  The answer is permissions.  It is often that the default VirtualBox installation needs further permissions tweaks before it can fully access the local resources.  Trying to fix the permissions with a non technical person remotely, it is challenging at best at best if not impossible.