Working on a Linux installer for Windows that doesn't require a USB stick
Posted by aodj7272@reddit | linux | View on Reddit | 86 comments
Thanks for checking it out!
brandmeist3r@reddit
This is already a thing, called WUBI https://launchpad.net/wubi
aodj7272@reddit (OP)
This is from 2007 though.
brandmeist3r@reddit
2014 was the last major release and the last update is from 2016
mrlinkwii@reddit
it still works tho
Ezmiller_2@reddit
Have you tried it recently?
pomcomic@reddit
Hm. I do understand the intended use case for this - for many people flashing a USB stick looks like a barrier to entry that they can't wrap their head around; so, correct me if I'm wrong here, but the intention here to me is to lower or eliminate said barrier. Which I do find commendable.
However, I am not entirely sure that's what ends up happening with this approach. All it does is shift that barrier. Think of it this way: If (for lack of a better term) a normie can't figure out how to put an ISO on a USB stick, what are the chances of them knowing how to disable bitlocker and/or decrypt their hard drive or how to alter boot priority in their BIOS? I'm not saying that you could possibly design or program around these parameters, all I'm wondering is .... who is this for exactly?
gsdev@reddit
I think a better solution would be for Linux distros to just create an "installer" that flashes the USB stick for you instead of asking you to download the ISO and use 3rd part software to put it on USB.
Little_crona@reddit
can't really even say it's for people who don't own a flash drive because with how cheap they've gotten there's barely any excuse to not be able to get a handful of gigs to just barely fit the installer. if you could afford a pc you can afford an 8-64 GB stick
MyraidChickenSlayer@reddit
Let me assure you, there are tons of people in third world countries who would rather go through this difficult steps than buy usb drive for 10$. 10$ here is enough for 10 days of day lunch here.
114sbavert@reddit
Added to that is the fact that affordable flash drives suck ass here
cgoldberg@reddit
People with electricity, internet access, and a spare laptop who are power users and willing to take on technical tasks because a $5 usb stick is completely out of reach.... just don't exist... in any country.
pomcomic@reddit
Yknow, fair enough mate.
Little_crona@reddit
yeah thats fair
aodj7272@reddit (OP)
Thanks for the reminder! I'm glad this might be useful.
HonestRepairSTL@reddit
What if you don't have a flash drive around? I'v had that happen before myself, so I'd love a way to install an OS without one rather than driving 20 minutes to Micro Center and getting one
heywoodidaho@reddit
I have a candy dish full and that's only half of them, but I'm in the U.S. Seems like some places like Brazil electronics are scarce and overpriced. Still it's worth the investment just to have a lifeboat for your home folder/ disc rescue.
buttplugs4life4me@reddit
I don't really wanna have one. I got 3 laying around somewhere. I don't wanna buy another one, cause I already got some. But I know that the one I find and try is gonna be broken in some way and not work to install it.
And honestly, when you Dualboot and shit you already have to adjust boot priority and disk encryption. The annoying part for me is the USB stick
gallifrey_@reddit
throw away your broken ones, get a single 64GB flash drive with Type-A and Type-C so you can use it in your phone and computer, flash Ventoy to it and drag-and-drop ISOs for booting and files for keeping altogether. its so fucking worth it.
ofernandofilo@reddit
if it is possible [a] to create a partition on a GPT disk, [b] without any operating system installed (so the installation must be done on an original liveUSB or on another machine), [c] that allows using UEFI Secure Boot to produce a dynamic menu with the ISOs present on the partition and from there test or install Linux...
I will make this partition on all my computers and on all the machines I have access to for the simplicity and speed I will have both for testing and for installing a new system.
if it's not suitable for beginners... it's great for intermediate and advanced users.
_o/
Little_crona@reddit
definitely a good "power user" tool, just kind of a shame it doesnt make life easier for a group of people who could genuinely really benefit from something similar
aodj7272@reddit (OP)
A lot of laptops still aren't encrypted with bitlocker. Of course some are by default. Maybe I could automate that step as well. If the only significant step is changing boot priority in the BIOS the overall barrier might be lower than getting a usb stick, downloading an iso, downloading rufus, booting the usb stick, etc.
acemccrank@reddit
I think a good part of this should be only officially supporting UEFI-compliant distros, to remove that portion of the barrier. IIRC, U CD had a tool that could automatically fix Windows' Boot Manager or GRUB depending on which you had, and would automatically update it.
l1f7@reddit
UEFI boot order should be accessible from the OS anyway (tho I don't know if Windows specifically will let you change it), so maybe changing that can also be done automatically. Secure Boot remains a problem though.
aodj7272@reddit (OP)
Secure boot is working, at least on my laptop. Changing the UEFI boot order from within Windows is proving to be more of a challenge. The program adds the entry but doesn't make it default. Also tried getting the windows boot manager to boot the partition by default, but that didn't work. Would have been nice though because then the user wouldn't have to mess around in the BIOS.
l1f7@reddit
How have you managed to get Secure Boot to work? The bootloader must be signed with keys present in the machine's key storage for it to work (and by default there's only Microsoft's keys there afaik).
aodj7272@reddit (OP)
https://www.linuxmint.com/rel_virginia_whatsnew.php
"Linux Mint 21.3 comes with full support for SecureBoot and compatibility with a wider variety of BIOS and EFI implementations.
Grub is used in EFI mode. Isolinux/syslinux is used in BIOS mode.
The tools and framework used by Linux Mint to produce its ISO images were updated and are now based on the latest version of live-build.
The team also drastically reduced the internal differences between LMDE and Linux Mint ISO images."
I think my Laptop's manufacturer must have included Ubuntu keys. Hopefully other manufacturers are doing the same.
l1f7@reddit
Cool! I didn't know that.
jr735@reddit
While others have already pointed out that not everyone can afford a USB and alternatives are always welcome, what you pointed out is exceedingly important. While some people get confused or have difficulty making a bootable USB stick correctly, a significant problem is setting up all those things you indicate. The BIOS screens are always so wildly different, too.
Xotchkass@reddit
I can't talk for dev, but in my opinion value of this project isn't in "dumbing things down for normies", but rather in eliminating unnecessary step.
Most people nowadays don't need usb drives. I'm willing to bet, that many don't even own one. Like I haven't used usb stick in like 3 years. I have one... somewhere. If it still works. If not, I would need to buy one. Then flush image FROM PC to usb drive, just to install OS on the SAME PC.
You already have OS image on PC, what purpose does usbdrive wrangling serve?
pomcomic@reddit
I can only speak for myself, but keeping a bootable USB drive around is always a good idea. If you're in the hobby, chances are you've got a Ventoy set up and ready to go for emergencies. I know I do.
Xotchkass@reddit
> If you're in the hobby
In what hobby? Newsflash: most people just want OS that works.
RecursionOver@reddit
Can we use it in Linux too.
aodj7272@reddit (OP)
Good idea! I've been thinking about making a Linux version too!
hoolio9393@reddit
Wsl Linux on Windows wasn't easy to setup at all. Enable wsl. Doesn't work. Crack
VirginSlayerFromHell@reddit
I usually just flash an iso on a 2gb fat partition on my drive
bsensikimori@reddit
Didn't Ubuntu used to ship with a tool like this?
TigerMoskito@reddit
yeah i remember you could install ubuntu inside windows but it was buggy as f
T8ert0t@reddit
Somehow, wubi would be able to install Ubuntu without needing bios access. I remember my university IT security team skipping their shit when people would use it and then all for support on their uni-issued devices.
zeanox@reddit
I think it was great, it was the only way i could figure out how to install linux back then.
PickledBackseat@reddit
Same. Would have never tried Linux if it wasn't for Wubi.
Ezmiller_2@reddit
Tried it on a Packard Bell Cloudbook a few years back. It was 2017 or 2018. Whomever decided it was all right to ship a laptop with 2gb ram and a 32gb emmc with a dual core Atom with Win10 should be drug out into the street and shot.
Anyway, I never did get it to work.
Perdouille@reddit
Yes, Wubi
OkInstancenow@reddit
grub installer
ofernandofilo@reddit
I have no idea what you're doing... in practice.
do you think a scenario like this is possible:
[a] the user reduces his final Windows partition, leaving free, for example, 32 + 128GB;
[b] the user creates a 32GB exFAT partition exclusively for storing bootable ISOs.
[c] a [maybe your] program makes this partition bootable in UEFI. and allow arbitrary choice of ISO present in the partition at boot time.
[d] the user is able to install linux on the remaining 128GB.
thus, a pendrive is no longer necessary and ISOs can be tested freely.
or would it not be possible?
thx!
_o/
Background-Key-457@reddit
You can just install GRUB to the 32gb partition and add grub entries which point to the ISO. You don't need any special program for your point (c), just GRUB configured correctly.
ofernandofilo@reddit
my question is about having [a] any bootloader installed without an operating system with SecureBoot support active and [b] dynamic ISO listing for boots. i.e. all I have to do is copy the ISO there and the disk will dynamically appear as a boot option.
so... I can change the ISO list from within Windows, BSD, linux, etc. without needing to root or re-install the bootloader, etc.
_o/
ericek111@reddit
Of course it's possible, this is how I reinstalled my system after I lost my only working thumb drive.
ofernandofilo@reddit
what? I don't need thumbdrives in my life anymore, and I have several!
do you have a guide? and does it work with UEFI with Secure Boot Active?
I don't use secure boot... but if it's possible, it would be a more solid and more universal solution.
aodj7272@reddit (OP)
Linux Mint 22.1 includes signed bootloaders which are trusted by secure boot by default. I'm not sure this will always work though.
ofernandofilo@reddit
right, but is it possible without installing Linux... to have an independent partition that allows you to install Linux from it?
using mint's secure boot for example?
Background-Key-457@reddit
You don't need Linux but you do need grub, which is included in most Linux distros.
Grub can load ISO disk images, you just have to add a config entry which points to the ISO.
I always create a partition like this with grub configured with a Linux installer ISO so I don't need a usb, I just boot into my recovery partition whenever I need to fix my system. I do some kernel dev and fuck my kernel up often enough that I find it necessary.
aodj7272@reddit (OP)
It works with secure boot on my laptop.
ofernandofilo@reddit
doubts:
[a] did you do this yourself or is it a known project?
[b] is it possible to have such a partition without having any linux installed on the machine? of course, I suppose such a feature could be created by an initial linux liveUSB.
but that does not depend on any distro installed to work and thus... every Linux distribution can be removed.
[c] is the menu dynamically populated with ISOs present on the disk rather than being manually edited by the user?
_o/
aodj7272@reddit (OP)
Grub2win does this, which I used in a previous version, but I can't really recommend it right now. Refind can find all bootable partitions and creates a list of them you can select from, but I haven't included it in this program yet. However, once you have changed your boot priority the linux partition, a grub boot menu does come up after each boot from where you can select next volume. It's still a bit clunky. Maybe I should expand this project to include the installation of refind so that all operating systems are always found and listed and presented in a nice menu: https://www.rodsbooks.com/refind/getting.html
ofernandofilo@reddit
thank you very much for the information!
Dwedit@reddit
MX Linux Frugal Install can happen without any USB drives.
Blu-Blue-Blues@reddit
I have a lot of questions.
What if the iso is broken? Why don't you use gpg checksum?
Why don't you use qt or something more modern?
Why just mint?
Is it just to get rid of the usb or how is this going to handle partitioning, grub, encryption and root?
Ezmiller_2@reddit
Mint is pretty straightforward in being simple to use and still do heavy lifting when needed. It's Ubuntu without the drama, like Ubuntu used to be until they started being bull-headed. Actually that's probably 99% Mark Shuttleworth's doing if I had a guess.
aodj7272@reddit (OP)
I should add a checksum asap actually. This program needs Windows integration (diskpart, PowerShell, UAC). Also this way it just needs basic MSYS2/MinGW packages: https://www.msys2.org/
It handles partitioning and grub, but not encryption.
spyingwind@reddit
Debian also has something like this on every ISO. Under the isolinux folder called
setup.exe
.It even lets you rescue an existing Debian install.
Ezmiller_2@reddit
Dang, wish I had known that.
aodj7272@reddit (OP)
Debian is pretty cool!
MyraidChickenSlayer@reddit
I really need to install linux from windows without pendrive and I couldn't fijd it. Will check it out
aodj7272@reddit (OP)
Let me know how it goes. Please back up your data first if possible and be aware of the risks using alpha software.
FacepalmFullONapalm@reddit
I don't get why people are reacting the way they are. It's literally the same as you would install asahi on apple silicon. You run a program from within the existing operating system, tell it where and how to install and bam you have Linux.
I think its a great idea, and I thought about making a power shell version of it for fedora kinoite installs but I'm lazy lol
aodj7272@reddit (OP)
Explanatory note: This program downloads the Linux Mint 22.1 iso, loads it in a virtual drive, resizes your c: partition by an amount of your choosing, and then creates a live bootable Linux Mint 22.1 partition. The free space leftover can be used afterwards to create a persistent Linux Mint installation.
Negative_Link_277@reddit
Why? Either just run the installer or create bootable media. All you're doing by creating a bootable partition on the HDD is making less space for a Linux installation that any person who this is targeted at will not have the skills to recover to use for their OS.
PlanAutomatic2380@reddit
wubi is that you
PlanAutomatic2380@reddit
Oh damn there’s wubiuefi which supports recent versions that’s so cool
RyDiffusion@reddit
Looking into the code, why this isn't a Powershell script? It doesn't even use Win32 calls for Resizing or mouting.
If you are the dev I recommend looking into it, PS is powerful in Windows
Also you are calling PS anyways:
atred@reddit
PowerShell scripts are usually disabled from running by default. People who know how to enable them and run them can boot from USB (Ventoy or just regular USB drive)
aodj7272@reddit (OP)
Well originally it was just a batch script. A powershell script would work fine, I just wanted people to have a familiar .exe file to download and install.
LordAnchemis@reddit
I mean, you could burn the ISO to CD/DVD - but who owns those
If you're technie (but lazy) netboot.xyz is the way
zeanox@reddit
Wubi is that you?
PicadaSalvation@reddit
WubiUEFI is still a thing. Won’t that achieve what you want?
ZeroOne010101@reddit
Sounds good, ill be interested just how far you take it
aodj7272@reddit (OP)
Thanks
thephilthycasual@reddit
Bro bringing back wubi
Cylian91460@reddit
this is cursed
but at the same time grub installer exist for windows so
Loveschocolate1978@reddit
Is this like a computer virus that automatically installs Linux? Sounds like when Microsoft forced updates from Windows 7(?) to Windows 10 overnight without people knowing, only for entire companies to lose millions when employees came back from their weekends breaks to discover data erased. Do any historians remember if this happened? I feel like this is a Pepperidge Farms moment.
Beauner_@reddit
hell yeah
Sinaaaa@reddit
I could -just barely- see myself use this in some extraordinarily niche circumstances, but to 99.9% of people interested in Linux this is not useful. I'm skeptical if you could ever get it to become stable enough without people actually testing in big numbers & I don't see that happening.
aodj7272@reddit (OP)
It might eventually be helpful. I (and others if interested) would have to test it more thoroughly.
PixelBrush6584@reddit
Neat!
ScratchHistorical507@reddit
Just don't.
aodj7272@reddit (OP)
Why!?