[{"data":1,"prerenderedAt":363},["ShallowReactive",2],{"en-post-53":3},{"id":4,"title":5,"body":6,"description":12,"extension":356,"meta":357,"navigation":358,"path":359,"seo":360,"stem":361,"__hash__":362},"content/post/53.md","53",{"type":7,"value":8,"toc":346},"minimark",[9,13,16,19,24,31,43,53,57,60,64,89,93,96,172,175,186,190,196,228,231,237,270,276,290,294,297,301,308,312,336,339,342],[10,11,12],"p",{},"Want to learn Linux, run a dev environment, or try a different kind of productivity without losing Windows? A dual boot is the right move. At startup you choose Windows or Ubuntu, and both share one machine. This walkthrough uses the mainstream Ubuntu 24.04 LTS as the example.",[10,14,15],{},"Dual boot is more involved than the alternatives, but it gives each system full access to your hardware, which matters for gaming, GPU work, and native performance. If you only need a Linux command line or the occasional app, the WSL2 route later is far less risky.",[10,17,18],{},"If you dread touching the bootloader or losing data, skip to the safer alternatives at the end, run Linux through WSL2 inside Windows or spin up a virtual machine.",[20,21,23],"h2",{"id":22},"three-safeguards-before-you-start","Three safeguards before you start",[10,25,26,30],{},[27,28,29],"strong",{},"Back up your data."," A dual boot has a small chance of a misstep, so copy important files first, and a recovery guide helps if needed.",[10,32,33,36,37,42],{},[27,34,35],{},"Handle BitLocker."," If C is encrypted with BitLocker, you may be asked for the recovery key after install. Pause protection or note the key first, details in ",[38,39,41],"a",{"href":40},"/post/44/","How to Enable BitLocker on Windows and Back Up the Recovery Key",".",[10,44,45,48,49,42],{},[27,46,47],{},"Partitioning is risky."," Do not delete the EFI or recovery partition. For the partitioning steps see ",[38,50,52],{"href":51},"/post/47/","Split, Extend, and Merge Disk Partitions on Windows, Including Growing C",[20,54,56],{"id":55},"prepare-the-installer-usb","Prepare the installer USB",[10,58,59],{},"Download the Ubuntu 24.04 LTS desktop ISO from the official site. Write it with Rufus 4.x, partition type GPT, target system UEFI, not legacy BIOS. Write mode \"ISO image mode\" is most reliable. Use an 8 GB or larger USB, and copy anything off it first since it gets formatted. Rufus can also make a persistent stick, but a normal install does not need that.",[20,61,63],{"id":62},"windows-side-prep","Windows-side prep",[65,66,67,71,83,86],"ol",{},[68,69,70],"li",{},"Turn off Fast Startup. Settings, Power, Additional power settings, Choose what the power button does, Change settings that are currently unavailable, then clear \"Turn on fast startup\". Otherwise Windows and Linux fight over hardware state, and it also causes the 8-hour clock gap below.",[68,72,73,74,78,79,82],{},"Confirm UEFI mode. Press ",[75,76,77],"code",{},"Win + R",", type ",[75,80,81],{},"msinfo32",", and read BIOS Mode, it should say UEFI. Old Legacy machines differ, this guide assumes UEFI.",[68,84,85],{},"Secure Boot. Ubuntu 24.04 supports it, so you usually leave it on. Only on an old discrete GPU with a closed driver that will not install do you temporarily disable it in the BIOS.",[68,87,88],{},"Make room for Ubuntu. This PC, right-click, Manage, Disk Management, right-click C or a data drive, Shrink Volume, and free 50 GB or more as unallocated space, ideally at the end of the disk, do not create a new volume.",[20,90,92],{"id":91},"boot-from-usb-and-install","Boot from USB and install",[10,94,95],{},"Plug in the USB, press the brand key at startup to open the boot menu, common keys below.",[97,98,99,115],"table",{},[100,101,102],"thead",{},[103,104,105,109,112],"tr",{},[106,107,108],"th",{},"Brand or board",[106,110,111],{},"Boot menu",[106,113,114],{},"BIOS",[116,117,118,130,139,150,161],"tbody",{},[103,119,120,124,127],{},[121,122,123],"td",{},"Lenovo, ThinkPad",[121,125,126],{},"F12",[121,128,129],{},"F2",[103,131,132,135,137],{},[121,133,134],{},"Dell",[121,136,126],{},[121,138,129],{},[103,140,141,144,147],{},[121,142,143],{},"HP",[121,145,146],{},"F9",[121,148,149],{},"F10",[103,151,152,155,158],{},[121,153,154],{},"ASUS",[121,156,157],{},"Esc or F8",[121,159,160],{},"Del or F2",[103,162,163,166,169],{},[121,164,165],{},"MSI board",[121,167,168],{},"F11",[121,170,171],{},"Del",[10,173,174],{},"Pick \"Try or Install Ubuntu\", choose Chinese, connect Wi-Fi, and for installation type pick \"Install Ubuntu alongside Windows Boot Manager\", the safest option that auto-partitions root and swap.",[10,176,177,178,181,182,185],{},"To partition by hand, pick \"Something else\" and on the unallocated space create an EFI system partition (if missing), root (",[75,179,180],{},"/",", ext4, 30 GB or more), home (",[75,183,184],{},"/home",", ext4, the rest), and a swap partition (equal to memory if 8 GB or less). Set region, username, and password, wait for the install, reboot, and remove the USB.",[20,187,189],{"id":188},"common-post-install-issues","Common post-install issues",[10,191,192,195],{},[27,193,194],{},"The 8-hour clock gap."," Linux treats the hardware clock as UTC and Windows as local time, so they overwrite each other. In Ubuntu run this as administrator.",[197,198,203],"pre",{"className":199,"code":200,"language":201,"meta":202,"style":202},"language-bash shiki shiki-themes github-light github-dark","sudo timedatectl set-local-rtc 1 --adjust-system-clock\n","bash","",[75,204,205],{"__ignoreMap":202},[206,207,210,214,218,221,225],"span",{"class":208,"line":209},"line",1,[206,211,213],{"class":212},"sScJk","sudo",[206,215,217],{"class":216},"sZZnC"," timedatectl",[206,219,220],{"class":216}," set-local-rtc",[206,222,224],{"class":223},"sj4cs"," 1",[206,226,227],{"class":223}," --adjust-system-clock\n",[10,229,230],{},"Reboot into Windows once to correct it. The time-sync principle is in the system-clock guide.",[10,232,233,236],{},[27,234,235],{},"GRUB does not show Windows."," In Ubuntu enable os-prober and update the bootloader.",[197,238,240],{"className":199,"code":239,"language":201,"meta":202,"style":202},"sudo apt install os-prober\nsudo os-prober\nsudo update-grub\n",[75,241,242,255,262],{"__ignoreMap":202},[206,243,244,246,249,252],{"class":208,"line":209},[206,245,213],{"class":212},[206,247,248],{"class":216}," apt",[206,250,251],{"class":216}," install",[206,253,254],{"class":216}," os-prober\n",[206,256,258,260],{"class":208,"line":257},2,[206,259,213],{"class":212},[206,261,254],{"class":216},[206,263,265,267],{"class":208,"line":264},3,[206,266,213],{"class":212},[206,268,269],{"class":216}," update-grub\n",[10,271,272,275],{},[27,273,274],{},"Wi-Fi or GPU driver."," Settings, About, Software and Updates, Additional Drivers, tick the vendor driver and apply. Wi-Fi mostly works out of the box, and an old network card may need a wired connection for firmware. On NVIDIA, install the official closed driver for better performance, and check Secure Boot state first.",[10,277,278,281,282,285,286,289],{},[27,279,280],{},"Cannot enter Windows or the bootloader is broken."," Boot the Windows install USB, Repair your computer, Troubleshoot, Command Prompt, and use ",[75,283,284],{},"bootrec /fixboot"," and ",[75,287,288],{},"bcdedit"," to fix the Windows Boot Manager. For serious boot trouble, the recovery guide helps.",[20,291,293],{"id":292},"remove-the-dual-boot-back-to-pure-windows","Remove the dual boot (back to pure Windows)",[10,295,296],{},"In Windows, Disk Management deletes the Ubuntu partitions and returns the space to the original disk. Use the Windows install disk to repair or rebuild the Windows Boot Manager and remove GRUB, or the machine may hang at the GRUB prompt. In the BIOS set Windows Boot Manager as the first boot entry.",[20,298,300],{"id":299},"a-safer-alternative-skip-the-bootloader","A safer alternative, skip the bootloader",[10,302,303,307],{},[38,304,306],{"href":305},"/post/46/","Install and Set Up WSL2 on Windows to Run Linux"," runs Linux command line or desktop inside Windows, no bootloader change, no partitioning, the first choice for development. A virtual machine or Windows Sandbox runs Ubuntu in a virtual PC you can trash with one click. Only when you want a standalone system that uses the full hardware should you do the dual boot here.",[20,309,311],{"id":310},"checklist","Checklist",[313,314,315,318,321,324,327,330,333],"ul",{},[68,316,317],{},"Back up important files.",[68,319,320],{},"Handle BitLocker, see the encryption guide above.",[68,322,323],{},"Turn off Fast Startup.",[68,325,326],{},"Shrink 50 GB or more of unallocated space, see the partitioning guide.",[68,328,329],{},"Rufus writes USB as GPT and UEFI.",[68,331,332],{},"Install \"alongside Windows\".",[68,334,335],{},"Fix the 8-hour gap and confirm GRUB lists Windows.",[10,337,338],{},"The no-bootloader Linux guide, the partition red lines, and the Windows reinstall guide belong together. A dual boot is not hard, the real points are three: back up, BitLocker, and shrink the partition. Get those right and the rest rarely goes wrong.",[10,340,341],{},"After install, keep the Ubuntu USB handy for a day or two, if the bootloader needs repair it is your fastest path back. And remember the three safeguards, a backup, BitLocker handled, and space shrunk, are what turn a scary job into a routine one.",[343,344,345],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":202,"searchDepth":257,"depth":257,"links":347},[348,349,350,351,352,353,354,355],{"id":22,"depth":257,"text":23},{"id":55,"depth":257,"text":56},{"id":62,"depth":257,"text":63},{"id":91,"depth":257,"text":92},{"id":188,"depth":257,"text":189},{"id":292,"depth":257,"text":293},{"id":299,"depth":257,"text":300},{"id":310,"depth":257,"text":311},"md",{},true,"/post/53",{"description":12},"post/53","JtvriizRfIRu-X-HJYGjSI4G1bxcTtNXux_Ub3pPCsU",1794378304084]