How to rebuild a debian 7/8/testing live isos with UEFI

Share your own howto's etc. Not for support questions!

How to rebuild a debian 7/8/testing live isos with UEFI

Postby rbern » 2016-07-08 14:12

How to rebuild a debian 7/8/testing live isos with UEFI

While bug #820036 ( is not solved for Debian 9 there is no way to install debian from a debian-live medium to an UEFI system.

After reading Head_on_a_stick comment here (viewtopic.php?f=20&t=127380#p609579), I've explored the solution and added it in debroot tool ( ... 51cd2053db).

This means that debroot, a tool that creates, builds and "upgrades/rebuilds" debian and ubuntu Live ISO files can now create a Debian 7/8/testing live ISO with UEFI support, which can be used to install the live system do disk (see below).

Now the whole process to have a live debian 7/8/testing iso customized and with UEFI support:

Now you have the content of the ISO extrated to a directory XXXXX-binary, being XXXXX what you typed in "ROOTFS directory". You have the content of the squashed filesystem in the "ROOTFS directory".

Now we will update the apt repositories in the chroot and then rebuild the ISO with UEFI support. The "apt-get update" is needed so that apt can find the needed packages.

    * Click on the "sources.list/upgrade" tab and then click the button "Update". Done;

    * If you want to add packages to the live ISO (customize) you can now click on the tab "Install" and add packagenames to install and then click the button "Install";

    * If you need to execute any command to complete the customization in the chroot click the tab "Chroot" and then run a shell in the chroot;

    * If you have installed or upgraded packages then you need to clear the downloaded packages from apt cache to make the live ISO a bit smaller. The commands to be executed in the shell to do this are:

    Code: Select all
    apt-get autoremove --purge
    apt-get clean

    * Now all is ready to rebuild the ISO. Click on the "Build" tab and then on the "Refresh options" button;


    * To rebuild the debian Live ISO with UEFI support just click "Build ISO" without unchecking the UEFI checkbox and wait.

NOTE: after the whole process is done you will have a script called with all the commands that were execcuted. In theory one could repeat the whole process from that script without the need to install debroot.

After the build was completed you can test if the Live ISO boots in UEFI mode in qemu/ovmf or in Virtualbox (with EFI boot).

For qemu/ovmf UEFI testing run:

Code: Select all
qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd -cdrom XXXXX.iso  -m 1024

To install from the Live ISO with debian-installer/live-installer, choose the correct option from the UEFI/grub install options.

Last edited by rbern on 2016-07-18 06:50, edited 2 times in total.
Posts: 8
Joined: 2011-07-16 11:18

Re: How to rebuild a debian 7/8/testing live isos with debro

Postby hhh » 2016-07-08 20:48


This is incredible! I can't wait to install and build a test ISO.

Many thanks to HoaS, he is a most excellent chap.

I'll post back whether or not I achieve success, and cheers!

-edit- This bug is also relevant, filed by R. Hertzog (Debian maintainer, Debian Handbook co-author, Kali Linux packager). ... bug=731709
Posts: 211
Joined: 2010-07-07 04:50

Re: How to rebuild a debian 7/8/testing live isos with debro

Postby rbern » 2016-07-09 11:39

Hi hhh, ty for trying this app.

Yes, #731709 is the one for live-build, but debian 9 Stretch will be built with live-wrapper/vmdebootstrap (, a new tool to build Debian live images being developed by Iain Learmonth in Python for Stretch with UEFI support.

So, how did it go? Are you having any problems with debroot? Did it succeed? :?:

Posts: 8
Joined: 2011-07-16 11:18

Re: How to rebuild a debian 7/8/testing live isos with debro

Postby rbern » 2016-07-10 05:54

I've released a new version with some bug fixes:

* UEFI/grub was working but BIOS/isolinux was not, when creating debian or ubuntu images, because it was not selecting the package syslinux-themes-ubuntu/debian;
* Fixed integrity-check/verify-checksums boot option in UEFI/grub mode, but it doesnt work in debian, just in ubuntu.
* Minor fixes (try to run apt-get update faster and removed backports repository from suggested repos for ubuntu).

I've tested both debian and ubuntu builds, using UEFI or not, and both images booted fine.

Posts: 8
Joined: 2011-07-16 11:18

Re: How to rebuild a debian 7/8/testing live isos with debro

Postby rbern » 2016-07-18 06:47

I've release a new version with improvements and bug fixes.

* If you followed the above howto, with debroot version 0.08, you will have the possibility to install the live system to disk by choosing the "Install debian to disk" in UEFI/grub mode. From my tests it worked, with preseed. An image example (a customized debtailor console with installer live image, adapted from the debian jessie 8.5 standard image that is available in the links in the above howto) can be downloaded from ... o/download .

* Now the filesystem package manifest is correctly created.

The only test that I cannot make, because I do not have a NX CPU. If anyone has a VM in Virtualbox or kvm/qemu with a uefi windows installed please make a backup or copy of that VM and please test this image and confirm that debian live with uefi can be installed along side with windows in uefi mode (or any other UEFI OS installed in the disk). TY.

Here is a snapshot of a Debian Live 8.5 standard booting from UEFI:
Posts: 8
Joined: 2011-07-16 11:18

Re: How to rebuild a debian 7/8/testing live isos with UEFI

Postby rbern » 2016-07-21 21:57

Hello again,

thanks to "vmware player" I got to install a Windows 7 x64 install in UEFI mode to disk in a VM (virtualbox and qemu/kvm dont work in UEFI mode with Windows 7).

After having Windows installed to the disk of the VM in UEFI mode I took the debian live with UEFI boot ISO file, which its link is in the above post, and tried to install Debian Live from UEFI using the UEFI "Graphical Install debian to disk", which uses live-installer with debian-installer.

All went very well. In the partitioning I could see the GPT partitioning and the EFI and Windows partitions. I've used debian-installer partitioning to reduce the size of the Windows partition and then selected to "Install to the largest available space in disk.".

All went fine until the end, including the grub-efi-amd64 package install. UPDATE: What failed was the discorery of the Windows system and its inclusion in the UEFI/grub boot menu that was created after the live install to disk. To fix this I had to boot into debian (the only choice) and in a terminal I ran the following commands:

Code: Select all
sudo apt-get install os-prober
sudo update-grub
sudo grub-install
sudo reboot

The next time it rebooted grub had a "Windows bootloader" boot menu, like below.

Here's a screenshot after live-installer UEFI install to disk:


After booting Windows to confirm it was working I've rebooted to Debian and checked what was the disk partitioning that live-installer/debian-installer left on the disk. Here's a screenshot:


So, long before Debian 9 Stretch will be ready you can have a Debian 8 Jessie, Live, customized, and have it installed with UEFI boot with live-installer/debian-installer, using debroot ;)
Posts: 8
Joined: 2011-07-16 11:18

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 4 guests