Files
MajorWiki/01-linux/distro-specific/wsl2-instance-migration-fedora43.md
MajorLinux 87d63039af wiki: audit fixes — broken links, wikilinks, frontmatter, stale content (66 files)
- Fixed 4 broken markdown links (bad relative paths in See Also sections)
- Corrected n8n port binding to 127.0.0.1:5678 (matches actual deployment)
- Updated SnapRAID article with actual majorhome paths (/majorRAID, disk1-3)
- Converted 67 Obsidian wikilinks to relative markdown links or plain text
- Added YAML frontmatter to 35 articles missing it entirely
- Completed frontmatter on 8 articles with missing fields

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 11:16:29 -04:00

2.7 KiB

title, domain, category, tags, status, created, updated
title domain category tags status created updated
WSL2 Instance Migration (Fedora 43) linux distro-specific
wsl2
fedora
windows
migration
majorrig
published 2026-03-06 2026-03-08

WSL2 Instance Migration (Fedora 43)

To move a WSL2 distro from C: to another drive, export it to a tar file with wsl --export, unregister the original, then re-import it at the new location with wsl --import. After import you'll need to fix the default user — WSL always resets it to root on import, which you patch via /etc/wsl.conf.

The Short Answer

wsl --terminate Fedora-43
wsl --export Fedora-43 D:\fedora_backup.tar
wsl --unregister Fedora-43
mkdir D:\WSL\Fedora43
wsl --import Fedora-43 D:\WSL\Fedora43 D:\fedora_backup.tar --version 2

Then fix the default user — see Steps below.

Background

WSL2 stores each distro as a VHDX on whatever drive it was installed to, which is C: by default. If you're running Unsloth fine-tuning runs or doing anything that generates large files in WSL2, C: fills up fast. The migration is straightforward but the import resets your default user to root, which you have to fix manually.

Steps

  1. Shut down the instance cleanly
wsl --terminate Fedora-43
  1. Export to the destination drive
wsl --export Fedora-43 D:\fedora_backup.tar
  1. Remove the C: instance
wsl --unregister Fedora-43
  1. Create the new directory and import
mkdir D:\WSL\Fedora43
wsl --import Fedora-43 D:\WSL\Fedora43 D:\fedora_backup.tar --version 2
  1. Fix the default user and enable systemd — edit /etc/wsl.conf inside the distro
[boot]
systemd=true

[user]
default=majorlinux
  1. Restart WSL to apply
wsl --shutdown
wsl -d Fedora-43

Gotchas & Notes

  • Default user always resets to root on import — this is expected WSL behavior. The /etc/wsl.conf fix is mandatory, not optional.
  • Windows Terminal profiles: If the GUID changed after re-registration, update the profile. The command line stays the same: wsl.exe -d Fedora-43.
  • Verify the VHDX landed correctly: Check D:\WSL\Fedora43\ext4.vhdx exists before deleting the backup tar.
  • Keep the tar until verified: Don't delete D:\fedora_backup.tar until you've confirmed the migrated instance works correctly.
  • systemd=true is required for Fedora 43 — without it, services (including Docker and Ollama in WSL) won't start properly.

Maintenance Aliases (DNF5)

Fedora 43 ships with DNF5. Add these to ~/.bashrc:

alias update='sudo dnf upgrade --refresh'
alias install='sudo dnf install'
alias clean='sudo dnf clean all'

See Also

  • Managing disk space on MajorRig
  • Unsloth QLoRA fine-tuning setup