ventoy / vtoyboot

Work with ventoy to support boot Linux distros in a vdisk file (vhd/vdi/raw ...)
GNU General Public License v3.0
275 stars 23 forks source link

Adapting to systemd-boot? #36

Closed polarathene closed 2 years ago

polarathene commented 2 years ago

I was looking at vtoy.sh and apart from the grub portion, I also noticed you enforce lvm or lvm2, is part of the script depending on that to work?

I am not requesting to spend effort maintaining support for systemd-boot as well, but asking if the grub support is only to configure grub?

https://github.com/ventoy/vtoyboot/blob/3f136be6a6328d78e8afec698b2744f21ce5d724/vtoyboot/distros/mkinitcpio/vtoy.sh#L54-L85

Then in other scripts with all the grub code, there is a lot going on but not easy to follow at a glance..

Are you able to briefly explain the steps taken to make the image vtoyboot compatible? (if it would be possible to adapt to systemd-boot) What does Ventoy require changed in the disk image to support booting it?

ventoy commented 2 years ago

Which distro use system-boot as the bootloader after installed to the disk?

polarathene commented 2 years ago

@ventoy I have two systems I installed with Manjaro about 2 years ago, both I switched to systemd-boot.

I used clonezilla to migrate them to virtual disks that can be booted in a VM. And thought of trying the Ventoy vDisk feature, but noticed it's GRUB only.

Investigating further, it seems to be because of a feature only grub has with mounting a loopback image file?


In my future installs, I plan to try archinstall instead of Manjaro. It defaults to systemd-boot for UEFI systems, in the past I have used some other script based installers (not official distro installers) that also offer systemd-boot as a choice.

I was just curious if you know if it is possible to boot a linux vDisk install that does not use grub in th vDisk. If it were possible, I would look more into it :+1:

ventoy commented 2 years ago

It is possiable. In fact all the process for grub is just to accomplish a purpose. That is to make the vdisk file bootable in both Legacy BIOS mode and UEFI mode.

If you use system-boot the UEFI boot loader, then it will only bootable in UEFI mode. If you can accept this (only bootable in UEFI mode) then all the grub process can be skipped.

polarathene commented 2 years ago

Yes that is fine thanks!

I will give it a try.

I noticed the ventoy data partition can be accessed with Windows VHD as D:\. Do you know if it is safe to write to while running the OS from the VHD file on that same partition? I know that there is risk of data corruption when two OS/kernel both have read/write access to a partition at the same time.. but since the file is mounted and booted as the host OS, perhaps this is safe?

polarathene commented 2 years ago

Got it working with only systemd-boot, I did not need to make any modifications to vtoyboot. Awesome project, thanks so much!


I know the docs say only support for fresh install VM, but I am confirming success with migrating my physical system this way.

I used Clonezilla to clone a laptop disk install, then I restored this with a virtual machine (create VM with empty disk and clonezilla iso for booting). Then boot the restored disk in VM, visited the github releases for vtoyboot, downloaded zip not iso, extracted the files to desktop, opened terminal and ran the script as docs instructed.

I made a mistake initially because I created a dynamic disk, but using qemu-img convert I converted to a raw img file and added this to my Ventoy disk with other ISO (adding the .vtoy suffix). That boots very well.


Maybe docs could be improved a little, as they seem to suggest grub in the vDisk install is required when it is not (only for legacy BIOS support).