Booting VirtualBox VHD Files with Ventoy VToyBoot and Themes

Jarret B

Well-Known Member
Staff member
Joined
May 22, 2017
Messages
454
Reaction score
520
Credits
19,511
As I mentioned in the article on Ventoy 1.1.04, there is a method to boot from VHD files created in VirtualBox. In this article, we cover that process and themes for Ventoy.

So, I can warn you now that VToyBoot does not work with Linux Distros, but I tested it with Ubuntu 22.04 and it worked even though it was a little slow, but this was from a USB 3.0 flash drive. CentOS Stream 9 also worked very well on an SSD. I would definitely suggest using an SSD over a USB flash drive.

Create Ventoy Drive

You need a Ventoy disk to load the VHD file. Use the previous article on Ventoy 1.1.04, or a newer version, and create the disk.

Keep in mind that you’ll lose all the data on the drive, unless you are performing a Ventoy upgrade to a newer version.

Disable the 'Secure Boot' feature when installing Ventoy. If need be, install Ventoy through the Web script and disable the 'Secure Boot' in the Options. I made a Ventoy USB drive, and it enabled the 'Secure Boot' option and I had to use the Web script to reinstall after disabling it. The VHD booted fine after I disabled it.

Create the VHD

I am using VirtualBox 7.1.6, the version shouldn't matter as long as it is fairly new.

NOTE: This is kind of strange, but in my head, it seems you should not use the extension pack in the VBox Machine you create. It will be extra drivers that are not needed.

When setting up the initial machine in VirtualBox, there are important settings that you must make.

The Hard disk you create should be a 'VHD' file type and set as a fixed disk. For the Network Adapter, make it a 'Bridged Adapter'. Under the 'System' tab, check to enable the 'Enable EFI (special OSes only). If your system uses 'Secure Boot', then you can enable its option as well.

You can make other settings, such as turning off the floppy drive, setting Video Memory, etc. Just make sure you enable the proper settings that are required.

Once you have set these choices, you can start the Virtual Machine and install the OS. In my case, I used 'ubuntu-22.04-desktop-amd64.iso' as my installation image. Install the OS as normal and perform updates. You can also install any other software you may want for the image. Just keep in mind the size of the VHD you created. The size of the VHD must be smaller than your USB drive that you're using to boot Ventoy.

VToyBoot

Now, we need to prepare the Ventoy boot drive to allow for the booting of a VHD image.

We need to download the VToyBoot.sh script file and other files needed. Go to the following website:

Code:
https://github.com/ventoy/vtoyboot/releases

Here, we want to download the file 'vtoyboot-1.0.36.iso'. Check the website and not completely depend on the link, since the file may be a newer version.

Once you download the ISO file, you need to mount it or open it for extraction. After extraction, a folder named 'vtoyboot-1.0.36', or another name if the version is different, should exist. Inside this folder is a compressed file named 'vtoyboot-1.0.36.tar.gz'. You can right-click and extract it, but this will take more effort, so use a terminal to run:

Code:
tar -xvf vtoyboot-1.0.36

After this final extraction, a folder with the name 'vtoyboot-1.0.36' should exist. Inside this folder is what we are after. There are two folders named 'distros' and 'tools'. Copy these two folders to the root of the 'Ventoy' USB disk in the 'Ventoy' partition. Of course, you will also need to download the above file on the Host machine to have access to the USB drive for the two folders. You need the script file inside the Virtual Machine. In this manner, we will not need to install the Guest Additions in the VHD.

VToyBoot Script

After you have updated the Virtual Machine in the VHD file, you need to run the following from the extracted location:

Code:
sudo sh ./vtoyboot.sh

After entering your password, if needed, you’re prompted that the system is prepared and it informs you when the process is accomplished. Shutdown the Virtual Machine.

In 'Oracle VirtualBox Manager', select the machine you have just prepared in the left pane. Right-click and select 'Show in File Manager'. A window should open that includes the VHD file. You need to copy this file to the Ventoy USB drive.

After the copy is complete, you need to rename the file and add the new extension of '.vtoy' to the end of the filename. Renaming the file is very important or else it is not listed on the menu after booting.

Themes

When Ventoy boots up, the menu looks very generic. We can fix this by adding a theme. The themes are the same one used by GRUB. I wrote an article on creating GRUB Themes found here.

You can simply download themes from various sites, including 'www.gnome-look,org'. In the left-pane, select 'GRUB Themes' and you should see some listed in the right-pane. If you want very nice ones, then click on the 'Rating' tab to see those that are highly rated.

Once you have a theme you like, you can extract it into a folder and copy it to the Ventoy Drive.

Now, you need to start 'Ventoy Plugson' and open a web browser to '127.0.0.1:24681'. In the left-pane, click on 'Theme Plugin'. For 'Option Setting', click on '+ Add' to add a theme. In the window that pops up, you need to enter the path to the 'theme.txt' file included in the folder you copied to the drive. For an example, mine is '/media/jarret/Ventoy/Theme/theme.txt'. This is the absolute path to the mounted drive, folder and file. If you have multiple themes on the drive, you can specify to use one randomly or set a specific one as default.

Once you have any changes made, just close the web browser and you can reboot to see the new theme you set up.

Conclusion

Ventoy is finicky about which distros will work as a VHD. Just because you can make a VHD file of a specific distro does not mean it will work. If you have issues, use one distro that you know does work to be sure you have made the Ventoy drive properly, and all is working.

Sometimes, this may be a trial-and-error thing to get a distro working. Keep in mind that if you change anything that will update the 'initramfs' file, then you need to rerun the 'vtoyboot.sh' from inside the VHD before you restart or the VHD may not boot properly again. The update of the 'initram' will occur anytime you perform an update. This is technically a system with persistence as well, with no need a persistence file.

One last tip, use an external SSD instead of a USB drive. After switching to an SSD, the VHD booted just as fast as the distro on my internal NVMe drive.

The Themes may also be a trial and error to find one you like, or you can change an existing one. You can even create your own.

Have fun with Ventoy.
 


Follow Linux.org

Staff online

Members online


Latest posts

Top