-
Download Ubuntu
Download the Ubuntu ISO file from the official website. -
Set Up VirtualBox
- Create a new virtual machine in VirtualBox.
- Use a dynamic virtual disk (.vdi) with a maximum size (e.g., 16GB).
- Enable EFI by checking the EFI option in the system settings.
-
Install and Configure Ubuntu
- Install Ubuntu as you would normally.
- Update the system to the latest version using:
sudo apt update && sudo apt upgrade -y
-
Prepare the Disk for Booting
- Download vtoyboot.
- Decompress the archive, then run the script as root to make the disk bootable:
sudo sh vtoyboot.sh
- For additional details, refer to the vtoyboot documentation.
-
Prepare a Ventoy Disk
- Create a Ventoy disk using the official guide.
- Ensure the Ventoy partition is larger than the
.vdi
file size. - (Optional) Add extra partitions:
- Ext4 Partition: For direct usage with Ubuntu, mount later using
gnome-disks
or CLI (e.g.,/data
). - ExFAT Partition: For sharing files between OSes like Windows and Ubuntu. Windows cannot read ext4, so ExFAT is a good alternative.
- Ext4 Partition: For direct usage with Ubuntu, mount later using
-
Resize the Dynamic VDI
- In VirtualBox, go to File -> Tools -> Virtual Media Manager.
- Select your disk, right-click, and choose Resize. Increase the size as desired.
Note: Dynamic disks won’t occupy extra space until needed.
-
Copy the Disk
- Right-click the disk again and select Copy.
- Follow the wizard, choose
.vdi
, and check Pre-allocate Full Size.
Note: Choose.vhd
if it's more than 200gb (bug). refer to this link - Set the output path to the Ventoy disk and define the size.
Important: The copied size cannot exceed the source size, so resizing earlier is crucial. - rename the copied file to
[your_image].vdi.vtoy
Important: This is mandatory to make ventoy detects the file.
-
Select Boot Option in BIOS
- Restart your computer and enter the BIOS/UEFI settings.
- Select the external drive as the boot device.
-
Boot with Ventoy
- Ventoy will display a menu. Select the copied
.vdi
file to boot Ubuntu.
- Ventoy will display a menu. Select the copied
-
Resize the Partition
- Once inside Ubuntu, open
gnome-disks
and resize the current partition to its maximum size.
- Once inside Ubuntu, open
Congratulations! Your external drive is now bootable with Ubuntu installed from VirtualBox.