14 ms·
How to Dual-Boot Ubuntu 20.04 and Windows 10 with Encryption
- inquirerofsorts 6y agoNo mention of the system time issues which can wreak havoc? It's best to fix this on linux with timedatectl. Changing it on windows often ends up being a cure worse than the disease.
- stevehawk 6y agowhat part is breaking my windows clock? i have to reset it with every reboot. do i change it in my bios so windows will be right and linux will be wrong, then tell linux to fix itself? because windows time sync setting sure as hell never actually syncs the time automatically.
- snailmailman 6y agoThe issue is that Linux sets the bios to UTC, while windows wants the bios to be local time zone. I just do a regedit in windows to fix it. But you can do the change in either OS
- lmm 6y ago> The issue is that Linux sets the bios to UTC, while windows wants the bios to be local time zone. UTC is the default in many Linux distributions, but I wouldn't say "Linux sets the bios to UTC"; I've only ever seen it be an explicit choice.
- MrMorden 6y agoYou can always go full there-is-only-Zulu and set the Windows timezone to UTC. (insert head-tapping meme here)
- gear54rus 6y agoThat would fuck over any relative time calculations in calendars (including meetings in google calendar) though wouldn't it?
- MrMorden 6y agoIt shouldn't; I don't use Google Calendar at the moment but Outlook seems to have no problems with people in multiple time zones all seeing the correct time for a meeting.
- simcop2387 6y agoHere's a nice article on how to do the fix, https://www.howtogeek.com/323390/how-to-fix-windows-and-linux-showing-different-times-when-dual-booting/ https://www.howtogeek.com/323390/how-to-fix-windows-and-linu...
- snailmailman 6y agoI’m curious what issues it causes in windows? I’ve never had much of an issue with this. I always change it in windows and I think it’s as simple as a registry edit.
- Shared404 6y ago> I always change it in windows and I think it’s as simple as a registry edit. Simple means different things to different people. I'm fine with messing with the registry, but I know several (technically inclined) people who are not. I find it easier to change in Linux because it's either a setting or in a config file, depending on the distro.
- baddate 6y agohow did you do?
- Shared404 6y agoMost desktops will have a graphical configuration you can use. Alternately, you can use timedatectl on distros with systemd. If you use a non-systemd distro, try hwclock. Based on my ddg-foo, I was mistaken about being able to configure it via a config file, short of putting it in .profile or some such other thing. That seems hacky though, so I wouldn't recommend it.
- fomine3 6y agoPossibly move to UK is a solution :)
- xaduha 6y agoIt's easy enough when things are on separate disks. Disk partitioning for dual-boot always was and always will be crap.
- jnwatson 6y agoI've done it for so long and have never had an issue. Every once in a while Windows overwrite the boot sector and you have to stick in a rescue stick. Not a huge problem.
- MikusR 6y agoWith uefi that seems to not be a problem.
- rand0mx1 6y agoI used to dual boot windows xp and windows 98 on same hdd, never faced any problem. However, Linux and Windows always conflict if dual boot is on same hdd.
- tamrix 6y agoThat is until you use TPM to decrypt your windows partition automatically. If you boot the Linux boot manager on another drive, Windows won't decrypt its drive automatically. So you have to boot the Windows boot manger. At which point is easier to just select your boot drive on Startup. You can however use other tools to encrypt/decrypt the windows drive besides bit locker and it will work. TPM2 to decrypt your Linux drive on boot is a bit of a pain too.
- usr1106 6y agoWhat's the point of using a TPM to decrypt your disk automatically? You use disk encryption to be protected against the case that the computer gets stolen. But that means the attacker has your TPM and can use it. The only way to prevent that is requiring a BIOS password at boot (not very common) and secure boot (and like in the article many Linux users skip that because it can require extra knowledge and extra work.) So you replaced entering a disk password by entering a BIOS password. What's the benefit from usability perspective? (Yes, secure boot would add security I don't try to deny that.)
- paulryanrogers 6y agoHaving done this a few times with older releases using Veracrypt and LUKS I wouldn't wish it in anyone. Dist upgrades become nigh impossible.
- hermitmaster 6y agoWith the recent advances in WSL2, I’d say dual booting is hardly worth the effort anymore. This is assuming you need Windows.
- dheera 6y agoI gave up on dual-booting a long time ago and 2 OSes fighting over overwriting the MBR every time I wanted to upgrade one or the other. It's just so much easier to maintain 2 machines.
- zeta0134 6y agoI solved for this by simply giving Windows and Linux a hard drive each. The boot records are completely separate, and neither one tries to read data from the other. (Personally I have no need, my NAS handles any file level syncing, but that's minimal anyway.) Both Windows and the Linux boot are registered in UEFI, so I asked my BIOS to disable the hard drive preference and pop up the boot menu each time, letting me pick which OS to use manually.
- josteink 6y ago> I gave up on dual-booting a long time ago and 2 OSes fighting over overwriting the MBR every time This is why UEFI was invented, and if You actually read the post, you would know it details how you set this up with UEFI instead of legacy boot and have none of those troubles.
- arathore 6y agoI am considering building a PC for programming and am genuinely curious if WSL2 can be considered a replacement for dual booting Linux and Windows? I am currently rocking a dual boot system (with legacy bios) and haven't had any issues so far.
- meddlepal 6y agoIt's pretty close. Big pain point for me still is that running an IDE from Windows and accessing the Linux FS is not quite as snappy as native-Linux (I use IntelliJ). So for now I still dual-boot. This is apparently being worked on... in the future I will be able to run the IDE inside WSL and it will bridge X11/Wayland to Windows.
- corruptedX 6y agoI gave up dual booting after they released WSL2.
- swebs 6y agoFunny, I gave up on dual booting after they released Proton.
- nerdwaller 6y agoI’ve had a lot of hope for wsl2, so much so that I’ve been using it as my daily os. However recently some directories under wsl2 are just empty and seem to be unrecoverable. I’ve filed a bug, however I can’t find a way to reproduce it so I don’t expect much motion. So far it’s just random directories are empty and I can’t delete them due to the resource being busy, and unfortunately the Linux utilities to check the locks on the directories error out. I hope I’m just the exception here, but I’ve had to start re-evaluating what I’m going to do longer term, the short term is easier (push all).
- nXqd 6y agosame here, it depends on how they use the OS for. I develop with cross platform language most of the time ( Go, Rust, C++ ), WSL2 with Windows does the job beautifully :)
- fulyscentedking 6y agoI gave up Windows10, I mean Spyware10, after I managed to do everything I needed on GNU/Linux.
- AnonC 6y agoIs there any way to do this on a dual boot system without having to erase everything and reinstalling both the OSes?
- chrios 6y agoMuch easier to run Linux on encrypted partition and have a Windows 10 VM in KVM.
- Osiris 6y agoIsn't the point of dual booting that there are things you can't do in a VM, like gaming?
- batrat 6y agoThere is also a thing called Virtual Function I/O and you can read more here: https://www.reddit.com/r/VFIO/ https://www.reddit.com/r/VFIO/ (basically you can pass hardware directly to VM and enjoy)
- Macha 6y agoNote that for an NVIDIA consumer GPU, you can't really use it in the host and VM at the same time practically because they try to restrict that feature to their data center cards. You'll need another GPU to render your Linux environment if you pass through your main GPU, and most gamers are likely using NVIDIA consumer GPUs. If you have a F series Intel CPU or AMD cpu with no onboard graphics then,that means you'll need a free PCIe slot and another gpu (but even something like a GeForce 1030/radeon 570 will do for non-gaming Linux use)
- my123 6y agoAMD customer GPUs have SR-IOV disabled too. If you want to use your customer-grade GPU on both the host and guest, there's only a single option: Intel. However, the current product on the dGPU market, Xe MAX isn't exactly the top-end GPU that people are searching for.
- solarkraft 6y agoExcept it doesn't work in a ton of cases. I've tried for days.
- IvyMike 6y agoI'm curious: why not run one or the other in a VM? Looking at Mike's resume, the technologies he is working with (LAMP stack, Ruby, PHP) seem like they would run perfectly fine in a VM. I've been doing embedded development (with a Linux based toolchain) on a Windows 10 host with Ubuntu in a VM, and it seems to be plenty nice on modern hardware (and a lot of RAM). And I don't have to make a choice to boot back and forth: Two systems for the price of 1.5. :) Edit: My question aside, I fully appreciate the article's primary goal, which is to document the nonobvious hoops the author had to jump through to get dual boot to work. Thanks!
- skohan 6y agoI dual-boot on my media PC, where Ubuntu is my primary system, and I boot into Windows to play a few video games which don't work in Proton. That's one case where you don't want to pay the performance overhead for virtualization, but I'm sure there are plenty of other cases where dual-booting is preferred.
- matharmin 6y agoI run Ubuntu on a Dell laptop. I still keep the OEM Windows copy installed for one reason only: Contacting Dell support for warranty-related issues. This usually requires running their Windows-only diagnostics tools.
- 6y ago
- unnouinceput 6y agoOr, hear me out, buy cheap SSD for each operating system. For as low as $200 you can have a solid operating system of any flavor. Not an option because you're running thing on laptop and is not good to tear the laptop apart to replace SSD? OK, then how about: Run each operating system in it's own VM and you can encrypt its folder. Not an option because you want to use games on your Windows and those are notoriously difficult to run inside a VM? OK, then how about: Run a hypervisor on bare metal, like VMWare ESXi. You get now each operating system to be running on bare metal just like if it's alone and on Windows you can definitely play those notorious difficult games.
- meddlepal 6y ago> Run a hypervisor on bare metal, like VMWare ESXi. You get now each operating system to be running on bare metal just like if it's alone and on Windows you can definitely play those notorious difficult games. This is exactly how WSL2 works. Windows and Linux run as guests under Hyper-V.
- unnouinceput 6y agoHyper-V would not be able to run Red Dead Redemption 2. VMware ESXi with a Win10 guest OS can.
- meddlepal 6y agoWat? I play games all the time on my Windows 10 + WSL2 setup.... which is exactly as I described: Windows running as a guest under Hyper-V alongside Linux.
- unnouinceput 6y agoAnd you have RDR2 running in that configuration? I mean to run RDR2 in your Windows guest OS that runs under Hyper-V? Because I tried that and it won't run. I could only run it under VMWare ESXi
- skohan 6y agoOn a side note, does anyone know if you can use fast boot on a system which dual-boots with grub? I have a motherboard which supports fast-boot, but I understand enabling it makes it difficult to get into the BIOS so I am hesitant about enabling it.
- djsumdog 6y agoThe author isn't encrypting /boot. GRUB does support this if you're using LUKS1 (and LUKS2 is coming soon). I wrote a guide for doing this with Alpine: https://battlepenguin.com/tech/alpine-linux-with-full-disk-encryption/ https://battlepenguin.com/tech/alpine-linux-with-full-disk-e...
- ohazi 6y agoHas there been any work on speed improvements? I did this LUKS1 encrypted boot partition thing on a relatively recent laptop, and GRUB takes about 25 seconds to validate the passphrase. Once it loads the initrd, the early kernel environment validates the the root volume passphrase in about 2 seconds, presumably because it's using an optimized implementation that's available in the kernel but not in GRUB... Right now I wouldn't recommend doing this unless you have a really good reason for encrypting the boot partition. Most people will be better off having an unencrypted boot and enabling secure boot with your own platform key instead.
- Macha 6y agoMy understanding is the LUKS header block contains a key actually used to decrypt your data, but that key is itself decrypted by a key derived from your password or other auth data. grub is using the first key to obtain the second key, the kernel already has the second key (or you'd have to enter your password again). When you set up the encrypted drive, it deliberately picks settings for this that will be as slow as possible to resist brute force attacks while also aiming not to take over 30s on your current CPU. You'd have to manually specify a lower iteration count to cryptsetup to get a faster unlock.
- ohazi 6y agoI'm on a different machine now, but I'll have to go back and verify what I did -- it sounds like I may have set it up incorrectly. My /boot is a LUKS1 volume, and I thought that my GRUB boot passphrase for this volume was in the first slot, and that I was using the same iteration count as the root volume. My / is a LUKS2 volume with a different passphrase that I need to enter after the initrd has been loaded. Decrypting the root volume is fast, so I suspect I set this one up correctly. Once the root volume is decrypted, I have a separate key on the filesystem to re-decrypt /boot so that it can be mounted without re-entering the /boot passphrase. This part is also fast. Something must have gone wonky with the boot passphrase. Either a crazy iteration count or a key slot that forces GRUB to not test it first.
- mkl95 6y agoThese days, I use an SSD for each OS —Windows 10 to play games, Ubuntu for everything else— and it works perfectly. Before the cheap SSD era I found dual booting to be a nightmare, though it taught me a lot about GRUB workarounds :)
- nickjj 6y agoEven with SSDs I still find dual booting to be painful enough to avoid. Mainly because of how disrupting it is to have your dev environment torn down when you reboot and then having to set it all back up when you come back. Even with tmux and using resurrect it's not a seamless experience. This is an issue even with a few second turn around time on the dual boot itself. Around 8 or 9 years ago I used to dual boot, then I transitioned to a Linux VM with Unity mode (vmware workstation's seamless mode to run apps in their own floating window) then to WSL 1 and now WSL 2. The only way I think things will get better is going native Linux with a GPU pass through KVM based VM running Windows to play games from Linux at native speeds without dual booting but it's a huge pain to set this up properly.
- xiaomai 6y agoThis is a great article. I have a different strategy that I think is "better" in a few ways but definitely still complicated. (I'm assuming this is starting on a machine that already has windows on it because that's how my computers generally come (although maybe not the future since Lenovo is selling Thinkpads with Linux now): Step 1. Install Ubuntu (let it set up the dual-boot stuff for you). The main advantage of this approach is I don't have the issue where grub can't boot windows as described in the article. (NOTE: ubuntu's installer won't do encryption in this setup for some reason: Ubuntu please fix this and save me the following steps!): Step 2: reboot into the installer. Now things are going to get crazy. Step 3: shrink the ubuntu partition as small as it will go (resize2fs -M ...). Then create a new partition of the same size at the end of the drive and copy the data over to the new partition. Step 4. delete the original ubuntu partition. replace it with a /boot partition and a luks partition. Step 5. Copy the boot stuff into /boot, copy the rest of the data onto your new encrypted / partition (i usually do lvm here also). chroot into the /, do the mounting stuff TFA suggests, install lvm/dmcrypt/etc. Reconfigure your initramfs and run update-grub. Step 6. Delete the copy of the original ubuntu partition made in step 3 and resize the encrypted partition as needed. OK I agree that's a pretty ridiculous sequence and I wish Ubuntu would do it for me, but it's pretty cool that it can be done at all (takes about an hour).
- nyanpasu64 6y agoCan you share files between Ubuntu and Windows, by mounting BitLocker on Linux and LUKS/ext4 on Windows?
- Fnoord 6y agoYou could do that with TrueCrypt/VeraCrypt. Ext4 read/write for Windows, Btrfs for Windows, NTFS for Linux/Mac (FUSE or Paragon). APFS aldo exists for Windows
- avian 6y agoNone of these do what the OP is asking. AFAIK there is no way to share files between the systems with the setup described in the article (short of something like a network sync or using an unencrypted USB key) > Ext4 read/write for Windows, Btrfs for Windows Useless if using LUKS. > NTFS for Linux/Mac (FUSE or Paragon) Useless if using BitLocker.
- Fnoord 6y agoYou can also play with VMs, example [1]. Other than that its a reason you don't want an OS specific FDE but a platform agnostic one. You can, of course, swap to such. [1] http://augustbonds.com/luks-encrypted-ext4-drive-in-windows-using-virtualbox-raw-disk-access/ http://augustbonds.com/luks-encrypted-ext4-drive-in-windows-...
- deleted 6y ago[deleted]
- c-c-c-c-c 6y agoDont use swap on laptops with emmc ssd's or with ssd's period. Constant read writes will wear them out quickly. Just get more ram.
- 3np 6y agoAlternatively (or complimentary) to "get more RAM", to prevent system ping south as RAM fills up set vm.swappiness to 0 or 1, and configure an OOMKiller (anyone have thoughts on which is "best"?).
- pongo1231 6y agoThis used to be case with consumer SSDs many years ago, nowadays the effect it has on the life span of an SSD is marginal. I had (and still have) my swap file / pagefile on my cheap laptop with 4GB RAM on the SSD it came with for 5 years now and the SSD is still perfectly fine.
- tegiddrone 6y agoThe times I've done this in the past I've had to rely on buried forum posts or "hope for the best" with the linux installer options. Includes ambiguous reports on how encryption effects ssd wear/trim/etc. I recently upgraded my laptop and stuck a new nmve ssd with hardware encryption features. It does have some security trade-offs but does protect decently against common theft and is hella convenient that it's all mostly managed in hardware beyond a pre-boot unlocker and a suspend-state kernel hack. Still had to dig deeeep into github issues to get it going in Linux. Works out of the box with Bitlocker allegedly.
- cambinoda 6y agoFrom what I understand, kvm/proxmox lets you switch OS in Linux, HyperV in Windows, and macOS hypervisor even on Apple Silicon: https://developer.apple.com/documentation/hypervisor/apple_silicon https://developer.apple.com/documentation/hypervisor/apple_s... Will these all allow encryption?
- nsonha 6y agoDoes anyone else have their system time messed up by dual boot?
- Worta 6y agoThat happens because Windows and UNIX interpret the time differently (Windows as local time, UNIX as UTC). So you either change UNIX to use local time or Windows to use UTC by changing a registry value. A quick google should tell you how you can achieve that
- deleted 6y ago[deleted]
- lights0123 6y agoThat's because Windows stores time in the RTC as local time, while Linux stores it as UTC. You can make Linux adjust to Windows or Windows adjust to Linux, but it's probably better to make Windows behave like everyone else: https://www.howtogeek.com/323390/how-to-fix-windows-and-linux-showing-different-times-when-dual-booting/ https://www.howtogeek.com/323390/how-to-fix-windows-and-linu... (Option 2)
- forest_dweller 6y agohttps://wiki.archlinux.org/index.php/System_time#UTC_in_Windows https://wiki.archlinux.org/index.php/System_time#UTC_in_Wind... IME it worked better the other way around, setting Linux to local time. But the Wiki recommends the opposite.
- nsonha 6y agooh thanks, I remember glancing over that information at some point but I rarely boot into windows these days so was never motivated to look into it.
- officeplant 6y agoThanks for this. I've had to just make it a habit to adjust the time anytime I boot into windows.
- dwheeler 6y agoHas anyone talked with Ubuntu about tweaking its install process to make this easy? I imagine many people have a machine they want to run Windows on & don't want to pay for (or lug) an extra drive. It's probably a relatively small change to the installer, and a big win for ease-of-use.
- londons_explore 6y agoWow - 20 years on, and windows, OSX and Linux still don't peacefully coexist. Seriously it shouldn't be hard - you should be able to install the OS's in any order and have the installer simply set up a boot menu asking which to boot. There should be some cross platform filesystem or LVM-like system so storage space can be dynamically shared with all the OS's. Uninstallation of the OS should be as simple as installation too. Today as far as I'm aware no major OS has an uninstaller.
- Tsiklon 6y agoFormatting the partition(s) your OS is installed on is the uninstallation method. Uninstalling from the disk implies that you'll reuse the existing filesystem on the computer. Each of your named OSes has different preferences as to which filesystem they will run on, each filesystem with different capabilities and expectations. Windows - NTFS, OS X - APFS and HFS+, Linux - depending on which flavour you choose. Thus an uninstallation program isn't really much use, because the installation of anything new should blow that away. Or is it you wish that your computer had a bootstrap program when you powered it on which would source an installation image (for Windows, OS X, whatever Linux flavour you prefer)? To that last one Apple machines do offer this in a limited fashion in the form of "Internet Recovery", plug in a blank disk into a Mac or delete the GPT on your SSD and it will offer to connect to wifi/ethernet to download the installation image for either the version of OS X it shipped with, or alternatively the version last installed (I cannot recall which). Though of course it won't help source any installation media of the other OS families. This installation image is a cut down version of OS X which will provide just enough drivers to get the system functional, the disk drive formatting tools, a command line interface with a number of basic system tools to troubleshoot with, and a functioning web browser.
- londons_explore 6y ago> Formatting the partition(s) your OS is installed on is the uninstallation method. Except it isn't... Start with a dual boot windows and linux system, and delete the linux partition... And suddenly windows won't boot! Or with some UEFI setups, leaves linux as a default boot option that half boots linux and then won't complete because it can't mount the root filesystem. It's just poor design. I'm imagining something more like the UEFI menu having a "Right click, Delete" option next to each bootable OS. Clicking delete would run that OS's uninstaller code and refresh the menu. You could likewise have a "Add new OS" button in the UEFI firmware where you can select from a list of available OS's to download from the net, or provide your own URL to an iso or some installation metadata file.
- e12e 6y agoI wonder if windows 10 can/will be able to boot off zfs ? Then we'd finally be able to share a disk and let zfs deal with encryption...
- ubercow13 6y agoWhy would that ever happen? Anyway you can boot a Windows VM off of zfs already.
- e12e 6y agoWhy not? There's already support for zfs.
- ubercow13 6y agoSupport in Windows? What support? Windows can't even boot from Microsoft's newer ReFS filesystem.
- e12e 6y agoObviously not boot support yet (or anytime soon) - but does W10 support booting off non ntfs at all? Fat32/fatx/iso/udf? Just being able to use it for mostmight allow a boot/rest-of-disk split like with Linux? I don't know, but I think it's an interesting idea. ReactOS on zfs... https://github.com/openzfsonwindows/ZFSin https://github.com/openzfsonwindows/ZFSin
- benibela 6y agoI just went from a linux laptop to a dual boot laptop I already have enough trouble with an unencrypted file system Not sure where to keep my user files. On NTFS, they are hard to reach from linux. On ext, they are hard to reach from Windows. On exFAT, there is no journaling Now I put them all on NTFS.