30 ms·
WSL2 can now mount Linux ext4 disks directly
- Datagenerator 5y agoSo encrypt your second Linux drive otherwise Microsoft data harvesting might want to take a peek into it.
- trelane 5y agoEven without windows, that's a good idea.
- w4rh4wk5 5y agoThis means you can now chroot into the Linux part of your dual-boot system, doesn't it?
- chrismorgan 5y agoNot if it’s on the same physical disk.
- boomboomsubban 5y agoYou couldn't use two partitions on the same disk? A windows install itself makes three partitions, surely it could see another one.
- lights0123 5y agoWSL2 doesn't support sharing part of a disk yet, it's all or nothing.
- throwawayswede 5y agoWindows is trying to swallow linux. That's all there is to it.
- rafaelvasco 5y agoThere was a reason for me to dual boot Linux before. There's no reason now. Windows now fulfills all my needs. OS singularity.
- rbanffy 5y agoNot sure if the pun was intended, but Microsoft had an experimental OS called Singularity. Legend says it was so heavy it sucked. Ba dum tsss
- throwawayswede 5y agolol, more like OS locking. Enjoy your prison!
- dgellow 5y agoWhat are you talking about? Where is the OS locking mechanism? The anti-MS conspiracies are really out of control.
- throwawayswede 5y agoNot here to argue. Enjoy your gulag.
- dang 5y agoWe've banned this account for repeatedly breaking the site guidelines and ignoring our requests to stop. If you don't want to be banned, you're welcome to email hn@ycombinator.com and give us reason to believe that you'll follow the rules in the future. They're here: https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html.
- Koshkin 5y agoEmbrace, extend, extinguish... Soon enough WSL2 will have (nice) capabilities that the natively installed Linux won't.
- gigel82 5y agoI/O is the biggest issue on NTFS (which is why we use WSL for most of our node work - lots of small files to futz with); how about native (kernel) support for ext4 or zfs? That would be sweet.
- chrismorgan 5y agoOne thing I’m interested in is the ultimate form of dual boot: that you can have a regular Linux distribution installed that you can boot directly, or you can run it inside Windows. Is this going to let that happen, or is this heading in that direction? (I understand that at this stage you can’t mount anything on the Windows installation disk, so I suppose that for now it’d need to be two physically distinct disks at the least.)
- shaan7 5y agoAnd I want to do the exact opposite - basically what VMWare is able to do with Bootcamp installations. Then I could run Linux as I usually do, but not have to maintain a VM for Windows development (MSVC etc). If you try running VirtualBox with raw disk mode and attempt to boot Windows, activation will complain. I guess VMWare has some sort of special access that it can convince Windows Activation that things are okay.
- throwawayninja 5y agoI absolutely love doing this, usually in the other direction: external USB3-or-better hard drive which can boot by itself or be loaded into QEMU on linux/window/macos. Excellent way to treat operating systems like browser tabs.
- pletnes 5y agoI did that about 10 years ago, with virtualbox and «raw disk image» or whatever the feature was called. One physical drive per OS. Worked great for me at the time. No idea if this still works. (Win7 and debian at the time)
- steerablesafe 5y agoI just recently used raw disk images with qemu on Debian to remotely install an other distribution on an other partition and then I rebooted into it.
- trissylegs 5y agoIt works with Hyper-V if you have a whole separate disk for the VM. You can't pass just single partitions to the VM like you can with KVM on Linux.
- Asmod4n 5y agoSo with a self compiled kernel you can now use zfs on Windows? Neat
- lozenge 5y agoBut your Windows NT processes can't access the files
- orra 5y agoPerhaps not as a drive path, but they can via a UNC style path. For example you can browse to these in Explorer: \\wsl$ \\wsl.localhost\Debian
- Mashimo 5y agoYou can run OpenZFS natively on windows as well ;-)
- gpm 5y agoI can confirm that compiling the kernel with f2fs support works, and I can't imagine that zfs is different. Was just a matter of cloning microsofts kernel repo, changing the kconfig to include it, building it, copying it to the windows disk (I built it in wsl), and setting up the wslconfig to point at it.
- pkrumins 5y agoThe one last thing that has kept me from moving all my development to Windows is mounting drives encrypted with `cryptsetup`. Does anyone know if `cryptsetup` now works in WSL2?
- TowerTall 5y agoYes, there is support for LUKS disk encryption https://devblogs.microsoft.com/commandline/servicing-the-windows-subsystem-for-linux-wsl-2-linux-kernel/ https://devblogs.microsoft.com/commandline/servicing-the-win...
- TheRealDunkirk 5y agoI'm still trying to understand the use case. I've been at this for 27 years (or 40, depending on where you want to start), and I just can't understand why anyone cares about WSL2. If you need a Linux VM, I have no idea why you wouldn't run a full-blown VM software like Fusion or VitualBox, and have total control over the emulation, but I guess that comes down to preference. Who here is writing software which runs on Linux, yet needs to be running Windows while they do it? What sort of application is that? What's that software development cycle?
- cjvirtucio 5y agoSome companies only support OSX or Windows workstations, in which case WSL helps (for the latter scenario).
- eledra 5y agoI often use WSL2 for my work on my Windows laptop. It supports Kubernetes, Docker that you installed on the Windows machine. You can also easily throw files, deploy web services, servers on WSL and access it from windows browsers. I can use my MS Office at the same time without any problem. It is much better than using Ubuntu in my opinion
- TheRealDunkirk 5y agoI hear you saying that you like to be able to run native Outlook and Teams while you work on things that need to deploy to Linux. Am I reading that right?
- invokestatic 5y agoI am often happy to give up full control in exchange for convenience. WSL2 works fantastic for very quickly getting a Linux box up and is pre-configured for interoperability with Windows. Sometimes I don’t want to mess around getting these types of tools up myself.
- exnihilo21 5y agoIf your desktop environment is Windows, but an open source project you want to contribute to supports Linux more naturally, but Windows is more tricky to get up and running. It is easier with the support VS code has for the integration with WSL2. I can develop in a Windows environment, but run tests and build on Linux.
- deleted 5y ago[deleted]
- rvz 5y agoGreat! No need to dual boot at all. Can access my disks and all my old Linux installs right inside Windows! BTW, this is a very useful 'Extend-phase' feature from Microsoft that is actually pretty good.
- sys_64738 5y agoMicrosoft will soon be the top Linux company on the planet. They love Linux.
- snerual 5y agoEmbrace, Extent, Extinguish
- lghh 5y agoIs there any evidence that this is actually what's happening? Why does everyone hold on to a 20 year old mantra from a nearly totally different company? Especially when the "extinguish" phase is quite literally impossible. I get spite, I get hating MS, I get it, I really do. But this is pretty clearly not what's happening here. If anything, this is a stab at Apple as it's reaching for web developers using Macbooks. Nobody who uses Linux because they want to is going to use WSL.
- npteljes 5y agoWe repeat the mantra because it's Microsoft's own flavor of the same tactic that many have used before, and will use in the future too. The strategy itself is not unique to Microsoft, it's just a way to gain power over an established player, and I don't expect Microsoft, or any other entity in any power struggle, to play any nicer than the laws allow them.
- lghh 5y agoThat doesn't answer my question though. Is there any evidence that this is what is happening here? If there is, is the "extinguish" phase even possible? I think the answer to both is "no".
- npteljes 5y agoI don't think we'll have evindence, before the fact. But I think that they can gain a lot of control over the Linux ecosystem with WSL. If they introduce new features which people like, and don't make them open source, then the open source ecosystem is either forced to play catch-up, or face becoming less attractive. And now we're talking developers, not even regular users. Imagine 5-10 years passing, a slew of newer generation developers entering the job market, all of them raised on Windows, MS Office, GitHub, Visual Studio and WSL. They don't ever need to leave the MS ecosystem to do their work, and I wouldn't be surprised if they would think that a Linux desktop distribution is like a lamer version of something that works so well as part of Windows. And if this happens, that I'd consider the Extinguish phase.
- greatgib 5y agoGet ready for windows and windows viruses to mess with your linux partitions located on the same computer...
- Lex-2008 5y agoSadly, that's yesterday news. See here: https://security.stackexchange.com/a/249484 https://security.stackexchange.com/a/249484 > ... a newly discovered ransomware variant exhibits the ability to detect and compromise partitions (including hidden partitions), a behavior not thought to have been seen before in ransomware. with a link to original source: https://www.fortinet.com/blog/threat-research/newly-discovered-function-in-darkside-ransomware-variant-targets-disk-partitions https://www.fortinet.com/blog/threat-research/newly-discover... quote from that link: > At the time of discovery, FortiGuard Labs researchers believed the ransomware was seeking out partitions to find possible hidden partitions setup by systems administrators to hide backup files. But further analysis confirmed an even more advanced technique. The DarkSide Ransomware variant seeks out partitions on a multi-boot system to find additional files to encrypt.
- subins2000 5y agoMalware implemented ext4 support before Windows did, lol
- rubyist5eva 5y agoGreat, now do that for Windows.
- k8sToGo 5y agoYou can already access Windows drives through WSL2.
- trelane 5y agoI think they mean having Microsoft provide a Windows VM like WSL, but for the Linux desktop.
- rubyist5eva 5y agoNo, I meant providing linux filesystem drivers in Windows.
- npteljes 5y agoIf you don't mind using a non-MS solution, there are a bunch of ways already. https://www.thewindowsclub.com/how-to-read-ext4-in-windows-10 https://www.thewindowsclub.com/how-to-read-ext4-in-windows-1...
- rbanffy 5y agoGenuinely curious: what keeps developers (I'm assuming developers are the main audience for WSL) from moving to either Mac or Linux? What features Windows has that are missing from either platform?
- jensensbutton 5y agoMacOS is less intuitive to me than windows and I can already run Linux in Windows to get a good desktop + dev experience. I don't see the value in learning a third OS.
- flatiron 5y agoI just recently switched jobs and moved from macOS to Windows (by choice). I agree. I disliked trying to learn all the weird macOS CLI quirks. I just wanted to use Linux where I feel at home. If you run VS Code from the WSL2 honestly it’s pretty close to being on full blown Linux if you squint your eyes a bit. It’s also nice running a non crappy port of office as macOS office is a giant mess.
- npteljes 5y agoThere's a huge human factor, which Microsoft, as a business, exploited very successfully. For many, Windows is the default because that's what you see on other's PC, taught in schools, used in many office environments. And as a tool, it works good enough for them. And change is hard. For many, the FOSS principles are sympathetic, but not compelling enough to change.
- SergeAx 5y agoMac is closed and walled ecosystem with questionable UI/UX running on heavily overpriced mostly unrepairable hardware (also closed). Linux has point blank bad hardware support and UI/UX and missing parts of software here and there. Windows is just working out of box on almost any hardware.
- MaurizioPz 5y agofor me is Visual Studio
- chrsw 5y agoHow are access controls and permissions reconciled? I'm assuming user accounts on the Windows side and Linux side are different. Or would LDAP/AD help to make this WSL2 filesystem integration stuff even more seamless?
- muststopmyths 5y agoWSL2 irritates me for a reason that is not common. It uses this thing called the "Host Compute System" which should theoretically allow one to launch any OS in the same sort of lightweight VM as WSL2. Of course, there are modifications to guest OS (kernel, init for talking over Hyper-V) required, but it should be doable. However, Microsoft does not properly document how to use the HCS to achieve this. I've dived as deeply as I could into the docker shim code for HCS, but wasn't able to figure it out. It's an old story with Windows. Some cool feature buried under poor documentation. Every time I hear someone say "Microsoft has changed", I mutter to myself "nope, same old MSFT with better PR".
- my123 5y agoA sample for it: https://github.com/microsoft/dotnet-computevirtualization https://github.com/microsoft/dotnet-computevirtualization The docs (which are a bit useful): https://docs.microsoft.com/en-us/virtualization/api/hcs/overview https://docs.microsoft.com/en-us/virtualization/api/hcs/over...
- anaisbetts 5y agoI'm sure that now that OP has found out he is wrong, he'll update his tired anti-MS rhetoric, right? Right? (cue Star Wars Padme meme)
- niea_11 5y agoHe may be partly right. The sample code is 4 years old. But the documentation is recent (at least the url linked by gp) : After 2021 june 27 : https://web.archive.org/web/20210627204757/https://docs.microsoft.com/en-us/virtualization/api/ https://web.archive.org/web/20210627204757/https://docs.micr... Before 2021 june 27 : https://web.archive.org/web/20210414223813/https://docs.microsoft.com/en-us/virtualization/api/ https://web.archive.org/web/20210414223813/https://docs.micr...
- muststopmyths 5y agoHave you actually looked at the samples ? You have no information about what is actually required on the guest OS side to make it launchable by HCS. It launches an OS (Windows) that already knows how to interface with HCS. As I said, the docker hcs shim might help one figure everything out, but that's not documentation. Edit: removed unnecessary flaming
- cmurf 5y agoLooks like it can also mount btrfs and xfs directly https://github.com/microsoft/WSL2-Linux-Kernel/blob/linux-msft-wsl-5.10.y/Microsoft/config-wsl#L2827 https://github.com/microsoft/WSL2-Linux-Kernel/blob/linux-ms... https://github.com/microsoft/WSL2-Linux-Kernel/blob/linux-msft-wsl-5.10.y/Microsoft/config-wsl#L2817 https://github.com/microsoft/WSL2-Linux-Kernel/blob/linux-ms...
- pnutjam 5y agoSo btrfs and ext4 now work in Windows... just waiting for xfs.
- arpa 5y agoAnd so EEE marches on.
- simonblack 5y agoIt's time MSFT got over its NIH mindset. ext4 filesystems are well-documented, as are lots of other filesystems. There is no reason at all (apart from Windows lock-in, that is) that MSFT could not provide filesystem drivers for all of those other filesystems.