this post was submitted on 28 May 2024
25 points (87.9% liked)

Linux

4363 readers
241 users here now

A community for everything relating to the linux operating system

Also check out !linux_memes@programming.dev

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 1 year ago
MODERATORS
 

From another comment I made

A linux installer for windows that works just like a normal installer on windows. You download the .exe, double click it, it opens a wizard you can walk though, and by the end of the process, after it reboots, you're in a linux distro.

How could something like this be implemented?

My idea:

Best case scenario where multiple data partitions exist and can accommodate the user data stored on C:/ + there's a swap partition -->

  • download a linux iso
  • deactivate swap
  • replace swap partition with ISO contents
  • modify contents to auto install linux with settings from wizard
  • add boot entry to boot from old swap / modified ISO
  • reboot
  • install linux with a nice progress animation
    • move user data from C:/ to other partition
    • replace C:/ with linux
    • install alternatives to programs found on windows (firefox for edge, gimp for paint, inkscape for ..., libreoffice for MS office, etc.)
    • move user data to /home/$username
    • configure DE with theme (gnome for macos look, kde with theme for windows look)
    • other customisations
  • reboot into linux

Dunno if this is feasible in the best case scenario.

Anti Commercial-AI license

all 26 comments
sorted by: hot top controversial new old
[–] rikudou@lemmings.world 19 points 1 month ago

Read on about WUBI, it's outdated, but perhaps you can adapt it to your use-case.

Ah, the nostalgia, WUBI is how I installed my first distro.

P.S. Your "Anti Commercial-AI license" doesn't really do anything.

[–] CameronDev@programming.dev 13 points 1 month ago* (last edited 1 month ago) (2 children)

In the bad old days there used to be an ubuntu tool that you could install linux from windows. From memory it created a disk image inside your Windows drive, and then setup a boot environment that could mount and boot into the disk image. Kinda like a livecd, but persistent?

Ill try find more info and update. (Ah, its Wubi, which the other poster mentioned already).

https://github.com/hakuna-m/wubiuefi

https://en.m.wikipedia.org/wiki/Wubi_(software)

[–] lemmyreader@lemmy.ml 5 points 1 month ago (1 children)
[–] CameronDev@programming.dev 5 points 1 month ago

Odd that most of that page is about how to uninstall it. The XP references really dates it.

[–] onlinepersona@programming.dev 4 points 1 month ago (1 children)

Looks interesting, thank you. The biggest difference I can see here is the installation to virtual drive on an NTFS partition. But it's good to know that a lot of the work has been done. Probably one could go a little further and not use a virtual drive.

In the bad old days there used to be an ubuntu tool that you could install linux from windows.

Why bad old days?

Anti Commercial-AI license

[–] CameronDev@programming.dev 3 points 1 month ago (1 children)

Looong time ago, and the linux world wasnt anywhere near stable and polished as it is now (neither was Windows either if we are being honest with ourselves).

While Wubi does not install Ubuntu directly to its own partition this can also be accomplished by using LVPM, the Loopmounted Virtual Partition Manager, to transfer the Wubi-generated Ubuntu installation to a dedicated real partition

I vaguely recall using something like that and trashing both OS installs.

Resizing partitions live is very dangerous, which is why normally its done from a bootable CD or USB. Doing it live from Windows wont be easy. And if you have to boot into a usb or dvd environment, may as well just use the regular installation media?

[–] elmicha@feddit.de 2 points 1 month ago (1 children)

Recently I got a new PC with Windows, and it could resize its partition without problems. You can do it even with Powershell. I don't know how dangerous it is, but with the whole "copying user data" I would hope that the installer would advise users to create a full backup anyway.

[–] CameronDev@programming.dev 2 points 1 month ago

No reboot? Impressive, maybe MS solved that problem.

Shrinking/moving is usually the more dangerous operation, but maybe they have solved it.

No matter how many times you tell users to backup their data, they won't do it, and will blame you for their data loss anyway :D

[–] ipacialsection@startrek.website 6 points 1 month ago (2 children)

Not sure why, but a lot of other distros did something just like this in the past (see the comments about WUBI) and no longer do. Q4OS still has a .exe installer though.

[–] onlinepersona@programming.dev 3 points 1 month ago (1 children)

I couldn't find the source for Q4OS's exe installer 🤔 They're on github and sourceforge, but neither have the source for it. Am I looking in the wrong places?

Anti Commercial-AI license

[–] yala@discuss.online 3 points 1 month ago

IIUC, Q4OS only shares its source code on request. Furthermore, the Windows installer is a fork (or somewhat based on) WubiUEFI.

[–] yala@discuss.online 2 points 1 month ago

Q4OS still has a .exe installer though.

TIL. This is pretty cool. I wonder how much effort it would cost to make this a viable option for most of the popular distros.

[–] possiblylinux127@lemmy.zip 5 points 1 month ago (1 children)

You have a decent amount of Linux knowledge but you also have gaps which I find a little confusing.

Anyway what your describing isn't possible and even if it was I do not think it would be useful.

[–] mundane@feddit.nu 1 points 1 month ago (1 children)

It was possible for Ubuntu once upon a time

[–] possiblylinux127@lemmy.zip 2 points 1 month ago (1 children)

Yes, but that was XP and MBR

[–] mundane@feddit.nu 1 points 1 month ago

You are right, I didn't think of MBR.

[–] fourwd@programming.dev 3 points 1 month ago* (last edited 1 month ago)

It would be better for your nerves to just do a normal GNU/Linux installation. There are too many ways the installation can go wrong:

replace swap partition with ISO contents

For example, Ubuntu ISO has a size of 5.7G. But my swap, which you previously deactivated, was 4G. Either 2G, or it didn't exist at all.

move user data from C:/ to other partition

The other partition may not exist or may have capacity smaller than C:/.

replace C:/ with linux

The installed Linux must also be stored somewhere. And there is also a copy partition for C. The same problem of lack of space.

move user data to /home/$username

From %APPDATA%? You would have to be a know-it-all to resolve the location paths and configuration names of literally every existing program.

reboot into linux

~~And it is at this moment that Windows will completely randomly decide to update and rewrite the bootloader :)~~

[–] SteveTech@programming.dev 2 points 1 month ago (1 children)

I don't think Windows has swap partitions, you could maybe install a basic installer to the recovery partition, repartition in that (copying the ISO between partitions), then load the full ISO.

[–] onlinepersona@programming.dev 1 points 1 month ago

I wasn't aware windows didn't have a swap partition. Thanks for pointing that out. Using the recovery partition instead should work too 🤔 I currently don't have a windows PC to test this on, nor find out how big the recovery partition is.

Anti Commercial-AI license

[–] Corbin@programming.dev 2 points 1 month ago (1 children)

The biggest barrier is writing lots of formatted data to disk without a pre-existing filesystem structure. Look at nixos-anywhere for an example; the first thing it does is ensure that it's booted into Linux, because otherwise it can't trust that the disks are laid out properly.

[–] onlinepersona@programming.dev 1 points 1 month ago (1 children)

No sure what you mean. On which step is writing formatted data to disk happening?

Anti Commercial-AI license

[–] Corbin@programming.dev 1 points 1 month ago (1 children)

Steps 8, 9, and 11 assume that the filesystem is in a Linux-compatible state and Windows-compatible state simultaneously.

[–] onlinepersona@programming.dev 1 points 1 month ago

Oh, the indentation didn't work. Those steps happen within the installer.

Anti Commercial-AI license

[–] lemmyreader@lemmy.ml 1 points 1 month ago

Back in the day Linux could run from a DOS partition. I think this is no longer a maintained project, but for ~~fun~~ historic reasons : https://www.ibiblio.org/pub/Linux/docs/HOWTO/UMSDOS-HOWTO