14 ms·
Installing Windows and Linux into the same partition
- notreallyserio 5y agoIIRC there was a way to do something like this way back, maybe during kernel 1.x days. It used some weird filename translation to load files from an old FAT (as in 8.3) filesystem.
- xioxox 5y agoYes, I remember using Linux installed onto an MSDOS partition using UMSDOS. It was pretty nice to be able to run Linux without repartitioning.
- Shadonototra 5y agojust boot a VM, if you need bare metal perf, then do PCI passthrought you can do it with a single GPU nowadays https://www.youtube.com/watch?v=_JTEsQufSx4 https://www.youtube.com/watch?v=_JTEsQufSx4 windows should be considered as a spyware, nobody should have it installed on an hardware use VM with a good firewall behind
- fbhabbed 5y agoI'm surprised it took so many years before seeing posts like this
- betaby 5y agoNew ntfs driver was merged no a long time ago.
- dfox 5y agoIn the Windows 9x days this was quite common and there were linux distributions that were installed by unzipping few hundred MB zipfile into C:\linux\. It only worked with FAT filesystem and the required umsdos FS module was removed from kernet 2.6.11 (and was marked obsolete for a long time before that). Having root filesystem on NTFS in any semi-sane way involves having kernel space NTFS FS implementation. Such a driver was introduced in 5.15 released on the 1st of this month.
- marcodiego 5y agoDoes nfts allow POSIX fs semantics? Also, this reminds me of UMSDOS.
- alufers 5y agoYes, it does. Unix permissions can be stored on NTFS, but Windows just doesn't use them.
- jchw 5y agoIndeed; it has a feature dubbed namespaces. You can create files and directories in the POSIX namespace, store POSIX ACLs, etc. and this will give you “bag of bytes” filenames alongside Windows filenames. I believe this was used for SfU and WSL1.
- harha 5y agoThe anti-container
- alufers 5y agoReminds me of the times when you could install Ubuntu via an .exe file using WUBI. This is how I started with Linux on my grandparents' computer without breaking it when I was 11.
- lytedev 5y agoWow, you just threw me back to my childhood! WUBI was so cool. I haven't had the need for something similar in some time and Ventoy is my go-to tool for such things now.
- punkspider 5y agoA friend needed something like this two weeks ago and used WubiUEFI, a fork of WUBI, and it seemed to work with no issues.
- maven29 5y agoUbuntu used to ship their CDs with an installer that wrote to a virtual disk file and let you boot from it. https://wiki.ubuntu.com/WubiGuide https://wiki.ubuntu.com/WubiGuide They've since dropped the idea but you can still cobble together something similar. https://unix.stackexchange.com/questions/309900/deploy-linux-into-and-boot-from-vhd https://unix.stackexchange.com/questions/309900/deploy-linux...
- haunter 5y agoIt still exists as a fork and works perfectly https://github.com/hakuna-m/wubiuefi/ https://github.com/hakuna-m/wubiuefi/
- tehbeard 5y agoFrom first hand experience, while it worked, several times the boot manager got nuked, and either I lost Ubuntu access, or had to repair windows to get back into the system at all. That said this was back during win7, the cobbled together solution may be more stable..
- aejnsn 5y agoYes and one of the Win10 updates clobbered GRUB somehow. Windows is just a bad neighbor.
- Nextgrid 5y agoWindows 10’s “updates” are actually full OS reinstalls in the background which includes the bootloader so it’ll nuke GRUB or whatever else you have. The really nasty part is that even having separate drives won’t save you - I don’t know if Windows can install the bootloader to a different drive than the one holding the OS partition or if it’s some other bug but I absolutely remember a Windows install nuking the bootloader on other drives that were connected during the OS install. It wasn’t a big deal pre-Windows 10 as you only install an OS once and disconnecting the drives is trivial, but nowadays with every update being an OS reinstall it’s a major problem if this issue still persists.
- yjftsjthsd-h 5y ago"Known issues" is interesting; kernel panics and ldconfig breaking are probably bugs worth chasing down, but "it just breaks after a few boots" is straight up weird.
- mackal 5y agoI wonder if issue 3 is related to at least one of the other issues :P
- fomine3 5y agoThis uses ntfs3, it means that it's thanks to recent Paragon's NTFS driver merge into mainline.
- dev_tty01 5y agoThis github comment from danbst was the best. "would it be possible to hardlink C:\Users -> С:/home, for extra awesomness?"
- jeroenhd 5y agoThis should be possible with a directory junction, though I would only wish the mess of permissions that would result in on my worst enemies.
- netizen-936824 5y agoThat's easy to solve, just do everything with elevated perms! (Yes, this is a joke)
- Nextgrid 5y agoIn terms of similar “interesting” things one I successfully did in the past that I wanted to share was to have a single Linux environment that you could either boot into or run in a VM. VirtualBox supports fake disk images that are just pointers to a real block device, which could be an entire drive or partition. I took advantage of that to have a dual-boot Linux & Windows 7 install (with the main bootloader still being Windows’ as I hate GRUB) and then created a VM pointing to the Linux partition. The system was configured to be able to deal with both the real hardware and the VM emulated HW. As far as I know most stuff worked out of the box, the only change I had to make was have two network configuration entries - one for physical hardware and one for the VM. This worked really well actually and performance was good.
- Tenoke 5y agoI wish I can easily make this work with WSL. It seems the new features in Windows 11 might make it possible but it's unclear how well it will work.
- deft 5y agoUsing VFIO passthrough and qemu I have the opposite of this which is really convenient, a windows disk that can boot as a vm or normally.
- pitaj 5y agoWhat resources did you use to set this up? This is my dream setup.
- deft 5y agoreddit r/vfio and the arch wiki page here https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF there's also the level1tech forums which have a ton of information on it. The gist of it is this: Qemu with uefi boot, configured through virt-manager, passing in both the gpu and windows boot disk (nvme) as raw devices to the vm.
- 5y ago
- aasasd 5y agoMany moons ago, you were able to not only install Linux in a DOS directory, using probably UMSDOS or perhaps Syslinux—but also take over DOS with Loadlin and launch straight into full-blown Linux: https://en.wikipedia.org/wiki/Loadlin https://en.wikipedia.org/wiki/Loadlin Considering that Windows 95 still was a shell over DOS (until a later update?), you could conceivably just ‘quit to DOS’ and then run Linux. Alas I don't know of a reverse process.
- dehrmann 5y agoBy modern standards, is DOS really an operating system, or is it more of an overgrown bootloader? I remember setting up old games, and having to tune memory settings, specify sound devices, and configure video, almost making them mini OSes.
- marcodiego 5y agoThe 'quit to DOS' option was not enough: it kept some windows bits until running, maybe in TSR mode. To use loadlin, you had to reboot and press f8 during boot and then choose to run DOS.
- pas 5y agoLinux was not able to reset (clean out) those bits?
- marcodiego 5y agoI don't know what linux would actually do in that situation. Actually the loader (loadlin) is what failed. The message was not that informational, somewhat cryptic or non-memorable because I really don't remember anymore. But I think you can see the problem happening again if you try to use one of those distros that booted from a fat filesystem on dosbox.
- gattilorenz 5y agoWould you consider WSL for DOS a good enough approximation of the reverse process? https://github.com/haileys/doslinux https://github.com/haileys/doslinux
- dmarinus 5y agoA trick I used some times was to create a big file on NTFS and use a loop back (block) device to format and mount it as ext4 (root) filesystem. The old kernel ntfs module had already write support for this. It was noticable slower but it didn't mess up the NTFS filesystem.
- reginaldo 5y agoBack in the days of FAT partitions, and when partitioning disks with data was somewhat risky, the first distribution I used was Phat Linux [1], which was installed in the same partition as Windows as well. The main side effect I remember was that all files appeared as executable to Linux. I don't recall how/if it handled symbolic links. [1] https://www.linux.com/news/phat-linux/ https://www.linux.com/news/phat-linux/
- ComputerGuru 5y agoOT but wow have GitHub comments have gone way down in quality.
- richardwhiuk 5y agoThey've been awful for a long time on anything that's widely linked.
- intrasight 5y agoReading these comments has me concerned about even installing Windows and Linux on different partitions of the same drive. Should I be concerned? I have an unused but relatively new Thinkpad onto which I want to install both Windows 11 and Linux.
- Underphil 5y agoIt's much the same as it always was really. If you don't want to dig around in your bootloader, just make sure you install Windows before Linux. Linux installers are usually friendly with Windows, but Windows installers are still hostile to other OSes (I think).
- judge2020 5y agoThe Windows EFI loader only loads Windows, and requires specifically rebooting into advanced startup to choose a different OS (and their mechanism for finding OS's isn't super reliable in my experience)
- Scharkenberg 5y ago> Windows installers are still hostile to other OSes (I think) This only happens in two specific cases: 1. MBR + same physical disk for both OSes; 2. Bad UEFI implementation on the mobo + same physical disk for both OSes. Otherwise it should work flawlessly because their bootloaders are independent and it's only a matter of setting the desired boot order.
- sandGorgon 5y agoThe simplest, non-breaky, reinstall-tolerant way of dual booting is to install operating system on different partitions and NOT install grub or anything to the root/EFI partition. Install your bootloader to the SAME partition as you installed linux in. This is not the default in either windows or linux - and it will try to scare you into not doing it. But do it! Now, use your laptop's built in bios feature - "press f12 while rebooting" to select the disk to boot into. This will never fail. You can reinstall windows as many times as you like. You can burn your linux install and reinstall. They will never screw each other over and you will never be left unbootable.
- devit 5y agoI believe most BIOSes don't let you boot partitions, but only disk MBRs. You can however install GRUB to USB stick and boot the USB stick from the BIOS. This also protects your Linux install against any Windows malware that doesn't change the BIOS if you are careful to remove the stick before booting Windows, put /boot on the USB stick as well and encrypt the Linux partition.
- sandGorgon 5y agothat's MBR mode. If you boot Linux in UEFI mode, it will write the correct bits of info. I have generally not seen a non-UEFI bios or computer in the past 6-7 years. So you should be fine with UEFI. Again, for some reason Linux installers scare you into using MBR mode. Its unnecessary now.
- boomboomsubban 5y agoAnything that relies on your BIOS having a certain feature is a bad plan.
- LogonType10 5y agoSo computers are a bad plan?
- 5y ago
- rubyist5eva 5y agofor the love of god no
- flenserboy 5y agoNot the same thing, but I remember a great hack back in the day — from Byte, I believe — where a 128k Apple IIe/c could live dual boot ProDOS & DOS 3.3 using bank switching, with each OS living in its own bank. Switching was easy, being a simple command line command. That was fun (and occasionally useful).
- wereHamster 5y agoWhat is a bank?
- flenserboy 5y agoMemory was segmented into 2 banks of 64k each. See here (http://www.applelogic.org/files/AIIETECHREF2.pdf http://www.applelogic.org/files/AIIETECHREF2.pdf) — page 80 / page 10 of the PDF.
- 999900000999 5y agoDoesn't subsystem on Windows technically do this?
- judge2020 5y agoWSL 1 effectively, but WSL2 runs as VM with a virtual hard disk, with a default location of %LOCALAPPDATA%\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\ext4.vhdx
- molticrystal 5y agoThings can go much further than just sharing a partition. But it is a shame this project died and wsl1 was abandoned. https://en.wikipedia.org/wiki/Cooperative_Linux https://en.wikipedia.org/wiki/Cooperative_Linux >The term "cooperative" is used to describe two entities working in parallel. In effect Cooperative Linux turns the two different operating system kernels into two big coroutines. Each kernel has its own complete CPU context and address space, and each kernel decides when to give control back to its partner. >However, while both kernels theoretically have full access to the real hardware, modern PC hardware is not designed to be controlled by two different operating systems at the same time. Therefore, the host kernel is left in control of the real hardware and the guest kernel contains special drivers that communicate with the host and provide various important devices to the guest OS. The host can be any OS kernel that exports basic primitives that allow the Cooperative Linux portable driver to run in CPL0 mode (ring 0) and allocate memory.
- samtheprogram 5y agoThank you for bringing back this memory. As a child who had recently installed Linux for the first time, I saw someone presenting at Bentley Systems using CoLinux and have forever wondered what it was (I wasn’t able to speak to them directly nor was it related to the presentation they gave). I dove into virtual machines at the time thinking it was just some seamless graphical sharing and a wallpaper to show it off, but seeing the logo it was definitely this.
- rjzzleep 5y agoI remember using it. Some people were version controlling the win registry and system dll folders. Why did it die?
- foepys 5y agoOne reason was that it was really, really slow when accessing the file system.
- Volundr 5y agoI used CoLinux early in my career. It was great! We had a number of projects that needed Visual Studio, but anything Ruby was just so much better using Linux. VMs were an option but having to context switch between what window I have what open in, plus is it in the VM or my main machine meant I was constantly losing track and having to search for things. CoLinux made it seamless. Really sad to see it's been abandoned. WSL looks pretty good, but not the seamless integration CoLinux had.
- xmodem 5y agoIt is a shame the github page is full of silly comments; if this worked well it would be quite useful.
- R0b0t1 5y agoAre you really sure of that? Why would it be useful?
- xmodem 5y agoIt may not be useful to you, but as someone who maintains a dual-boot Windows/Linux system, I currently have to make an upfront decision about how to allocate storage between Windows and Linux. Having everything in one partition would free me from having to either over-allocate OS-specific space, or risk having to resize partitions later if I run out. It would also eliminate the need to have duplicate copies of certain data across both operating systems.
- rkeene2 5y agoBut the OS partition being shared with Windows isn't buying you these advantages. That is, you can still do all this with installing your Linux-based OS into a fixed size, well-known in advance size (40GiB). The things that grow over time aren't part of the OS, they are user data, which can be shared without doing anything special -- just mount it up.
- gattilorenz 5y ago> The things that grow over time aren't part of the OS, they are user data Unfortunately, that's not entirely true, at least for Windows. OS updates and other files are regularly stored in folders that aren't always trivial to put into a different partition. Not that this is enough of a reason to make this abomination your main install, but...
- R0b0t1 5y ago
- intricatedetail 5y agoThis is like JSX for JavaScript. Love it!
- xuhu 5y agoIf only there was a way using suspend-and-kexec to allow switching in 5 seconds between linux and windows, without having to reboot each time. There was a PoC for WinXP, but I doubt it works with recent Windows versions.
- DeathArrow 5y agoCool. But how would be to run both OS-es on the same time?
- devit 5y agoProbably best to use a subdirectory, and probably even better to loop mount ext4 on a file instead of using ntfs directly.
- cblconfederate 5y agoIsn't UMSDOS a thing anymore?
- cesarb 5y agoIt's weird to see this presented as some sort of novel idea, given that using the same partition for Linux and Windows (and DOS) is how I first ran Linux, more than two decades ago. IIRC, it was even an option on the Linux installer, and no special setup was necessary (and it was one of the most popular distributions, Slackware, not some weird specialist distribution). All the Linux files were on a subdirectory of the FAT filesystem (IIRC C:\LINUX), and the rest of the FAT filesystem appeared as a subdirectory of the root while running Linux (IIRC /dos). The bootloader was a normal DOS executable (LOADLIN.EXE), which could be started through a normal DOS batch file. The Linux filesystem permissions were kept as special files on each directory (visible when running DOS, but hidden by the UMSDOS filesystem when running Linux). It worked perfectly, and is the reason I ended up on Linux instead of one of the BSDs (which would have required me to reformat to carve out a dedicated partition).
- ajsnigrutin 5y agoSo, when will the new version of ZipSlack come out? :)
- pvaldes 5y agoWhy somebody would want this? Either you would be using a Linux in ntfs or Windows in ext4. The GPU would be busy translating between filesystems all day for no reason
- pepoluan 5y ago"You were so preoccupied with whether or not you could, you didn't stop to think if you should." So that was an interesting experiment, but I'm not really sure if that's a good idea. Anyone wants to enlighten me on that?