How to install Porteus on the same partition with Windows?

Share your opinion about Porteus Kiosk Edition.
Post Reply
priusconf
Ronin
Ronin
Posts: 1
Joined: 09 Dec 2019, 01:50
Distribution: Kiosk 4.9

How to install Porteus on the same partition with Windows?

Post#1 by priusconf » 09 Dec 2019, 03:51

A quick 2019 update for newbies coming from windows... There are 2 ways pcs can boot: the newer "EFI" mode and the older "MBR" mode, typically chosen in the bios setup. Below is a trick I used to allow a MBR-mode windows10 laptop to dual-boot windows, or the Porteus-Kiosk.iso file on un-encrypted windows drive C, or drive-D for that matter: ntfs or fat32 drive-d. That is, the windows boot menu lets you boot windows, but also lets you choose to boot Porteus-Kiosk.iso file from the hard-drive (via EasyBCD's grub2), without any usb-stick or cd/dvd being needed.

Note: For EFI-mode, it seems not as easy to do, as EasyBCD can't do it, but seems as tho the slightly more complicated Grub2win is needed, and I haven't tried that yet.

A little background first...
If you have a windows-pc new enough that it came with windows10, windows usually requires EFI mode to boot. EasyBCD cannot add iso-files to the windows boot menu in this case. That is, If you install and run EasyBCD on such a pc, it says:
EasyBCD has detected that your machine is currently booting in EFI mode. Due to limitations set by Microsoft, many of EasyBCD's multi-booting features [i.e. grub2 and iso-file booting] cannot be used in EFI mode and have been disabled
If you have a pc that came with windows7 or earlier, even if updated to win8/10, it still likely boots windows in MBR mode, (that is, without EFI mode). And in this case, EasyBCD can add most Porteus live-cd iso files to the windows boot menu, I had to do some tricks below to get EasyBCD to boot Porteus-Kiosk.iso file on the internal HD/SSD, that is, without needing to burn a cd or use a usb-stick.

Using EasyBCD to add it to the menu, I then booted from the c:\Porteus-Kiosk-Cloud-4.9.0-x86_64.iso file, and could run the kiosk-wizard and save the custom Porteus-Kiosk.iso to a usb-stick. I copied Porteus-Kiosk.iso back to c:\ and added it as boot-item with EasyBCD. When I select it to boot from, grub2 loads the iso, and starts to boot (initrd or vmlinuz I think), but then displayed an error message something like "unable to find kiosk config", and counted down from 30 to reboot. (Not all iso files can be booted by EasyBCD/grub2, and I suspect this one cannot because it is a hybrid iso file. But it can be made to boot with a trick.

The trick to boot from the Porteus-Kiosk.iso works only if you can create a new1gig partition. (Note: an MBR disk can have only 4 primary partitions, and if you already have 4, there are ways to remove the first small "System Reserved" partition if you are not using bitlocker: see [https://www.terabyteunlimited.com/kb/article.php?id=409][/https://www.terabyteunlimited.com/kb/article.php?id=409]

You can shrink by 1gig (1000 mb) one of the existing partitions, like C-drive, In windows with disk manager: start -> cmd -> right-click "run as admin", diskmgmt.msc You can create a new 1gig partition as well.

Next, boot into linux, and be sure to correctly identify the partition number of the new 1gig partition (with fdisk -k /dev/sda or gparted): it might be any one of these: /dev/sda3, /dev/sda4, or /dev/sda5: just make absolutely sure you know which one identifies the empty 1gig partition cause the next step wipes it out!

Plug-in the usb-stick with Porteus-Kiosk.iso on it. It will likely mount at /mnt/sdb1 or /media/sdb1 or similar (use df -h to see where it mounted). Let us assume /media/sdb1/ in next step.

Open a terminal, and do these commands to clone the iso to sda3

Code: Select all

sudo su

dd  if=/media/sdb1/Porteus-Kiosk.iso   of=/dev/sda3
Shutdown, remove the usb-stick, and you should now be able to boot from the "Porteus-Kiosk.iso" file you added to windows boot menu with EasyBCD.
This trick may not be needed if Grub2Win is used instead of EasyBCD: I'll update this post once I have tried it.

BTW, EasyBCD no longer seems to be free since about version 2.4, but you may still be able to find a 2.3 installer. I have used it for years to add live-linux iso files to windows boot menu in a trivially easy manner. Even on new pcs using EFI, you can still create a "RECOVERY" usb-stick, and use EasyBCD to edit \boot\BCD on the usb stick. Then you can live-linux iso files to windows-boot-menu on the usb-stick: you just temporarily have to switch the boot mode in bios to non-EFI, and select the usb-stick to boot from. When done, go in bios and switch boot mode back to EFI so you can boot windows as usual from hard-drive.

Hope this helps. Let me know if you need any further info if interested in trying this. I may put a more detailed howto up on github for example.

User avatar
Ed_P
Contributor
Contributor
Posts: 5504
Joined: 06 Feb 2013, 22:12
Distribution: 4.0 Cinnamon 64-bit ISO
Location: Western NY, USA

How to install Porteus on the same partition with Windows?

Post#2 by Ed_P » 09 Dec 2019, 06:16

I use Grub2Win on my Windows systems to boot many ISOs. No extra partition needed. But Secure Boot needs to be disabled on EFI systems. :)
Ed

User avatar
francois
Contributor
Contributor
Posts: 5786
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

How to install Porteus on the same partition with Windows?

Post#3 by francois » 15 Dec 2019, 13:29

You can also use grub2 directly to have dual booting. This could be done by installing popular linux distribution: debian, ubuntu, manjaro, ... . And then installing porteus directly into the partition of that other distribution.

See grub2 menu entry

User avatar
Ed_P
Contributor
Contributor
Posts: 5504
Joined: 06 Feb 2013, 22:12
Distribution: 4.0 Cinnamon 64-bit ISO
Location: Western NY, USA

How to install Porteus on the same partition with Windows?

Post#4 by Ed_P » 15 Dec 2019, 15:12

But how does one install popular Linux distributions without overwriting the base Windows system? Grub2Win is a Windows based system so not problem using that approach.

And here are a few of my grub2 menu entries.

Code: Select all

menuentry " Porteus 4.0 ISO - AF" --class slackware   --class icon-porteus  {

     set boot_parms="volume=33 reboot=cold $extramods "

     search -f $iso --set=root
     loopback loop $iso
     linux  (loop)/boot/syslinux/vmlinuz from=$iso $boot_parms
     initrd (loop)/boot/syslinux/initrd.xz
     }

menuentry " Porteus 4.0 USB - AF'" --class slackware   --class icon-porteus  {

     set porteus_parms="volume=33 reboot=cold extramod=/Modules;/Modsavedat noload=save.dat;cinnamon"

     set bootdrv=$root
     search -f /boot/syslinux/vmlinuz --set=root
     if [ $root != $bootdrv ]; then
        linux  /boot/syslinux/vmlinuz $porteus_parms
        initrd /boot/syslinux/initrd.xz
     else
        echo "----------------------------------------"
        echo USB drive NOT found.
        echo
        sleep -v -i 10
     fi
     set root=$bootdrv
     }

menuentry " Porteus 4.0 USB - EFI" --class slackware   --class icon-porteus  {

     set bootmgr=/EFI/boot/bootx64.efi

     set bootdrv=$root
     search -f $bootmgr --set=root
     if [ $root != $bootdrv ]; then
        chainloader $bootmgr
     else
        echo "----------------------------------------"
        echo USB drive NOT found.
        echo
        sleep -v -i 10
     fi
     set root=$bootdrv
     }
ISOs are so much easier to work with. :D
Ed

Post Reply