Jump to content











Photo
- - - - -

Linux from VHD How To?

linux windows boot vhd image-file howto

  • Please log in to reply
189 replies to this topic

#126 ventoy

ventoy

    Member

  • Members
  • 84 posts
  •  
    China

Posted 22 January 2021 - 03:25 PM

I have made in VirtualBox file Ubuntu.vdi.vtoy according to description and copied file Ubuntu.vdi.vtoy to NTFS drive (= 2nd partition of SSD USB)

 

Where must file vdiskchain be located ? I don't understand How to use vdiskchain.

 

Same location as grub.cfg which is in grub folder on FAT32 Boot drive (= 1st partition of SSD USB) ?

 

anywhere. As follows:

chainloader  (hd0,1)/vdiskchain  vdisk=/MyDir/Ubuntu.vdi.vtoy

chainloader  (hd1,2)/abc/vdiskchain  vdisk=/MyDir/Ubuntu.vdi.vtoy

vdisk parameter is the full path of you vtoy file (only path from root. Don't include something like  (hd0,1) (hd1,1) ..... )

It will use grub2's  search command to find the partition for vdisk, so make you vdisk fullpath unique in your system.


  • wimb likes this

#127 Vortex

Vortex

    Frequent Member

  • Advanced user
  • 299 posts

Posted 22 January 2021 - 04:20 PM

Hi ventoy,

 

Thanks for your work. Is it possible to boot a CentOS 6 setup inside a .vdi file with vdiskchain?



#128 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 22 January 2021 - 10:31 PM

@ Vortex

 

For a list of Supported Linux Distros see: https://www.ventoy.n...n_vtoyboot.html

 

CentOS 7 and 8 are included on that list, so you better update yours, to a more recent version.

 

alacran



#129 ventoy

ventoy

    Member

  • Members
  • 84 posts
  •  
    China

Posted 23 January 2021 - 08:49 AM

Hi ventoy,

 

Thanks for your work. Is it possible to boot a CentOS 6 setup inside a .vdi file with vdiskchain?

 

NO. CentOS 6 is not supported.  CentOS7/8 is supported.



#130 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 23 January 2021 - 09:04 AM

anywhere. As follows:

chainloader  (hd0,1)/vdiskchain  vdisk=/MyDir/Ubuntu.vdi.vtoy

chainloader  (hd1,2)/abc/vdiskchain  vdisk=/MyDir/Ubuntu.vdi.vtoy

vdisk parameter is the full path of you vtoy file (only path from root. Don't include something like  (hd0,1) (hd1,1) ..... )

It will use grub2's  search command to find the partition for vdisk, so make you vdisk fullpath unique in your system.

 

Thank you and using also your description   :) - vdiskchain is working OK to boot Ubuntu.vhd.vtoy from SSD USB in UEFI Secure mode and in MBR mode.

 

In my case files vdiskchain and ipxe.krn are located in grub rootfolder of FAT32 USB Boot drive and Ubuntu.vhd.vtoy is located on NTFS drive of portable SSD USB.

 

\grub\grub.cfg menu entries were used

if [ "${grub_platform}" == "efi" ]; then

  menuentry "Ubuntu.vhd.vtoy - /grub/vdiskchain" {
    chainloader /grub/vdiskchain vdisk=/Ubuntu.vhd.vtoy
  }

else

  menuentry "Ubuntu.vhd.vtoy - /grub/vdiskchain" {
    linux16  /grub/ipxe.krn vdisk=/Ubuntu.vhd.vtoy
    initrd16 /grub/vdiskchain
  }

fi

-

Also in MBR mode direct booting  with Grub4dos is working OK

 

\menu.lst entry

title Ubuntu.vhd.vtoy - /grub/vdiskchain
kernel /grub/ipxe.krn vdisk=/Ubuntu.vhd.vtoy
initrd /grub/vdiskchain

Very good that Ubuntu 64-bit Linux in VHD file is bootable from USB in UEFI Secure mode using Grub2 and in MBR mode using Grub2 or Grub4dos  :)

 

It allows Multi-Boot of Windows and Linux VHD in an easy way without the need to change partitioning of your computer.

I have modified my internal hidden EFI drive to boot in UEFI Secure mode with Grub2 and use vdiskchain to boot Ubuntu VHD located on internal GPT NTFS drive.

Nice thing is that the WARNING with 10 seconds delay does not occur when booting from internal SSD in UEFI Secure mode with Ubuntu VHD  :)

 

For Ubuntu this procedure is working OK, but for Kali Linux 64-bit Installer

the Kali Linux VHD prepared with VirtualBox fails to boot in UEFI Secure mode from internal SSD or USB SSD (security problem for normal module).

The UEFI version of Kali Linux VHD fails to boot in MBR mode from USB (UEFI version Not compatible with MBR booting).


  • antonino61 likes this

#131 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1525 posts
  •  
    Italy

Posted 23 January 2021 - 10:54 AM

@wimb or whomever may answer

how do I obtain Ubuntu.vhd.vtoy?



#132 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 23 January 2021 - 11:16 AM

@wimb or whomever may answer

how do I obtain Ubuntu.vhd.vtoy?

 

You can make it using VirtualBox using this description (don't forget to select the EFI checkbox)

 

In VirtualBox after Install and rebooting with Ubuntu you need to Add Guest Additions from menu

 

On VirtualBox taskbar Share external folder that contains vtoyboot.sh

 

Then use R-mouse to Open Terminal at vtoyboot.sh and then run vtoyboot.sh as root sudo sh vtoyboot.sh



#133 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1525 posts
  •  
    Italy

Posted 23 January 2021 - 11:25 AM

I dont have vb or vm. I have just downloaded premade LinuxMint_20.1_VB_LinuxVMImages.COM.ova and LinuxMint_20.1_VM_LinuxVMImages-disk1.vmdk. will either help instead?



#134 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 23 January 2021 - 11:35 AM

I dont have vb or vm. I have just downloaded premade LinuxMint_20.1_VB_LinuxVMImages.COM.ova and LinuxMint_20.1_VM_LinuxVMImages-disk1.vmdk. will either help instead?

 

No, since the Linux running in VirtualBox must be modified with the vtoyboot.sh command to make it compatible with vdiskchain

 

VirtualBox is Free Download ....


  • antonino61 likes this

#135 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1525 posts
  •  
    Italy

Posted 23 January 2021 - 11:40 AM

can the content of the resulting vhd be compacted effectively as is the case with windows vhds?



#136 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 23 January 2021 - 12:16 PM

can the content of the resulting vhd be compacted effectively as is the case with windows vhds?

 

This Ubuntu Linux VHD is booting as FILEDISK and I think that compression cannot be used and is not available AFAIK ....

 

For booting from RAMDISK you can use the Ubuntu, Linux Mint Or Kali Live ISO located on FAT32 with menu entries given by UEFI_MULTI.


  • antonino61 likes this

#137 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1525 posts
  •  
    Italy

Posted 23 January 2021 - 12:43 PM

and then, after reducing win10 to sizes the tininess of which were unthinkable of months ago, dont u think linux is a step back spacewise? Me, as a layman, I cannot think of having a 2-3gb windows install and an at least 10gb linux install. Anyway, since U, as Wimb, have put some effort into this project, something else must be worth its while. If only I knew which, I would put my effort as well. Paradoxically, as of now, I see wubi, mint4win and deepin winsetup more viable, at least from a windows pov. Or else, even if it might sound as a repetition, there must be something I have missed out on.



#138 ventoy

ventoy

    Member

  • Members
  • 84 posts
  •  
    China

Posted 23 January 2021 - 01:24 PM

Thank you and using also your description   :) - vdiskchain is working OK to boot Ubuntu.vhd.vtoy from SSD USB in UEFI Secure mode and in MBR mode.

 

In my case files vdiskchain and ipxe.krn are located in grub rootfolder of FAT32 USB Boot drive and Ubuntu.vhd.vtoy is located on NTFS drive of portable SSD USB.

 

\grub\grub.cfg menu entries were used

if [ "${grub_platform}" == "efi" ]; then

  menuentry "Ubuntu.vhd.vtoy - /grub/vdiskchain" {
    chainloader /grub/vdiskchain vdisk=/Ubuntu.vhd.vtoy
  }

else

  menuentry "Ubuntu.vhd.vtoy - /grub/vdiskchain" {
    linux16  /grub/ipxe.krn vdisk=/Ubuntu.vhd.vtoy
    initrd16 /grub/vdiskchain
  }

fi

-

Also in MBR mode direct booting  with Grub4dos is working OK

 

\menu.lst entry

title Ubuntu.vhd.vtoy - /grub/vdiskchain
kernel /grub/ipxe.krn vdisk=/Ubuntu.vhd.vtoy
initrd /grub/vdiskchain

Very good that Ubuntu 64-bit Linux in VHD file is bootable from USB in UEFI Secure mode using Grub2 and in MBR mode using Grub2 or Grub4dos  :)

 

It allows Multi-Boot of Windows and Linux VHD in an easy way without the need to change partitioning of your computer.

I have modified my internal hidden EFI drive to boot in UEFI Secure mode with Grub2 and use vdiskchain to boot Ubuntu VHD located on internal GPT NTFS drive.

Nice thing is that the WARNING with 10 seconds delay does not occur when booting from internal SSD in UEFI Secure mode with Ubuntu VHD  :)

 

For Ubuntu this procedure is working OK, but for Kali Linux 64-bit Installer

the Kali Linux VHD prepared with VirtualBox fails to boot in UEFI Secure mode from internal SSD or USB SSD (security problem for normal module).

The UEFI version of Kali Linux VHD fails to boot in MBR mode from USB (UEFI version Not compatible with MBR booting).

 

I just release vtoyboot-1.0.8 and vdiskchain-1.1. So you need to use both the latest release.

 

For Kali Linux VHD, is it OK if you disable secure boot?

 

For Kali Linux VHD failed to boot in MBR mode, did you install it in UEFI mode ? When you run vtoyboot.sh, did it give your some warning?

What is the error when you boot in MBR mode, any photos?



#139 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 23 January 2021 - 01:25 PM

Sure Mini Win10x64 in VHD is far more interesting. But I always study new developments ....

 

The concept of Linux in VHD is interesting if you want an easy way to Multi-Boot Windows and Linux.



#140 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 23 January 2021 - 01:52 PM

I just release vtoyboot-1.0.8 and vdiskchain-1.1. So you need to use both the latest release.

 

For Kali Linux VHD, is it OK if you disable secure boot?

 

For Kali Linux VHD failed to boot in MBR mode, did you install it in UEFI mode ? When you run vtoyboot.sh, did it give your some warning?

What is the error when you boot in MBR mode, any photos?

 

I cannot simply disable Secure Boot, but I expect that the KALI UEFI Boot Error is caused by Secure mode.

Will try latest version and report later about it.

 

VirtualBox with EFI Selected used for Ubuntu Installed in VHD can be used for both UEFI Secure and MBR booting using same VHD.

 

KALI was Installed with EFI checkbox selected.

I think that there was no warning when running vtoyboot.sh

 

KALI MBR  and KALI UEFI Boot Error - Nothing occurs when Press Enter is used in KALI MBR moment of picture

 

KALI_MBR_IMG_20210123.jpg == KALI_UEFI_IMG_20210123 (2).jpg



#141 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1525 posts
  •  
    Italy

Posted 23 January 2021 - 01:54 PM

which can also be achieved thru wubi&co.



#142 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1525 posts
  •  
    Italy

Posted 23 January 2021 - 04:37 PM

my dear wimb, I am now writing from mint4win. no hustle'n'bustle installing it (only a 14gb folder, grrrr). the only one drive I cannot see is the one it is on. do u think I can at least compact the linuxmint folder?



#143 ventoy

ventoy

    Member

  • Members
  • 84 posts
  •  
    China

Posted 24 January 2021 - 03:10 AM

I cannot simply disable Secure Boot, but I expect that the KALI UEFI Boot Error is caused by Secure mode.

Will try latest version and report later about it.

 

VirtualBox with EFI Selected used for Ubuntu Installed in VHD can be used for both UEFI Secure and MBR booting using same VHD.

 

KALI was Installed with EFI checkbox selected.

I think that there was no warning when running vtoyboot.sh

 

KALI MBR  and KALI UEFI Boot Error - Nothing occurs when Press Enter is used in KALI MBR moment of picture

 

attachicon.gif KALI_MBR_IMG_20210123.jpg == attachicon.gif KALI_UEFI_IMG_20210123 (2).jpg

 

There is a standard ventoy disk image embedded in vdiskchain. So I don't known why it show the warning in your enviroment.

I tested kali-linux-2020.3-installer-amd64.iso and it boot fine in both legacy BIOS mode and UEFI mode.

All the distros in the list here https://www.ventoy.n...n_vtoyboot.htmlhave been tested. 



#144 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 24 January 2021 - 06:53 AM

There is a standard ventoy disk image embedded in vdiskchain. So I don't known why it show the warning in your enviroment.

I tested kali-linux-2020.3-installer-amd64.iso and it boot fine in both legacy BIOS mode and UEFI mode.

All the distros in the list here https://www.ventoy.n...n_vtoyboot.htmlhave been tested. 

 

I repeated everything for KALI using latest vtoyboot-1.0.8 and vdiskchain-1.1

 

I tested kali-linux-2020.4-installer-amd64.iso which is latest available

 

KALI_vtoyboot_2021-01-24_071903.jpg

 

There is indeed a WARNING when vtoyboot.sh is executed.

 

grub i386-pc modules not installed, package missing - so only UEFI is supported

 

On booting in UEFI Secure mode from USB with a1ive grub2 of 2021-01-04 then I get same Ventoy WARNING and 

Secure Boot forbids loading module normal.mod

I am not using Ventoy environment, but according to you the Ventoy WARNING should Not occur ?

 

KALI_IMG_20210124.jpg



#145 ventoy

ventoy

    Member

  • Members
  • 84 posts
  •  
    China

Posted 24 January 2021 - 08:55 AM

I repeated everything for KALI using latest vtoyboot-1.0.8 and vdiskchain-1.1

 

I tested kali-linux-2020.4-installer-amd64.iso which is latest available

 

attachicon.gif KALI_vtoyboot_2021-01-24_071903.jpg

 

There is indeed a WARNING when vtoyboot.sh is executed.

 

grub i386-pc modules not installed, package missing - so only UEFI is supported

 

On booting in UEFI Secure mode from USB with a1ive grub2 of 2021-01-04 then I get same Ventoy WARNING and 

Secure Boot forbids loading module normal.mod

I am not using Ventoy environment, but according to you the Ventoy WARNING should Not occur ?

 

attachicon.gif KALI_IMG_20210124.jpg

 

How did you boot the vdisk file from grub2?    chainloader  /vdiskchain  vdisk=xxx.vtoy  ?

Is it OK if secure boot is disabled?



#146 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 24 January 2021 - 09:45 AM

How did you boot the vdisk file from grub2?    chainloader  /vdiskchain  vdisk=xxx.vtoy  ?

Is it OK if secure boot is disabled?

 

Super Grub > a1ive Grub2 entry in \grub\grub.cfg

if [ "${grub_platform}" == "efi" ]; then

  menuentry "KALI.vdi.vtoy - /grub/vdiskchain" {
    chainloader /grub/vdiskchain vdisk=/KALI.vdi.vtoy
  }

else

  menuentry "KALI.vdi.vtoy - /grub/vdiskchain" {
    linux16  /grub/ipxe.krn vdisk=/KALI.vdi.vtoy
    initrd16 /grub/vdiskchain
  }

fi

I cannot simply disable Secure Boot, but probably disable Secure Boot will make KALI.vdi.vtoy bootable ....



#147 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 24 January 2021 - 12:58 PM

There is a standard ventoy disk image embedded in vdiskchain. So I don't known why it show the warning in your enviroment.

I tested kali-linux-2020.3-installer-amd64.iso and it boot fine in both legacy BIOS mode and UEFI mode.

All the distros in the list here https://www.ventoy.n...n_vtoyboot.htmlhave been tested. 

 

I have used download kali-linux-2020.3-installer-amd64.iso and get the same WARNING when vtoyboot.sh is executed

 

grub i386-pc modules not installed, package missing - so only UEFI is supported

 

KALI_3_vtoyboot_2021-01-24_135213.jpg

 

So it still means that KALI does not support MBR BIOS booting for me ....

 

On booting in UEFI Secure mode from USB with a1ive grub2 of 2021-01-04 then I get same Ventoy WARNING and 

Secure Boot forbids loading module normal.mod



#148 ventoy

ventoy

    Member

  • Members
  • 84 posts
  •  
    China

Posted 24 January 2021 - 01:47 PM

I have used download kali-linux-2020.3-installer-amd64.iso and get the same WARNING when vtoyboot.sh is executed

 

grub i386-pc modules not installed, package missing - so only UEFI is supported

 

attachicon.gif KALI_3_vtoyboot_2021-01-24_135213.jpg

 

So it still means that KALI does not support MBR BIOS booting for me ....

 

On booting in UEFI Secure mode from USB with a1ive grub2 of 2021-01-04 then I get same Ventoy WARNING and 

Secure Boot forbids loading module normal.mod

 

For Kali you need to install grub-pc-bin package before run vtoyboot.sh.

For example:   kali-linux-2020.3-installer-amd64/pool/main/g/grub2/grub-pc-bin_2.04-8kali1_amd64.deb


  • wimb likes this

#149 ventoy

ventoy

    Member

  • Members
  • 84 posts
  •  
    China

Posted 25 January 2021 - 02:02 AM

I have used download kali-linux-2020.3-installer-amd64.iso and get the same WARNING when vtoyboot.sh is executed

 

grub i386-pc modules not installed, package missing - so only UEFI is supported

 

attachicon.gif KALI_3_vtoyboot_2021-01-24_135213.jpg

 

So it still means that KALI does not support MBR BIOS booting for me ....

 

On booting in UEFI Secure mode from USB with a1ive grub2 of 2021-01-04 then I get same Ventoy WARNING and 

Secure Boot forbids loading module normal.mod

 

I useSuper-UEFIinSecureBoot-Disk_minimal_v3.zip , download it and dd the diskimg to a USB drive and boot to its embedded grub with secure boot. And then chainloader vdiskchain and it boot fine. (I only test it on VMware with secure boot. My laptop is old and doesn't support secure boot)

 

 



#150 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 25 January 2021 - 06:54 AM

For Kali you need to install grub-pc-bin package before run vtoyboot.sh.

For example:   kali-linux-2020.3-installer-amd64/pool/main/g/grub2/grub-pc-bin_2.04-8kali1_amd64.deb

 

What commands do I need to use to install that package so that /boot/grub/i386-pc/  modules appear ?

 

What I did so far is not sufficient

 

KALI_grub-pc_2021-01-25_071408.jpg







Also tagged with one or more of these keywords: linux, windows, boot, vhd, image-file, howto

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users